Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgraphs for ClassDiagrams #3939

Closed
jcurtis-cc opened this issue Dec 23, 2022 · 1 comment
Closed

Subgraphs for ClassDiagrams #3939

jcurtis-cc opened this issue Dec 23, 2022 · 1 comment
Labels
Graph: Class Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@jcurtis-cc
Copy link

jcurtis-cc commented Dec 23, 2022

Proposal

It's useful to be able to make sections of class diagrams visually distinct in the same manner as subgraph is used for flowcharts. Applying this to class diagrams is common in other UML languages.

Example

classDiagram
direction RL

%% create graph edges
AbstractExpression <--o `Client Application` : aggregates
`Client Application` --> `Context` : uses

%% create a subgraph like in a flowchart
subgraph ast ["Abstract Syntax Tree"]
TerminalExpression --|> AbstractExpression : extends
NonTerminalExpression --|> AbstractExpression : extends
NonTerminalExpression o--> AbstractExpression : aggregates
end

%% create subgraph edge to node outside subgraph
ast -->  `Context` : uses

%% create class definitions
class AbstractExpression{
    +interpret()
}
class TerminalExpression{
    +value
    +interpret()
}
class NonTerminalExpression{
    +left
    +right
    +interpret()
}

Screenshots

interpreter_concept

@jcurtis-cc jcurtis-cc added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Dec 23, 2022
@jgreywolf
Copy link
Contributor

Dupe of #3384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Class Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants