Is it possible to adjust aspect ratios (via ratio graph attribute) for neato or fdp layout engines? It seems not - any recommendation for how to accomplish that? Thank you!
Edit - This (truncated) file will layout with given aspect ratio in dot, but not neato
I don’t see any code in fdpgen for that. One wonders a little about whether it would have made sense to perform this transformation externally (e.g. in lib/common). This would probably entail resampling the edge splines to perform this transformation in an appropriately controlled way. I’m sorry it’s been so long, I can’t remember if there are reasons we didn’t attempt this. It would be a good intermediate level project for someone who wants to work on the code.
OK to change X or Y scale after laying out the graph.
This is what the ratio attribute does - for every engine exceptneato. Neato seems to just ignore ratio.
The downside is that transforming one dimension starts to look like a “funhouse mirror” effect - squished or stretched. Sometimes no big deal, but maybe not in this graph.
By the way, neato will honor the ratio attribute if you put it in a pipeline with itself!? Like so, neato -Tdot myfile.gv |neato -n2 -Tpng >myfile.png (Possible solution 1)
Go figure! (Just a wild guess on my part)
Layout the graph honoring non-square boundaries. (Keep it simple, OK with rectangular boundaries, at least to start). Keep X and Y scales identical.
Neither neato nor fdp seem to support this directly, and hardly indirectly.
There do not seem to be any attributes that adjust the bounding-box of the layout
There does not seem to be any way to explicitly place “filler nodes” in a graph to fill-in a space. Pinned nodes act as an overlay, and do not seem to affect the rest of the graph placement. The pinned nodes just splat on-top-of the graph. Dang.
Clusters just create subsets of the graph, each in its own square space. You could create lots of clusters and then arrange them like building blocks, but this requires a chunk of cluster-moving code. Doable, but questionable. (Possible solution 2)
The pack attribute easily allows definition of a non-square (rectangular) layout
e.g. graph [packmode="array_c4"] (Possible solution 3) Note that graph-level packing is not as dense as the default (node-level). Maybe OK and maybe not.
Finally, if all the disconnected graphs are smallish, you could produce a “regular” (squarish) resultant graph, and the carve a slice off of one side. (Remove each disconnected graph that contains any node with X (or Y) outside the new boundary). This require a bit of post-processing and you would actually lose content! (hey, whats losing a few dozen molecules among friends?) In the case of 500 molecules, it might be acceptable. (Possible solution 4)