Search code examples
markdownmermaid

Mermaid - How to connect subgraphs in markdown?


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


Solution

  • As far as I know, it's only possible to connect nodes, so you could do:

    main-->Screen