I want to use the R package DiagrammeR to customise a Mermaid.js diagram.
Challenges
I learned to use Mermaid.js to embed reproducible diagrams in quarto documents. Mermaid.js in under active development, syntax and features change from version to version.
Usually Mermaid code can be embeded in a quarto document like this:
This is the same diagramm code as the figure shown here.
However, when loading the library DiagrammeR in a document, it will call a fixed version of mermaid. This means that it is stuck with a slightly outdated syntax, and that usually means sacrificing some features. Mixing mermaid code blocks and diagrams created within R code blocks in the same document will have unexpected results.
I am slightly inclined against using DiagrammeR for mermaid plots, but I am still testing options.
example3 <-mermaid("sequenceDiagram participant ParticipantA participant ParticipantB participant ParticipantC ParticipantA->>ParticipantB: I want something ParticipantB->>ParticipantC: he want something ParticipantC->>ParticipantB: here is something ParticipantB->>ParticipantA: he got something for you ", height ='100%', width ='100%')