-6ren">
gpt4 book ai didi

linked-list - 从节点内开始一条边

转载 作者:行者123 更新时间:2023-12-04 06:17:39 25 4
gpt4 key购买 nike

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),这可能吗?

我正在尝试使用类似于框和指针的符号来绘制链表。

最佳答案

是的,这是可能的。要使用的属性称为 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.

只需将最后一行更改为

a:rest -> b [label="foo", arrowtail=dot, dir=both, tailclip=false];

编辑:正如@Kyborek 在评论中提到的,当前版本的 graphviz 需要一个额外的罗盘点:

a:rest:c -> b [label="foo", arrowtail=dot, dir=both, tailclip=false];

另见 this answer

关于linked-list - 从节点内开始一条边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7020529/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com