title: Graphviz/dot: Automatic layout of isolated nodes/components?
body: <p>I want to drawing a graph with a huge number of nodes/connected components, but unfortunately Graphviz lays all of connected components side-by-side, and since my connected components consists of only a few nodes, the image looks like this:</p>
  
  <pre><code>n1   n3      n6 n7 n8 n9 n10 n11 n12 ... n999
  |     | \           |         |
  n2   n4  n5        n13        n13
                      |
                     n14  # all trees have very little heights
  </code></pre>
  
  <p>so I end up with an image with resolution 500000 x 100 which is really messy to work with. </p>
  
  <p>I'm using default settings for <code>digraph</code>, and my <code>.dot</code> file looks like this:</p>
  
  <pre><code>digraph {
    n1 [ style=dashed; color=grey ];  # I just override node style and color
    ...
    n1 -&gt; n2;
    ...
  }
  </code></pre>
  
  <p>and I use the following to generate an image: <code>dot -Tpng &gt; mygraph.dot</code></p>
  
  <p>Is it possible to somehow make the layout automatic but specify:</p>
  
  <ul>
  <li>max width only, e.g. 8.5 inches, so I can easily break up into letter-size paper pages and print it</li>
  <li>any size but make width as close to the height (e.g. I want an image of square shape)</li>
  </ul>
  
  <p>?</p>
  
  <p><strong>Edit</strong>:
  E.g. for the case above, I would be hoping for something like:</p>
  
  <pre><code>n1  n6   n8   n10
  |        |
  n2  n7   n13  n11
           |    |
  n3       n14  n13
  | \
  n4 n5    n9   n12
  
  ...
  
  n999
  </code></pre>