jump to navigation

Graphviz September 29, 2006

Posted by steve in Graphviz.
trackback

Have you ever had a problem that you felt you could solve if only you could get a sense of the ‘big picture’? Ever needed help visualizing some complex relationships? How about a simple, free, open-source graphing application that produces highly-customizable output? Well, you should give Graphviz a try.

Suppose you would like to visualize the following relationships:

X -> Y;
Y -> Z;
X -> Z;

( I know this is trivial, but use your imagination). The above is almost exactly the input to Graphviz. Simply wrap the above into a ‘digraph’ structure and save it in a text file:

digraph G {
x -> y;
y -> z;
x -> z;
}

Running Graphviz and choosing the ‘dot’ layout engine results in this:

Graphviz Sample Pretty cool, don’t you think? Graphviz was developed by AT&T Labs and has a wide variety of uses. If you just need a quick visualization, you can do something like I have shown above. But if you want to ‘tweak’ the output a little more (like adding boxes, grouping nodes, labeling edges, etc), Graphviz can accomodate you. Check out the Graphviz web site for examples of some of the more sophisticated graphs you can create. There is also a sub-project called “Grappa” that is a Java package for Graphviz. There are Windows, Linux, OS/X and other OS executables available, or you can build your own using the source.

Comments»

1. Allan Clark - April 30, 2007

Heya;

Have you seen a way to get a graphviz plot into a wordpress entry? Some kinda graphviz plugin? I’ve been searching…