【问题标题】:Edge pointing at edge with Graphviz and Dot使用 Graphviz 和 Dot 指向边缘的边缘
【发布时间】:2016-07-16 10:48:25
【问题描述】:

我想使用dot 格式将一条边指向graphviz 中的另一条边。

到目前为止我得到了什么:

digraph G {
    Hello->dummy;
    dummy->World;
    dummy[shape=point width=0];
    Test->dummy;
}

产生

我想得到的是更类似于这个的东西:

有什么办法吗?

【问题讨论】:

  • This SO post 详细介绍了一些强制直线的技巧。但看起来你想在一行中的节点必须在同一个组中(即必须都具有相同的属性)。

标签: graph graphviz dot


【解决方案1】:

也许rank = same 能解决问题?

digraph G
{
  { rank = same; Test; dummy }        // dummy and Test on the same level
  dummy[ shape = point, width = 0 ];                         // connector
  Hello -> dummy[ arrowhead = none ];    // remove arrowhead to connector
  dummy -> Test[ dir = back ];         // you want Test on the right side
  dummy -> World;
}

产量

【讨论】:

  • 嗯,这只适用于像上面这样的一个小例子。我的问题是,我想绘制“扩展论证框架”,其中有很多相互矛盾的攻击和对攻击的攻击。一个典型的网络可能看起来像下面的截图:dropbox.com/s/qphs9uk1fxk88cn/… 正如你所看到的,这将很难用上述方法表示。我从乳胶中的 tikzpicture 中知道,您可以简单地绘制边缘并定义边缘中心有一个锚点。那太棒了!
  • 我必须将width=0.0001 放在连接器行中才能正常工作
【解决方案2】:

[arrowhead=none] 和你一起dummy 中间人为我做这项工作。

digraph G {
    Hello->dummy[arrowhead=none];
    dummy->World;
    dummy[shape=point width=0];
    Test->dummy;
}

我在 Graphviz 的问题跟踪器中添加了 feature request

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-07
    • 2012-09-05
    • 1970-01-01
    • 1970-01-01
    • 2020-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多