本文介绍了Graphviz中群集之间的直边的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Graphviz的群集之间建立一条不影响排名的边缘.
I'm trying to have an edge between clusters in Graphviz where the edge does not affect the ranking.
这看起来不错:
digraph {
subgraph clusterX {
A
B
}
subgraph clusterY {
C
D
}
A -> B
B -> C [constraint=false]
C -> D
}
但是,当我在C -> D
边缘添加标签时,B -> C
边缘会尝试绕过所述标签(看起来很丑).
However when I add a label to the C -> D
edge the B -> C
edge tries to circumvent said label (which looks ugly).
digraph {
subgraph clusterX {
A
B
}
subgraph clusterY {
C
D
}
A -> B
B -> C [constraint=false]
C -> D [label=yadda]
}
有什么想法可以使边缘从B
到C
保持笔直?
Any idea how I can keep the edge from B
to C
straight?
推荐答案
最简单的方法是在点文件中添加splines=false
-这会强制将边缘渲染为直线:
The easiest way to achieve this is to add splines=false
to the dot file - this forces the rendering of the edges to be straight lines:
digraph {
splines=false;
subgraph clusterX {
A;
B;
}
subgraph clusterY {
C;
D;
}
A -> B;
B -> C [constraint=false];
C -> D [label=yadda];
}
输出:
这篇关于Graphviz中群集之间的直边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!