Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Graphviz subgraph rank?

Tags:

graphviz

dot

I want subgraph clusterCG to have same rank as 3 (clusterCG schould not contain 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;}
}

enter image description here

CG is generated as independent node with rank 3.

I want the subgraph clusterCG to have rank 3.

like image 634
FDSg Avatar asked Oct 24 '12 01:10

FDSg


1 Answers

use different rank algorithm with "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;}
}
like image 53
Deogtae Kim Avatar answered Sep 28 '22 04:09

Deogtae Kim