You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Mermaid flowcharts, edge labels are strictly bound to individual edges. This makes it impossible to express a common conditional transition that later branches without duplicating the label on multiple edges.
Example:
flowchart TD
A -->|is_alive? yes| B
A -->|is_alive? yes| C
flowchart TD
A -->|is_alive? yes| B
A -->|is_alive? yes| C
Loading
This renders the same condition text twice, which becomes visually noisy and semantically redundant in larger diagrams.
Desired Behavior
It should be possible to express a single labeled transition that subsequently fans out to multiple nodes, conceptually equivalent to:
A --(is_alive? yes)--> {B, C}
This would allow the condition to be rendered once, improving readability and reducing duplication.
Current Workaround
The only supported workaround is to introduce an intermediate junction node:
flowchart TD
A -->|is_alive? yes| _J(( ))
_J(( )) --> B
_J(( )) --> C
flowchart TD
A -->|is_alive? yes| _J(( ))
_J(( )) --> B
_J(( )) --> C
Loading
While functional, this has drawbacks:
Adds artificial nodes that do not exist in the logical model
Requires additional styling to make the junction visually neutral
Scales poorly in complex decision-heavy diagrams
Question
Is this limitation a deliberate design decision, or would the maintainers be open to discussing a feature that enables shared edge labels for branching paths?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In Mermaid flowcharts, edge labels are strictly bound to individual edges. This makes it impossible to express a common conditional transition that later branches without duplicating the label on multiple edges.
Example:
flowchart TD A -->|is_alive? yes| B A -->|is_alive? yes| CThis renders the same condition text twice, which becomes visually noisy and semantically redundant in larger diagrams.
Desired Behavior
It should be possible to express a single labeled transition that subsequently fans out to multiple nodes, conceptually equivalent to:
This would allow the condition to be rendered once, improving readability and reducing duplication.
Current Workaround
The only supported workaround is to introduce an intermediate junction node:
flowchart TD A -->|is_alive? yes| _J(( )) _J(( )) --> B _J(( )) --> CWhile functional, this has drawbacks:
Question
Is this limitation a deliberate design decision, or would the maintainers be open to discussing a feature that enables shared edge labels for branching paths?
Beta Was this translation helpful? Give feedback.
All reactions