Direction TD Inside subgraph Causes Parsing Error #6338
Labels
Status: Triage
Needs to be verified, categorized, etc
Type: Bug / Error
Something isn't working or is incorrect
Description
In Mermaid.js, setting
direction TD
inside asubgraph
results in a parsing error, while other directions (LR
,RL
,BT
) function correctly.This is inconsistent because:
TD
is a valid global direction.direction
is generally allowed insidesubgraph
for other layouts.Steps to reproduce
Case 1: direction TD Fails Inside Subgraph
Expected Behavior:
The subgraph should follow TD direction, positioning nodes from top to bottom.
Actual Behavior:
Mermaid.js throws a parsing error.
Case 2: TD Works Globally
Expected and Actual Behavior:
The subgraph correctly follows TD layout, confirming that TD is valid globally.
Case 3: Other Directions Work Inside Subgraphs
Expected and Actual Behavior:
Both subgraphs respect their assigned directions (RL and BT).
This confirms that direction is supported inside subgraphs—except for TD.
Screenshots
Code Sample
Setup
Suggested Solutions
No response
Additional Context
This issue prevents using
TD
inside subgraphs, making it inconsistent with howdirection
works for other layouts.Since
TD
works globally andTB
works inside subgraphs, this behavior is likely a parser inconsistency.The text was updated successfully, but these errors were encountered: