如何在此图中订购节点位置?

时间:2016-05-13 10:05:21

标签: graphviz

我有以下图表Link

最后一行无法对齐。我尝试过添加虚节点,但它似乎无法正常工作。

1 个答案:

答案 0 :(得分:2)

您可以使用rank=same将节点显式约束到相同的排名:

digraph G {
dir="back";
{
  rank=same;
  edge[style=invis];
  f30->f31->f32->f33->f34->f35->f36;
}
{
  rank=same;
  edge[style=invis];
  f40->f41->f42->f43->f44->f45->f46->f47->f48->f49->f410;
}

{
  rank=same;
  edge[style=invis];
  f50->f51->f52->f53->f54->f55->f56->f57->f58->f59->f510->f511->f512;
}

f00 -> f10[dir="back"];
f00 -> f11[dir="back"];
f10 -> f20[dir="back"];
f11 -> f22[style=invis];
f10 -> f21[style=invis];
f10 -> f22[dir="back", constraint=false];
f11 -> f21[dir="back", constraint=false];
f11 -> f23[dir="back"];


f20 -> f30[dir="back"];
f20 -> f31[style=invis];
f20 -> f32[dir=back, constraint=false]
f21 -> f31[dir=back, constraint=false];
f21 -> f32[style=invis];
f21 -> f33[dir="back"]
f22 -> f32[dir="back"];
f22 -> f33[style=invis];
f22 -> f34[dir=back, constraint=false]
f23 -> f33[dir=back, constraint=false];
f23 -> f34[style=invis];
f23 -> f35[dir="back"];


f30 -> f40[dir="back"];
f30 -> f41[style=invis];
f30 -> f42[dir=back, constraint=false]
f31 -> f41[dir=back, constraint=false];
f31 -> f42[style=invis];
f31 -> f43[dir="back"]
f32 -> f42[dir="back"];
f32 -> f43[style=invis];
f32 -> f44[dir=back, constraint=false]
f33 -> f43[dir=back, constraint=false];
f33 -> f44[style=invis];
f33 -> f45[dir="back"]
f34 -> f44[dir="back"];
f34 -> f45[style=invis];
f34 -> f46[dir=back, constraint=false]
f35 -> f45[dir=back, constraint=false];
f35 -> f46[style=invis];
f35 -> f47[dir="back"]
f36 -> f46[dir="back"];
f36 -> f47[style=invis];
f36 -> f48[dir=back, constraint=false];



f40 -> f50[dir="back"];
f40 -> f51[style=invis];
f40 -> f52[dir=back, constraint=false]
f41 -> f51[dir=back, constraint=false];
f41 -> f52[style=invis];
f41 -> f53[dir="back"]
f42 -> f52[dir="back"];
f42 -> f53[style=invis];
f42 -> f54[dir=back, constraint=false]
f43 -> f53[dir=back, constraint=false];
f43 -> f54[style=invis];
f43 -> f55[dir="back"]
f44 -> f54[dir="back"];
f44 -> f55[style=invis];
f44 -> f56[dir=back, constraint=false]
f45 -> f55[dir=back, constraint=false];
f45 -> f56[style=invis];
f45 -> f57[dir="back"]
f46 -> f56[dir="back"];
f46 -> f57[style=invis];
f46 -> f58[dir=back, constraint=false]
f47 -> f57[dir=back, constraint=false];
f47 -> f58[style=invis];
f47 -> f59[dir="back"]
f48 -> f58[dir="back"];
f48 -> f59[style=invis];
f48 -> f510[dir=back, constraint=false]
f49 -> f59[dir=back, constraint=false];
f49 -> f510[style=invis];
f49 -> f511[dir="back"]
f410 -> f510[dir="back"];
f410 -> f511[style=invis];
f410 -> f512[dir=back, constraint=false]
}