mermaid-js / mermaid-live-editor

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

Arrows that don't change layout #1459

Open AmitMY opened 6 months ago

AmitMY commented 6 months 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)

Arnau478 commented 3 months ago

See https://github.com/mermaid-js/mermaid/issues/1358#issuecomment-771255123