我希望子图clusterCG的排名与3相同(clusterCG不包含3)
digraph G{
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
A->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 3; CG;}
{ rank=same; 4; A3;}
}
Run Code Online (Sandbox Code Playgroud)

CG被生成为具有秩3的独立节点.
我希望子图clusterCG具有等级3.
也许不是最好的解决方案,但似乎零大小的节点是唯一可行的
digraph G{
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
ACG[shape = none,label="",width=0, height=0];
CG->A2 [style=invis,constraint=false];
A->ACG[arrowhead=none];
ACG->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 2; ACG;}
{ rank=same; 4; A3;}
}
Run Code Online (Sandbox Code Playgroud)

小智 8
使用不同的排名算法与"newrank = true"
digraph G {
newrank=true
rankdir = LR;
node [shape = none]
1->2->3->4[arrowhead=none]
node [shape = ellipse]
A->A2->A3;
subgraph clusterCG{
shape = rect;
rank=same;
A2;
B;
C;
color=blue;
label="C";
}
{ rank=same; 1; A;}
{ rank=same; 3; A2}
{ rank=same; 4; A3;}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15409 次 |
| 最近记录: |