alignment - Graphviz aligning subgraphs horizontally -


i have following code:

    digraph g {         bgcolor=antiquewhite;         compound=true;         {              rankdir=lr ;              rank=same g0 p1 p2 p3 h1;          }         subgraph cluster0 {             style=filled;             color=khaki;             g0 [label="g",shape=circle,style="filled", color="red", fillcolor="lightpink"]             label = "cluster 0";             g0 -> p1;         }         subgraph cluster1 {             style=filled;             color=khaki;             p1 [label="s2",shape=box,style="filled", color="blue", fillcolor="skyblue"];             p2 [label="s3",shape=box,style="filled", color="blue", fillcolor="skyblue"];             p3 [label="s3",shape=box,style="filled", color="blue", fillcolor="skyblue"];             label = "cluster 1";             p1 -> p2 -> p3 [arrowhead=none] ;         }         subgraph cluster2 {             style=filled;             color=khaki;             h1 [label="h1",shape=box,style="invis"];             label = "cluster 2";             p3 -> h1;          }     } 

everything works perfect except subgraphs don't show up. rank defined outside clusters subgraphs disappear.

enter image description here

if defined inside cluster body, same rank between clusters lost.

  • rankdir applicable @ graph level
  • a node may belong 1 cluster only

.

digraph g {     rankdir=lr ;      bgcolor=antiquewhite;     compound=true;     subgraph cluster0 {         style=filled;         color=khaki;         g0 [label="g",shape=circle,style="filled", color="red", fillcolor="lightpink"]         label = "cluster 0";     }     subgraph cluster1 {         style=filled;         color=khaki;         p1 [label="s2",shape=box,style="filled", color="blue", fillcolor="skyblue"];         p2 [label="s3",shape=box,style="filled", color="blue", fillcolor="skyblue"];         p3 [label="s3",shape=box,style="filled", color="blue", fillcolor="skyblue"];         label = "cluster 1";         p1 -> p2 -> p3 [arrowhead=none] ;     }     subgraph cluster2 {         style=filled;         color=khaki;         h1 [label="h1",shape=box,style="invis"];         label = "cluster 2";     }     g0 -> p1;     p3 -> h1;  } 

gives

enter image description here


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -