digraph foo {
a [label="<first> A | <rest> rest", shape=record];
b [label="<first> B | <rest> rest", shape=record];
a:rest -> b [label="foo", arrowtail=dot, dir=both];
}
I would like to start the tail of the edge (a to b) from within a:rest (ideally in the center), is this possible?
I am trying to draw linked lists using box and pointer like notation.
Yes, this is possible. The attribute to use is called tailclip:
If true, the tail of an edge is clipped to the boundary of the tail node; otherwise, the end of the edge goes to the center of the node, or the center of a port, if applicable.
Just change your last line to
a:rest -> b [label="foo", arrowtail=dot, dir=both, tailclip=false];
Edit: As @Kyborek mentions in the comments, an additional compass point is needed for current versions of graphviz:
a:rest:c -> b [label="foo", arrowtail=dot, dir=both, tailclip=false];
See also this answer
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