Mermaid - How to connect subgraphs in markdown?

GMHDBJD picture GMHDBJD · May 12, 2018 · Viewed 9.5k times · Source

I'm using mermaid in markdown.I can't figure out how to connect subgraphs.

Given the program below, I need to be able to connect one and two with an arrow.

 -  ```mermaid
    graph LR;
      subgraph one
        main---MainMenu
        MainMenu((MainMenu))---Game
        Game---Level
        Game---Player
      end
      subgraph two
        Screen
      end
      one-->two 
    ```

enter image description here

Answer

laktak picture laktak · Jun 22, 2020

The beta now allows you to connect subgraphs:

flowchart TB
    c1-->a2
    subgraph one
    a1-->a2
    end
    subgraph two
    b1-->b2
    end
    subgraph three
    c1-->c2
    end
    one --> two
    three --> two
    two --> c2

https://mermaid-js.github.io/mermaid/#/flowchart?id=beta-flowcharts