Search code examples
rdiagrammermermaid

Line connection (instead of arrow) in mermaid


I'm trying to create a mermaid chart in R. The syntax seems to be quite straightforward - however I haven't found a possibility to make line connections between two shapes without an arrow head.

In this example:

     mermaid("
        graph LR
            sq1[shape one]-- This can't be a shape. So sad. --> sq2[shape two]

            cyr1((circle one))-->cyr2((circle two));
      ")

will get enter image description here

Here, the connection between "shape one" and "this can't be a shape" is a line, but as soon as I try to use this connection between two shapes the output won't construct a diagram. Is there any way to realize a line connection between two shapes?


Solution

  • As to DiagrammeR documentation, connection could be defined as:

    --> arrow connection
    --- line connection
    

    So you simply need:

    mermaid("
            graph LR
                sq1[shape one]-- This can't be a shape. So sad. --- sq2[shape two]
                cyr1((circle one))---cyr2((circle two));
          ")