The power of GraphViz

Ever felt the need to extract some relations from the configuration or data and present it in a visual form nicely layed out. Ever given that up as too hard due to the hard problem of laying out the elements? If you did, then check out GraphViz.

While GraphViz by itself is not Java, it is cross-platform and is fairly easy to setup and invoke from Java. It is also open-source, if that is important to you.

So, what does GraphViz do? Well, it does fancy graph layouts. Sounds boring until you realize that graphs - or data that could become graphs - are actually all over the Java world.

Let me give you a few examples:

  • Ant task dependancies are graphs. If your ant file is rather large, check out ant2dot, Vizant or AntGraph (WayBackMachine archive).
  • Spring dependencies are graphs. If your Spring project is getting complex, get an overview of it with SpringViz.
  • If your code is already deployed, but you experience hangs or slowdowns, Graphviz will help to visualize the thread dumps.
  • If you are not happy with GIF/SVG/PNG/PS output that Graphviz is capable of generating, you could always try a more interactive approach with ZGRViewer (a bit raw, but very promising project)
  • Many other uses exist, some of which are described at the GraphViz resource page
  • Finally, if you are able to generate text file that says a->c; b->c; c->d, you can generate GraphViz input (dot file) and let the program itself do the magic of layout. And once you master a simple dot file, you can start adding such bells and whistles as colors, clusters and structures.

If you have an itch to scratch, let GraphViz help you with it.

BlogicBlogger Over and Out