3

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?

j_5chneider
  • 390
  • 5
  • 15
  • Are you open to an alternative way to get the same with diagrammer? – NelsonGon Feb 13 '19 at 08:40
  • Yes I am. Are you referring to grViz? With that package I had the problem of left-to-right direction of the graphs. Any pointers? :) For the sake of the thread of this post please post answers for other packages in the comments (like you already did). Thanks! – j_5chneider Feb 13 '19 at 08:59

1 Answers1

6

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));
      ")
Istrel
  • 2,508
  • 16
  • 22