【发布时间】:2016-05-13 05:52:07
【问题描述】:
我有以下图表Link
我想将最后一行设置为 f20 f21 f22 f23 以便边缘 f21-f11 和 f22-f10 相互交叉。基本上这棵树会向下增长,我需要将所有节点排列在同一等级(f20 f21 f22 f23)
【问题讨论】:
我有以下图表Link
我想将最后一行设置为 f20 f21 f22 f23 以便边缘 f21-f11 和 f22-f10 相互交叉。基本上这棵树会向下增长,我需要将所有节点排列在同一等级(f20 f21 f22 f23)
【问题讨论】:
你可以通过使用组合来实现the desired result
constraint=false 的边
我将constraint=false 添加到应该交叉的边缘,以免它们影响布局。然后需要另外 2 条不可见边来让布局引擎将节点放置在正确的位置 - f21 应该在 f10 之下,f22 在 f11 之下。
digraph G {
dir="back";
f00 -> f10[dir="back"];
f00 -> f11[dir="back"];
f10 -> f20[dir="back"];
// invisible edges for the layout
f11 -> f22[style=invis];
f10 -> f21[style=invis];
// crossing edges without constraint
f10 -> f22[dir="back", constraint=false];
f11 -> f21[dir="back", constraint=false];
f11 -> f23[dir="back"];
}
【讨论】: