I want to create system dynamics graphics for a course material that I write in Quarto, ideally with Graphviz (R package DiagrammeR). To be as close as possible to the standards, I want to use a "flow symbol", for example an hourglass character. In the attempt below I use a special character, but a method with two triangles would also be fine. The problem is now, how to place an additional label below the flow symbol. I tried three different ideas:
xlabel
that seems to be the easiest (see below) even if it needs tricks to reduce the font size. However, I want to have the xlabel
"growth" in the middle and a little bit lower, below the hourglass.Here is my code:
library(DiagrammeR)
graph_code <- '
digraph {
graph [rankdir = "LR"]
node [shape = rect]
A B
node [shape=none, width=0, height=0, fontsize=20, fixedsize=true, forcelabels=true]
C [label="⧖", xlabel=<<FONT POINT-SIZE="8">growth</FONT>>]
A -> C [dir = none, color = "blue"]
C -> B [dir = left, color = "blue"]
}
'
grViz(graph_code)
This combines the label & xlabel into an html table.
digraph {
graph [rankdir = "LR"]
node [shape = rect]
A B
node [shape=none, Xfontsize=20]
// the height may need to be tweaked, based on actual fonts used
C [label=<<table cellpadding="0" border="0" cellspacing="0"><tr><td height="12"></td></tr><tr><td><FONT POINT-SIZE="20">⧖</FONT></td></tr><tr><td>growth</td></tr></table>>]
A -> C [dir = none, color = "blue" headclip=false]
C -> B [dir = left, color = "blue" tailclip=false]
}