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

Class diagram: Add support for cardinalities #949

Closed
klemmchr opened this issue Sep 22, 2019 · 1 comment
Closed

Class diagram: Add support for cardinalities #949

klemmchr opened this issue Sep 22, 2019 · 1 comment
Assignees
Labels
Graph: Class Status: Approved Is ready to be worked on Type: Enhancement New feature or request

Comments

@klemmchr
Copy link
Member

In UML diagrams the cardinalities are written next to the class they belong to.

This is not possible in mermaid currently. A workaround for this would be to write the cardinalities in the label of arrow.

classDiagram
Class01 *-- AveryLongClass : 1 : 1..n
Loading

image

However, this workaround is ambiguous as you need to define which part belongs to which class. This makes reading the cardinalities in a fast way impossible.

Given the fact that it's possible to use aggregations and compositions arrows there should be support to define the cardinalities. The syntax for this could look like this, where the seperator is another colon

Class01 *-- AveryLongClass : 1 : 1..n
Loading

or with any other seperator char, like a pipe

Class01 *-- AveryLongClass : 1 | 1..n
Loading

If there is no seperator char it should be placed as an ordinary label.

@IOrlandoni IOrlandoni added Graph: Class Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Status: Pending Is not to be executed as it currently is and removed Status: Triage Needs to be verified, categorized, etc labels Sep 24, 2019
@ashishjain0512 ashishjain0512 self-assigned this Sep 25, 2019
@IOrlandoni IOrlandoni added Status: Approved Is ready to be worked on and removed Status: Pending Is not to be executed as it currently is labels Sep 25, 2019
@IOrlandoni
Copy link
Member

This was released in 8.4.0

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Graph: Class Status: Approved Is ready to be worked on Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants