mermaid-js / mermaid-live-editor

Edit, preview and share mermaid charts/diagrams. New implementation of the live editor.
https://mermaid.live
MIT License
3.82k stars 574 forks source link

Arrows that don't change layout #1459

Open AmitMY opened 1 month ago

AmitMY commented 1 month ago

Is your feature request related to a problem? Please describe.

I find it very difficult to draw concepts where the arrows go "back" without destroying my layout. For example, here are two subgraphs on the same level

flowchart TD
    subgraph A
       Node1
    end
    subgraph B
       Node2
    end

If I add arrows between them, the layout changes, to imply one proceeds the other

flowchart TD
    subgraph A
       Node1
    end
    subgraph B
       Node2
    end
    A <--> B

Describe the solution you'd like I would like to add arrows between nodes, on the same level or a node from below to point to a node above, and these specific arrows should not re-layout.

image

Describe alternatives you've considered I tried every arrow ordering I can think of, separate, inside more subgraphs, nothing works. (Yes, I can relayout this graph to LR, then it would "work" for this toy example, but not for more complicated examples)