Gantt mermaid chart does not appear on R markdown tab

I was hoping for data on embedding Gantt charts in the R markdown file.

I use the Mermaid function in the DiagrammeR package to create Gantt charts. I would like the different graphs to be tabbed in the markdown file. However, graphs are displayed only on the first tab. If I have a 2nd or 3rd tab, the content is empty and I cannot understand why.

Here is 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 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 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 blocks of the crack code myself, they both work. But for some reason, the graphs are not displayed on additional tabs. Does anyone know why and how to fix it?

Thank!

+4

Source: https://habr.com/ru/post/1677202/


All Articles