在Graphviz/dot中,是否可以将边缘准确地连接到节点的顶部中心?阅读点指南,我想,tailport并headport会帮助我,但添加这些没有区别,有时让我更奇怪的结果.
这就是我得到的:

这就是我要找的东西:

我用来获取(不正确)图表的代码是:
digraph G {
graph [splines = ortho];
node [shape = box];
edge [dir = none];
{
rank = same
A
AB [shape = point]
B
A -> AB
AB -> B
}
{
rank = same
point1 [shape = point]
point2 [shape = point]
point3 [shape = point]
}
AB -> point1
// The following section if to make the nodes appear in
// the correct order, not sure if there's a better way
{
edge [style = invisible]
rank = same
C
D
E
F
C -> D
D -> E
}
point2 -> point1
point2 -> C
point1 -> point3
point3 -> E
point1 -> D
}
Run Code Online (Sandbox Code Playgroud)
splines=ortho不支持tailportor headport(请参阅:“Graphviz 问题跟踪器 - 0002142:正交图不尊重端口。而且箭头似乎走错了方向。”)C的 或)F该代码甚至适用于超过 3 个子节点,并且与 Graphviz 2.38 兼容。对于组织结构图很有用(即使它不完美,如果你有很多级别 - 我仍然尝试减少不对称性)。
graph {
splines=ortho;
{0, 1, 2, 3 [width=0, shape=point, style=invis];}
{rank=same; 1 -- 2 -- 3;}
0 -- 2;
node [shape=box];
{rank=same; A -- 0 -- B;}
1 -- C;
1 -- D;
3 -- E;
3 -- F;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4776 次 |
| 最近记录: |