I was hoping for input on embedding Gantt charts into an R markdown file.
I'm using the Mermaid function in the DiagrammeR package to make Gantt charts. I'd like to have the different plots separated into tabs in the markdown file. However, the plots only display on the 1st tab. If I have a 2nd or 3rd tab, the content is blank, and I can't figure out why.
Here's some reproducible code:
---
title: "Gantt Charts!"
output:
html_document
---
```{r results = 'hide', message = FALSE, error = FALSE, echo = FALSE, warning = FALSE}
library(DiagrammeR)
```
### Personnel {.tabset .tabset-pills}
#### Joe Bob
```{r, echo = FALSE}
mermaid("
gantt
dateFormat YYYY-MM-DD
title Joe Bob's Chart
section Project
Design :active, proj_1, 2017-05-10, 2017-05-17
Implementation : proj_2, 2017-05-17, 2017-05-31
")
```
#### John Doe
```{r, echo = FALSE}
mermaid("
gantt
dateFormat YYYY-MM-DD
title John Doe's Chart
section Test
Analysis :crit, active, test_1, 2017-05-18, 2017-05-31
Presentation :active, test_2, 2017-05-25, 2017-06-05
")
```
When I run the mermaid blocks of code independently, they both work. But for some reason, the plots don't render in the additional tabs. Does anyone know why and how to fix?
Thanks!