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
Currently, Mermaid does not allow subgraphs to have a different direction (e.g. LR, TD, BT, etc.) from the main graph. This limits the flexibility when designing complex diagrams that require nested directional flows.
Motivation
In large systems or workflows, it is common to have a top-down overall structure (TD), but with certain modules or components better represented with left-right (LR) flows.
Example use case:
graph TD
A --> B
subgraph Sub
direction LR
B1 --> B2 --> B3
end
B --> C
Currently, the direction LR inside the subgraph is obviously ignored.
Proposed Solution
Enable direction override within subgraphs. This could follow a syntax like:
subgraph Sub [Sub Module]
direction LR
B1 --> B2 --> B3
end