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
68.69k stars 6.07k forks source link

Flowchart: Option to add Non Forcing Edges #5534

Open shekharsom opened 1 month ago

shekharsom commented 1 month ago

Proposal

Mermaid should add an option to add non forcing edges. Currently, all edges are used to finally render the chart. I suggest adding a new type of edge that is not affecting the layout.

Current Syntax:

a-->|Title| b

Proposed syntax: a-x->|Title| c

How to Implement:

There can be two approaches:

  1. Use main edges first to define the final layout and then place other edges without affecting the layout
  2. Use some kind of weightage to allow the tension on the edge. We could use a different syntax then:

a-40->|Title| b a-10->|Title| c

Example

image

Here, the step c is not important to the flow and hence shouldn't affect the overall flow. If we could make the edges to c irrelevant, it will not affect the layout and redirect the layout easily.

Screenshots

No response