来自不同等级的GraphViz点对齐节点
我想与在儿童节点的“中心”中对齐的父节点的图表。
对于下面的树,我将获得以下图像。
graph {
rankdir = "LR"
splines = line
A -- B
A -- C
B -- D
B -- E
C -- F
D -- G
D -- H
D -- I
E -- J
E -- K
F -- L
}
我想与node h对齐node d,节点e在j和k之间对齐,并且与l对齐。在下一个等级处,我想在e中间对齐。 d,c与F对准。在顶部(最左)等级,我想在B和C之间进行对齐。
是否有办法在不指定节点位置的情况下实现这一目标?
I'd like to make a graph with parent nodes aligned at the "center" of the children nodes.
For the tree below I get the following image.
graph {
rankdir = "LR"
splines = line
A -- B
A -- C
B -- D
B -- E
C -- F
D -- G
D -- H
D -- I
E -- J
E -- K
F -- L
}
I would like to have node D aligned with node H, node E aligned halfway between J and K, and F aligned with L. At the next rank, I'd like to have B aligned halfway between E and D, and C aligned with F. At the top (leftmost) rank, I'd like to have A aligned halfway between B and C.
Is there a way to make this happen without specifying positions of nodes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我无法找到一种方法来获得我想要的一切,但是我靠近了很多。
秘密:
,请注意,我无法将E带到我想要的位置,但是我在那里得到了F,D,B和C。我可以根据我已经知道的亲子关系来编程以编程为单位。
虽然这不是一个完美的解决方案,但对我的用法比输入坐标更好。
I couldn't figure out a way to get everything I want, but I got a lot closer.
The secrets:
Note that I couldn't get E where I wanted it, but I got F, D, B, and C there. And I can make this file programmatically based on the parent-child relationships that I already know.
While this is not a perfect solution, it's better for my usage than entering coordinates.
可能不是。即使您包含了隐形节点(样式= Invis),您仍然会与DOT算法进行战斗。明确指定X/y坐标会容易得多。
Probably not. Even if you included invisible nodes (style=invis), you would still be fighting the dot algorithm. It would be much easier to explicitly specify the X/Y coordinates.