Modeling mermaid diagrams using DiagrammeR

I use the DiagrammeR package in R to render a flowchart with a mermaid:

graph LR
A[text]-->B[a very, very, very, very, very, very, very, very, long text]

style A fill:red, font-size:50px

Looking at the compiled XML, you will get:

#mermaidChart0 .node { fill:#ffa; stroke:#666; stroke-width:3px; }
#mermaidChart0 .node text  { fill:#000; stroke:none; font-weight:300; font-family:"Helvetica Neue",Helvetica,Arial,sans-serf; font-size:14px; }
#mermaidChart0 .edgeLabel text  { fill:#000; stroke:none; font-weight:300; font-family:"Helvetica Neue",Helvetica,Arial,sans-serf; font-size:14px; }
.mermaid .label { color: rgb(51, 51, 51); }
.mermaid .node { fill: #d2d2d2; stroke: #929193; stroke-width: 1px; }
.mermaid .edgePath .path { stroke: #333333 !important; }
.DiagrammeR g .label { font-family: Helvetica; font-size: 14px; color: rgb(51, 51, 51); }

My questions:

  • Why is the specified font size displayed? (doesn't seem to work for any font attributes)
  • Is there a way to specify the width of the nodes, so I don’t need to manually insert html breaks in long paragraphs?
  • Is there a way in the mermaid code to break long lines to make it more readable, for example, for example. "\" in Python?
+4
source share
1 answer
+1
source

All Articles