1

I'm attempting to create a useful ER diagram. In some cases, the diagram ends up super wide because there are many nodes all within the same rank. This can happen for example when many nodes have no connections at all; those nodes are all in the same rank and layout horizontally next to each other.

What I'd like is some kind of compaction where the graph's overall aspect ratio is closer to, say, 4:3. I'm currently using the dot layout. I had used neato in the past but it was far too slow with large graphs and didn't produce great results.

Here's one graph which goes on for miles in either direction:

enter image description here

If I apply "ratio=compress" and "size=4,4" (or various other sizes) then I end up with a slightly more compact version, which did sorta wrap the one rank onto two lines, but it's still super crazy horizontal.

Other options like "ratio=1.0" which should produce a square diagaram, don't attempt to apply layout in a square area, but instead scale/stretch the super-wide layout to be square, which is even worse.

enter image description here

seth
  • 1,647
  • 1
  • 12
  • 20
  • Do you want each table to be displayed without overlap? It's gonna be really hard to read your diagram with this many tables, it would be worth considering to shrink down the tables to only the headers or split the diagram up into modules – Bugbeeb Apr 26 '19 at 18:53
  • I would agree this is an extreme example, but it illustrates the problem well. Edge overlaps would be acceptable, node overlaps would not. There's not really a way to make clusters for now. There's already options to just show the table names, but the same layout problem exists. – seth Apr 26 '19 at 20:54
  • have you tried twopi? – Bugbeeb Apr 26 '19 at 22:03
  • Hmm. pack=true, packMode=node is pretty helpful. The main thing it does is pack subgraphs and completely unconnected nodes into empty space within the graph, which works pretty well. Having more control over connected nodes as well would be great, but this probably handles a large portion of cases well. – seth Apr 26 '19 at 23:16
  • Please take a look at this [question](https://stackoverflow.com/q/11134946/63733) and its answer - does this work for you? I'll mark this question as a duplicate – marapet Apr 27 '19 at 18:25
  • I should have specified I'm doing this with the C API, so a command line tool doesn't quite work, though I haven't looked at code to see how readily I could pull it out. – seth Apr 29 '19 at 03:12

0 Answers0