【问题标题】:Prevent Grphviz arrow edge from crossing neighbour node防止 Graphviz 箭头边缘穿过相邻节点
【发布时间】:2015-10-02 22:29:07
【问题描述】:

我创建了以下 graphviz 图表,表示带有循环的链表:

igraph foo {
    rankdir=LR;
    node [shape=record];
    a [label="{ <data> 12 | <ref>  }", width=1.2]
    b [label="{ <data> 99 | <ref>  }"];
    c [label="{ <data> 37 | <ref>  }"];
    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 -> b:data [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
}

不幸的是,从c:refb:data 的箭头穿过节点c

如何强制边缘绕过节点而不越过它们?

【问题讨论】:

    标签: graphviz


    【解决方案1】:

    我找不到简单且完全令人满意的答案,但更改指南针点可能会有所帮助。

    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>  }"];
        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:s -> b:data:s [arrowhead=vee, arrowtail=dot, dir=both, tailclip=false];
    }
    

    【讨论】:

      【解决方案2】:

      您可以为您的点文件运行"dot -Tsvg",然后使用ms visio 打开svg 文件并执行类似 的操作

      【讨论】:

      • +1 谢谢,这是一个有趣的想法,但我正在寻找一个 graphviz 解决方案。我不喜欢在编译后手动编辑每个链表的想法。
      猜你喜欢
      • 2016-02-22
      • 2019-06-19
      • 2011-04-27
      • 2020-05-23
      • 1970-01-01
      • 2012-10-10
      • 2013-05-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多