从节点内开始边 [英] Starting an edge from within a node
问题描述
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];
}
我想从a:rest(最好在中心)内开始边缘的尾部(a到b),这有可能吗?
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.
推荐答案
是的,这是可能的.使用的属性称为 tailclip
:>
Yes, this is possible. The attribute to use is called tailclip
:
如果为true,则将边缘的尾部修剪到尾部的边界 节点;否则,边缘的末端将到达节点的中心, 或端口中心(如果适用).
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.
只需将最后一行更改为
a:rest -> b [label="foo", arrowtail=dot, dir=both, tailclip=false];
正如@Kyborek在评论中提到的那样,当前版本的graphviz需要一个附加的指南针点:
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];
另请参见此答案
这篇关于从节点内开始边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!