开发者

Graphviz: Stacking fields vertically within a subraph

开发者 https://www.devze.com 2023-03-26 11:15 出处:网络
I am trying t开发者_如何学Co 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 de

I am trying t开发者_如何学Co 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.


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;};
}
0

精彩评论

暂无评论...
验证码 换一张
取 消