6

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

GMHDBJD
  • 89
  • 1
  • 8

2 Answers2

3

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

laktak
  • 47,916
  • 15
  • 112
  • 150
2

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

main-->Screen

samuelsov
  • 355
  • 1
  • 9
  • 1
    Is there any update on this or this is the only way to do this. – amit singh Jun 21 '19 at 09:03
  • 3
    no update on this, see https://github.com/knsv/mermaid/issues/197 and https://github.com/knsv/mermaid/issues/644 for any progression of this feature – samuelsov Jun 28 '19 at 15:11