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.

if defined inside cluster body, same rank between clusters lost.
rankdirapplicable @ 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

Comments
Post a Comment