Closed ss2165 closed 18 hours ago
I'm not sure it's a bug, the semantics are not too clear.
This can be fixed if write inter-graph edges outside the subgraph blocks. The invisible edge may still help with layout.
graph LR
subgraph 0 ["(0) CFG"]
direction LR
subgraph 1 ["(1) DataflowBlock"]
direction LR
2["(2) Input"]
2--"0:0<br>[]"-->3
3["(3) Output"]
end
1-."0:0".->5
2--"0:0<br>[]"-->7
4["(4) ExitBlock"]
subgraph 5 ["(5) DataflowBlock"]
direction LR
6["(6) Input"]
7["(7) Output"]
end
5-."0:0".->4
end
graph LR
subgraph 0 ["(0) CFG"]
direction LR
subgraph 1 ["(1) DataflowBlock"]
direction LR
2["(2) Input"]
2--"0:0<br>[]"-->3
3["(3) Output"]
end
1-."0:0".->5
2--"0:0<br>[]"-->7
4["(4) ExitBlock"]
subgraph 5 ["(5) DataflowBlock"]
direction LR
6["(6) Input"]
7["(7) Output"]
end
5-."0:0".->4
end
When a Dom edge is connected to an output node, that node is being rendered inside the source dataflow block rather than the target.
Sample hugr:
(output node (7) correctly reports parent node DataflowBlock(5))
mermaid:
Node 7 is now being rendered inside block 1 even though though in the mermaid source it is inside subgraph 5. Maybe a mermaid bug?
Potential fix is adding an invisible edge between all input-output nodes to pin them to the same subgraph?