有人知道如何垂直对齐这些子图吗?
digraph G {
rankdir=LR;
node [shape=record, style=rounded, fontname="Arial"];
subgraph cluster1 {
label = "Group 1";
rank=same;
A [label="A1|A2"]
A -> B -> C -> D [constraint=false];
style = "dashed";
}
subgraph cluster2 {
label = "Group 2";
rank=same;
Z -> Y -> X -> W [dir=back, constraint=false];
style = "dashed";
}
D -> Z;
}
使用此代码几乎可以做到这一点,但仍然没有对齐:
digraph G {
rankdir=LR;
node [shape=record, style=rounded, fontname="Arial"];
subgraph cluster1 {
group=g1;
label = "Group 1";
rank=same;
A [label="A1|A2"];
A -> B -> C -> D [constraint=false];
style = "dashed";
}
subgraph cluster2 {
group=g2;
label = "Group 2";
rank=same;
Z -> Y -> X -> W [dir=back, constraint=false];
style = "dashed";
}
D -> Z;
edge[style=invis];
A -> Z;
D -> W;
}