Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz: Stacking fields vertically within a subraph

Tags:

graphviz

I am trying to stack a group of fields vertically (there are 8 specific fields, so I would preferably have 4x4) within Graphviz. I have a subgraph cluster containing 8 fields, which by default are lined up side by side horizontally, making connections extremely messy. I feel it would be much more clear if the subfields were stacked vertically.

like image 959
BRS Avatar asked Aug 05 '11 19:08

BRS


1 Answers

A common technique to layout nodes is to use invisible edges.

In the following example, the nodes n1-n8 are layed out vertically within a cluster, but no edges are displayed.

digraph g{

  subgraph cluster0 {
    edge[style=invis];
    n1->n2->n3->n4->n5->n6->n7->n8;
  }

  // some visible edges from nodes outside of the cluster to nodes within the cluster
  a -> b;
  a -> {n2;n7;n8};
  b -> {n4;n6;n7;};
}
like image 156
marapet Avatar answered Nov 08 '22 14:11

marapet