tags:

views:

254

answers:

2

Howto break a flat but sparsely connected graphviz graph into multiple rows?

Graphviz yields a graph of about 4 ranks, but over 9000 nodes wide. However since the graph is sparsely connected we could break it in to rows, for example each 1000 nodes, and thus make it fit on nine rows one page. How can this be done?

Not looking for unflatten, but rather something like line breaks in a text editor (is it clear what I am looking for?).

Edit: PDF with example graph here

A: 

Like GraphViz Documentation, section 2.5: Node and Edge Placement, like Figure 9: Graph with constrained ranks?

http://www.graphviz.org/pdf/dotguide.pdf

anachoret
Thanks for the pointer! But as far as I see I cannot put a subgraph below another without a third one to align them. And also, I would have to do this manually, ie having to know the connected components in advance and decide manually which one to put on the same row. I would rather like to have something that uses `dot` to align the subgraphs and then `neato` to layout all subgraphs.
Adrian
A: 

I found a work around: we take the output of running the dot command (which is a dot file with all x/y positions in there) and pipe it through a ruby script to break the graph into lines "manually".

Adrian