您可以首先使用 devtools 包从 GitHub 安装 DiagrammeR 的开发版本,然后查看区别:
devtools::install_github("rich-iannone/DiagrammeR")
似乎旅程图尚未实施。
因此,对于快速(和临时)解决方案(与 完美配合distill::distill_article
),您可以
在没有捆绑器的情况下部署美人鱼,可以将script
带有绝对地址的标签和mermaidAPI
调用插入 HTML,如下所示:
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
```{r diagram-mermaid, echo = FALSE}
DiagrammeR::mermaid(diagram = '
journey
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 5: Me
', height = '100%', width = '100%')
```
这样做将命令美人鱼解析器查找<div>
带有class="mermaid"
. 从这些标签美人鱼将尝试读取图表/图表定义并将它们呈现为 svg 图表。
这对 有什么帮助distill::distill_website
吗?