Skip to content

TD, LR and links are all ignored and graph is completely restructured by adding an arrow #6066

Open
@Grunthos

Description

Description

The title covers the problem, the examples below illustrate it:

Steps to reproduce

Simple layers:

flowchart TB

    %% Top layer
    subgraph Top[The World]
        direction LR
        Top1 ~~~ Top2 ~~~ Top3
        Top1
        Top2
        Top3
    end

    %% Second layer
    subgraph Middle
        direction LR
        Mid1
        Mid2
        Mid1  ~~~ Mid2
    end

    %% Third layer
    subgraph Bottom
        direction LR
        Bot1
    end

    Top ~~~ Middle ~~~ Bottom
flowchart TB

    %% Top layer
    subgraph Top[The World]
        direction LR
        Top1 ~~~ Top2 ~~~ Top3
        Top1
        Top2
        Top3
    end

    %% Second layer
    subgraph Middle
        direction LR
        Mid1
        Mid2
        Mid1  ~~~ Mid2
    end

    %% Third layer
    subgraph Bottom
        direction LR
        Bot1
    end

    Top ~~~ Middle ~~~ Bottom
Loading

Now just add a single arrow (last line):

flowchart TB

    %% Top layer
    subgraph Top[The World]
        direction LR
        Top1 ~~~ Top2 ~~~ Top3
        Top1
        Top2
        Top3
    end

    %% Second layer
    subgraph Middle
        direction LR
        Mid1
        Mid2
        Mid1  ~~~ Mid2
    end

    %% Third layer
    subgraph Bottom
        direction LR
        Bot1
    end

    Top ~~~ Middle ~~~ Bottom
    Top1 --> Mid1
flowchart TB

    %% Top layer
    subgraph Top[The World]
        direction LR
        Top1 ~~~ Top2 ~~~ Top3
        Top1
        Top2
        Top3
    end

    %% Second layer
    subgraph Middle
        direction LR
        Mid1
        Mid2
        Mid1  ~~~ Mid2
    end

    %% Third layer
    subgraph Bottom
        direction LR
        Bot1
    end

    Top ~~~ Middle ~~~ Bottom
    Top1 --> Mid1
Loading

And the whole this becomes chaotic.

Screenshots

No response

Code Sample

See above.

Setup

  • Mermaid version: 9 to 11.4
  • Browser and Version: [Firefox]

Suggested Solutions

Allow some way to create arrows that do not change structure.

Additional Context

This seems to be a very long-term issue.

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions