Simple planar graphs are not rendered as planar. In simple cases they are still easy to read, but in midly complex diagrams they make it much harder to read
Steps to reproduce
Render the diagram below, and observe that if the node B was on the left, it would avoid overlapping edges.
stateDiagram
A --> C
A --> D
B --> C
C --> E
D --> E
Screenshots
This should be visible above, but if not I attach a screenshot
Code Sample
mermaid
stateDiagram
A --> C
A --> D
B --> C
C --> E
D --> E
Not all graphs are planar, so it won't always be possible to fix this issue.. It is not trivial to solve while maintaining the deterministic behavior of the generated diagram, but if solved it would improve the readability of this tool significantly.
Description
Simple planar graphs are not rendered as planar. In simple cases they are still easy to read, but in midly complex diagrams they make it much harder to read
Steps to reproduce
Render the diagram below, and observe that if the node
B
was on the left, it would avoid overlapping edges.Screenshots
This should be visible above, but if not I attach a screenshot
Code Sample
Setup
10.9.1
Suggested Solutions
A similar solution to the flowchart problem might be applicable. The related but distinct issue can be found at https://github.com/mermaid-js/mermaid/issues/5060
Additional Context
Not all graphs are planar, so it won't always be possible to fix this issue.. It is not trivial to solve while maintaining the deterministic behavior of the generated diagram, but if solved it would improve the readability of this tool significantly.