I have a simple graphviz
network graph where I want to show the neural network architecture of my model:
DiagrammeR::grViz("digraph G {
rankdir = LR
{a b z} -> {x1, x2, x100} -> Y
}")
which outputs to:
Now, I want to add 3 dots (vertically) after b
in the first layer and after x2
in the second layer, indicating that there are more nodes in these layers than I can show in a presentation. For example, there is 100 nodes (units) in the second layer (x1
, x2
...
x100
).
What I want is similar to the 3 dots in this example (taken from this study/source):
There are two challenges
The following works on my computer if output is SVG, but not png. If SVG is OK by you, here goes. If you need to directly create a png, an embedded image works.
digraph G {
rankdir = LR
splines=false // straight lines, not curves
// define ellipsis nodes
E1[shape=none label="⋮" fontsize=30]
E2[shape=none label="⋮" fontsize=30]
{rank=same a b E1 z} // align on same rank
{rank=same x1 x2 E2 x100} // align on same rank
{a b z} -> {x1, x2, x100} -> Y
// invisible edges to order nodes
edge[style=invis]
a->b->E1->z
x1->x2->E2->x100
}