I've tried to use a custom image node in graphviz (node d
):
digraph foo {
rankdir=LR;
node [shape=record];
a [label="{ <data> 12 | <ref> }", width=1.2]
b [label="{ <data> 99 | <ref> }"];
c [label="{ <data> 37 | <ref> }"];
d [image="X_Shape_Pillar_Yellow.png"];
a:ref:c -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false, arrowsize=1.2];
b:ref:c -> c:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
c:ref:c -> d [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
}
Unfortunately, the image does not appear:
I've compiled the dot file using:
dot -v -Tpng list.dot -o list.png
My code, including the png image, is stored in github.
How do I use a replace node d
with my custom image?
Best Answer
Simply define an other shape for this node, for example
shape=none
:The
record
shape defined as default does not display the image, whereasnone
,box
and evenplaintext
do.At the same time, it may be a good idea to set the label to nothing.