mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.58k stars 6.48k forks source link

Here's a patch to add unique IDs to flowchart edges (just one line of code) #701

Closed crankycyclops closed 5 years ago

crankycyclops commented 6 years ago

After some digging into the mermaid source, I've discovered that it would be trivial to add IDs to the flowchart edges, which would help not just myself, but others as well (see: #583)

Here's my proposed patch: https://gist.github.com/crankycyclops/ecfe70d6e6546db1345ebe77596f0e39

eduo commented 6 years ago

Is this a patch to add css IDs? Are there css IDs for other elements now?

crankycyclops commented 6 years ago

@eduo, yeah. The nodes in the graph already had ids (identical to the names given in the flowchart definition.) Some people (including myself) wanted to be able to attach click events to the edges as well as the nodes, but doing so doesn't really accomplish much if you have no way to uniquely identify them. So this small patch adds an id to each edge which is a composite of both nodes' ids.

eduo commented 6 years ago

Ah. You're right. I was using the dist from the CDN and I wasn't seeing this. I even opened a ticket for it. Thanks!

samevans commented 5 years ago

Attempting to bump this so this will get added

Heiko-san commented 5 years ago

The IDs from that patch are NOT UNIQUE, see my comment at https://github.com/knsv/mermaid/issues/583

github-actions[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you are still interested in it, and it is still relevant, you can comment or remove the label to revive it.

stale[bot] commented 5 years ago

This issue has been been automatically closed due to a lack of activity. This is done to maintain a clean list of issues that the community is interested in developing.