我想用点实现以下模型:
到目前为止,我有这么多:
digraph G {
graph [rankdir = LR, splines=ortho]
unit [shape=box, width = 2, height = 10];
more_different_unit [shape=box, height=4];
other_unit [shape=box, height=4];
unit -> other_unit [label = "foo"];
unit -> other_unit [label = "bar"];
unit -> other_unit [label = "bar"];
unit -> other_unit [label = "bar"];
unit -> other_unit [label = "bar"];
unit -> other_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
unit -> more_different_unit [label = "bar"];
}
我像这样编译它:
点 -Gsplines=none test.gv | 整洁 -n -Gsplines=ortho -Tpng -otest.png
这让我很接近,但有几件事我想知道。
我怎样才能在 Foo 的左侧和右侧获得块,而不仅仅是右侧?我还没有弄清楚。
是否可以将边缘标签始终放在边缘上方或下方?
如何将右侧节点向左对齐,左侧节点向右对齐?一种可能性是使它们具有相同的宽度,这没关系。
谢谢!!
更新:
根据接受的答案,我现在正在执行以下操作,这正是我需要的,再次通过点管道生成到neato,如上所述:
digraph G {
graph [rankdir = LR, splines=ortho];
node[shape=record];
Bar[label="Bar", height=2];
Foo[label="Foo", height=4];
Bew[label="Bew", height=2];
Gate[label="Gate", height=2];
Bar -> Foo [label="Bar2Foo"];
Bar -> Foo [label="Bar2Foo"];
Bar -> Foo [label="Bar2Foo"];
Foo -> Bew [label="Foo2Bew"];
Foo -> Bew [label="Foo2Bew"];
Bew -> Foo [label="Bew2Foo"];
Foo -> Gate [label="Foo2Gate"];
Foo -> Gate [label="Foo2Gate"];
}