[帮助排序子图或集群中的节点,例如下面的子图A和B。
graph {
splines=line;
subgraph cluster_0 {
label="Subgraph A";
a; b; c
}
subgraph cluster_1 {
label="Subgraph B";
d; e;
}
a -- e;
a -- d;
b -- d;
b -- e;
c -- d;
c -- e;
}
此图不理想。请帮助我们从左到右对“ a”,“ b”,“ c”,“ d”和“ e”进行排序。
https://graphs.grevian.org/resources/static/images/example6a.png
我发现很难做到这一点,并且不保证它可以用于更复杂的图形。除了按所需顺序获得节点外,很难将群集定位在所需位置。就是说,这个:
graph {
splines=line;
rankdir=LR
subgraph cluster_0 {
label="Subgraph A";
rank=same
a -- b -- c [style=invis]
}
subgraph cluster_1 {
label="Subgraph B";
rank=same
d -- e [style=invis]
}
edge[constraint=false]
a -- e;
a -- d;
b -- d;
b -- e;
c -- d;
c -- e;
}
产生此: