Re: [graphviz-interest] GraphViz 2.34 dot: how to keep the aspect ratio of an unconnected graph reasonable?
"Emden R. Gansner" <[email protected]> Wed, 07 May 2014 15:04:31 -0400
| Newsgroups | gmane.comp.video.graphviz |
|---|---|
| Message-ID | <[email protected]> |
On 5/6/14 11:22 AM, Jeremy Friesner wrote:
> The problem is that when there are no connections between nodes, dot places all the nodes in the graph into a single column, making the graph very tall and thin, and therefore hard to use — you have to either zoom way out, or make the window very tall, or both, in order to see the graph in its entirety.
>
> Is there some way to encourage dot to keep the graph's aspect ratio more moderate in this scenario? Just placing the clusters next to each other (rather than above and below each other) would probably be sufficient; or placing the nodes within a cluster in multiple columns could help too. If there was some way to tell dot to try to approximate a 1:1 or 3:2 aspect ratio when possible, that would be ideal.
We had a prototype feature that allowed you to specify a desired aspect ratio. It did well on
vanilla graphs, but wasn't engineered to work well with many other features
such as clusters. There were sufficiently many bug reports that we disabled it. (Indeed, I'm not
aware of any work combining aspect ratios and nested clusters on graphs.)
If you just want the clusters a bit better placed, you can try the pipeline
ccomps -Cx x.gv | dot | gvpack -array_c | neato -n2 -Tpng > x.png
(We have recently integrated this feature into dot, so you can run dot -Gpackmode=array_c , but you
will need tomorrow's package to get a recent bug fix.)
There are various other options you can use with gvpack. If edges don't play a major role in your
graph, you might try a different layout engine like osage. Or you
can go wild and mix various layout engines.
Emden
_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest