GraphViz节点的放置和Rankdir [英] GraphViz Node Placement and Rankdir
问题描述
我很高兴与graphviz在一起,并且几乎能够使每一个 我需要的图形.我正在尝试重复此操作:
I'm having very good luck with graphviz and have been able to make nearly every graph that I need. I'm trying to duplicate this:
http://en.wikipedia.org/wiki/File:ICS_Structure.PNG
尽我所能.该图的底部都是自上而下流动的,我已经可以正常工作了.我没办法做的是将前三个孩子放在下面 事件指挥官".他们左右分支.另外,请注意在前8个节点中如何共享边缘.点可以吗?我可以应付一切 其他,但不是那些顶级节点.有人可以帮我解决这个问题吗?
as faithfully as I can. The bottom part of that graph all flows top to bottom and I've got that working fine. What I have not been able to do is place the first 3 children right below "Incident Commander". They branch left and right. Plus note how the edges are shared in the top 8 nodes. Is that possible with dot? I can deal with everything else but not those top nodes. Can someone give me a clue to solve this?
推荐答案
两种用于重现图形布局的有用技术是:
Two useful techniques for reproducing graph layouts are:
- 不可见的节点
- 等级限制
这里是顶部节点的快速尝试:
Here's a quick try for the top nodes:
digraph g{
ranksep=0.2;
node[shape=box3d, width=2.3, height=0.6, fontname="Arial"];
n1[label="Incident Commander"];
n2[label="Public Information\nOfficer"];
n3[label="Liaison Officer"];
n4[label="Safety Officer"];
n5[label="Operations Section"];
n6[label="Planning Section"];
n7[label="Logistics Section"];
n8[label="Finance/Admin. Section"];
node[shape=none, width=0, height=0, label=""];
edge[dir=none];
n1 -> p1 -> p2 -> p3;
{rank=same; n2 -> p1 -> n3;}
{rank=same; n4 -> p2;}
{rank=same; p4 -> p5 -> p3 -> p6 -> p7;}
p4 -> n5;
p5 -> n6;
p6 -> n7;
p7 -> n8;
}
结果如下:
这篇关于GraphViz节点的放置和Rankdir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!