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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#1193): render multiple relations #1195

Merged
merged 1 commit into from Jan 15, 2020
Merged

fix(#1193): render multiple relations #1195

merged 1 commit into from Jan 15, 2020

Conversation

fgrandel
Copy link
Contributor

@fgrandel fgrandel commented Jan 9, 2020

馃搼 Summary

Resolves #1193

馃搹 Design Decisions

In graphlib edges have an ID that is constructed from the nodes being linked plus an (optional) name. If two edges are provided with the same nodes and name (or no name at all) then they overwrite each other. Mermaid's class diagram parser already collected the relations correctly but added them without name. I'm now using the relation label as a natural choice for the edges name. This fixes the problem.

馃搵 Tasks

Make sure you

  • 馃摉 have read the contribution guidelines
  • 馃捇 have added unit/e2e tests (if appropriate)
  • 馃敄 targeted develop branch

@IOrlandoni IOrlandoni requested a review from knsv January 9, 2020 18:38
@knsv knsv requested review from jgreywolf and removed request for knsv January 14, 2020 07:54
@callaertanthony
Copy link

Hi !
It seems that the solution provided only resolves Class Diagram, is it possible to also consider State Diagram ?
This would offer the possibility for a state to have multiple transitions for a same sink.

stateDiagram
	State1 --> State2 : transition1
	State1 --> State2 : transition2

Copy link
Contributor

@jgreywolf jgreywolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note - when there is more than one relation the relation text overlaps each other making it hard to read. I believe that this has more to do with positioning and overlap for class diagrams in general, and since there are already a couple of open issues on those not going to hold this one

@jgreywolf jgreywolf merged commit 0e02cf5 into mermaid-js:develop Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Class Diagram - Multiple relations are discarded.
3 participants