Many of you may be aware of Graphviz, the best in OSS graph
visualization. Where a graph is an abstract collection of nodes joined
together by edges.

     http://www.graphviz.org/

If you are not aware of it, take a look at the gallery.


http://www.graphviz.org/Gallery.php

If you are aware of it....

I've just had a truly Homerian "D'oh!" moment that has expanded my use
of Graphviz.

Most of the things I use graphviz for are digraphs, DIrected GRAPHS,
indicating some sort of dependency.

eg. This class is a subclass of that class.

or This file #include's that file

or This function calls that function...

The tool within Graphviz for plotting digraphs is called "dot". Which
tends to produce very neat, very beautiful, very orderly and very
large outputs that never fit on a printed page.

It has long been a huge source of frustration to me that despite the
cast array of config options, I can never convince dot to pack the
nodes onto a single page.

The tools in the Graphviz suite neato, fdp, circo, twopi... all _only_
eat graphs, not digraphs.

The solution?

Lie.

Instead of telling Graphviz that you have a digraph...

digraph Pretty {
  a->b->c;
  d->c;
}

Lie and call it a graph, but force the edges to have arrows!
graph Pretty {
  edge [arrowhead=normal];
  a--b--c ;
  d--c;
}

Then you can feed your digraphs to neato!

John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : [email protected]
New Zealand

Reply via email to