April 23, 2009

Graph Visualization/Interaction

I'm been trying to find a good open source C#/.NET library for graph visualization and manipulation (Not charts/graphs, but graphs as in Computer Science graph theory/nodes/edges.) I have come up pretty empty handed. I'm trying to find a way to visualize and interact with a state machine library that I have. So I just need basic nodes and edges, both with labels and color, and automatic layout algorithms. I've looked and looked and come up empty handed, the best I could find were:
  • QuickGraph, which didn't seem to have any useful interactive capabilities, and depended on other libraries/code for displaying graphs.
  • NodeXL which seemed to be primarily excel based (who does that?), but did have a library component, but didn't seem to be able to even label edges of graphs.
  • Netron which seems to have existed once as open source, but is now something else (The website is very unclear about what/if they are selling), there is an older version of the open source code that has lots of components, but it doesn't appear to be geared toward library use.
  • Piccolo2D seemed promising, but also seemed to not support labeling edges, and also seemed more oriented towards alternate UI design than simple graph display and manipulation.
Since I couldn't find any compelling C# solutions, I resorted to the defacto standard for graph visualization: Graphviz. It's been around for ever and does very well at displaying graphs, but the best interface I could find was the command line app dot, which works well, but not ideal for integration into a library. I've written a small very specialized C# library that converts my state machines into simple dot files, and processes them in dot through the command line to image files. It is far from ideal, but the results are pretty good. Unfortunately the options for interacting with the graphs are limited since all I get is an image. Hopefully someone will come up with a decent graph visualization/manipulation library for C# some day. Until then, this will have to do.

P.S. Just in case anyone is wondering, I did consider using Windows Workflow Foundation for our state machines, but they seemed way to heavyweight, and since it sounds like they are rearchitecting the system for version 4.0 (To finally get it right hopefully?). I decided to steer clear.

1 comment:

image manipulation said...

I love the amount of details you gave in your instructions through this article. Looking forward to more from you.