如何使用 DiagrammeR 绘制美人鱼形象?

How to plot a mermaid figure using DiagrammeR?

提问人:bird 提问时间:11/10/2023 更新时间:11/10/2023 访问量:39

问:

比方说,我想用 '' 绘制这张图:

sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!

当您访问在线 mermaid.live 页面(上面的代码及其绘图已经绘制)时,我们看到显示了预期的绘图:

enter image description here

我想在 中重现相同的数字,使用:RDiagrammeR

library(DiagrammeR)

mermaid("sequenceDiagram
    Alice->>+John: Hello John, how are you?
    Alice->>+John: John, can you hear me?
    John-->>-Alice: Hi Alice, I can hear you!
    John-->>-Alice: I feel great!")

enter image description here

正如我们所看到的,我没有得到预期的数字。

R Graphviz 美人鱼 图表

评论

2赞 olivroy 11/10/2023
不幸的是,DiagrammeR的嵌入式mermaid.js有点旧。有一个关于此的问题。github.com/rich-iannone/DiagrammeR/issues/501 rich-iannone.github.io/DiagrammeR/reference/mermaid.html
1赞 PGSA 11/10/2023
我无法从这里检查,但你能仔细检查命名参数是否没有对它进行排序吗?mermaid(diagram = "sequenceDiagram Alice->>+John: Hello John, how are you? Alice->>+John: John, can you hear me? John-->>-Alice: Hi Alice, I can hear you! John-->>-Alice: I feel great!")

答: 暂无答案