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?
Simply define an other shape for this node, for example shape=none
:
d [shape=none, label="", image="X_Shape_Pillar_Yellow.png"];
The record
shape defined as default does not display the image, whereas none
, box
and even plaintext
do.
At the same time, it may be a good idea to set the label to nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With