Mermaid Flowchart does not render 'longer arrows'

Viewed 452
---
title: "Markdown Demo"
author: "J"
date: "6/14/2021"
output: html_document
---

## Setup
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(DiagrammeR)
```

## R Markdown

```{r}

mermaid("
  graph TB;
    a ==> b; 
    b ----> c[apple]
    
                    
")
```

For some reason the 2nd line in the graph doesn't seem to be rendering because its not realizing the 'longer arrow'. Anyone know how to solve this trivial problem

1 Answers

Looks like this depends on how large your network graph is. You can look up the documentation of the package in Rstudio by entering ??DiagrammeR::mermaid in the console.

An example from the package shows 10 nodes creates longer arrows than just A->B

Doesn't look like b ----> c[apple] is proper syntax for longer arrows, to what I read in the package docs.

grViz("
digraph a_nice_graph {

# node definitions with substituted label text
node [fontname = Helvetica]
a [label = '@@1']
b [label = '@@2-1']
c [label = '@@2-2']
d [label = '@@2-3']
e [label = '@@2-4']
f [label = '@@2-5']
g [label = '@@2-6']
h [label = '@@2-7']
i [label = '@@2-8']
j [label = '@@2-9']

# edge definitions with the node IDs
a -> {b c d e f g h i j}
}

[1]: 'top'
[2]: 10:20
")

enter image description here

Related