I have a rmarkdown presentation (ioslides) with 3 slides with flow diagrams worked in DiagrammeR
's mermaid. The following file saved as .Rmd can reproduce the example (at least in my machine, hopefully yours too):
---
title: "Untitled"
author: "author"
date: "28 de enero de 2018"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
require(DiagrammeR)
```
## DiagrammeR's mermaid
It's not producing consistent results in slides when using line breaks.
```{r flow}
mermaid("
graph LR
C(CLIENTES <br>Clients) --> D[Doctors]
U(USUARIOS <br>Users <br>Patients <br>Nurses) --> D
D --> S(SALIDAS <br>Medicines <br>Surgery)
style C fill: #f5f5dc
style D fill: #4682b4
style U fill: #ffe4c4
")
```
## Second attempt
```{r flow2}
mermaid("
graph LR
C(CLIENTES <br>Clients) --> D[Doctors]
U(USUARIOS <br>Users <br>Patients <br>Nurses) --> D
D --> S(SALIDAS <br>Medicines <br>Surgery)
")
```
## Third attempt
```{r flow3}
mermaid("
graph LR
C(CLIENTES <br>Clients) --> D[Doctors]
U(USUARIOS <br>Users <br>Patients <br>Nurses) --> D
D --> S(SALIDAS <br>Medicines <br>Surgery)
style C fill: #f5f5dc
style D fill: #4682b4
style U fill: #ffe4c4
")
```
When run, it produces two normal-sized diagrams and a small one. Things I've noticed:
cache = FALSE
or cache = TRUE
don't make a differenceioslides
is changed to slidy
, it works (that's my alternative, but I'd rather prefer ioslides if there's a solution).Relevant parts or R.Version
and Sys.info
:
> Sys.info()
sysname
"Linux"
release
"4.9.0-5-amd64"
version
"#1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)"
nodename
"pavos"
machine
"x86_64"
## R and packages Versions
> R.Version()
$`svn rev`
[1] "73796"
$version.string
[1] "R version 3.4.3 (2017-11-30)"
$nickname
[1] "Kite-Eating Tree"
> packageVersion("DiagrammeR")
[1] ‘0.9.2’
> packageVersion("rmarkdown")
[1] ‘1.8’
What I expect: a consistently displayed presentation with fully sized and properly colored diagrams in all slides in ioslides output.
Thanks
There is no problem with DiagrammeR
v. 1.0.6 and rmarkdown
v. 2.16. If rerun the code indicated you will get expected output:
---
title: "Test ioslides"
author: "Noname"
date: "26 january 2021"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
require(DiagrammeR)
```
## DiagrammeR's mermaid
Produce consistent results
```{r flow}
mermaid("
graph LR
C(CLIENTES <br>Clients) --> D[Doctors]
U(USUARIOS <br>Users <br>Patients <br>Nurses) --> D
D --> S(SALIDAS <br>Medicines <br>Surgery)
style C fill: #f5f5dc
style D fill: #4682b4
style U fill: #ffe4c4
")
```
Output:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With