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:
- use an edge directly from A to B and somehow add the hourglass in the middle,
- add an additional overlapping edge directly from A to B, but then the arrows get curved to avoid overlap,
- use
xlabelthat seems to be the easiest (see below) even if it needs tricks to reduce the font size. However, I want to have thexlabel"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.
Giving:
