Wednesday, April 6, 2011

Lessons learned from OpenGL NetworkX Visualizations and my current proposal.

Shortly before the Google Summer of Code announcement I commenced writing an openGL NetworkX visualization function. I was inspired by Ian Johnson who had an interesting post about about using openCL in python and had a great class for making a 3D OpenGL scene. I had also recently come across some network data that I wanted to display in 3 dimensions, and nothing I found could easily do so. So I dropped most everything else I should have been doing (apologies to my advisor), and went to work. I posted the result to the NetworkX mailing list a few days later. The code certainly works, and for modest sized, sparse graphs (<10000 nodes) it does a fair job of displaying network data in 2 or 3 dimensions.
I was of course thrilled to see that one of the GSoC suggestions for NetworkX was to improve visualization support. I was convinced I was a perfect fit, and began hammering out a proposal and thinking about how the project might go. And as I did, I slowly began to realize how I might have gone about things better.
  1. The world probably doesn't need another Network visualization tool. Tools like Gephi and cytoscape produce some pretty amazing results, and more general tools like matplotlib and mayavi even if they aren't designed to display networks handle all the under the hood graphics and speed optimizations.
  2. Interactivity is important. Because of how I set up OpenGL, or perhaps limitations of PyOpenGL (I am certainly no expert), my work required everything to be set up ahead of time. This makes it hard to visualize graph generation algorithms in real time, or change colors based on paritions, like in gephi, or do anything fun other than rotate around a scene.
  3. The model wasn't general enough. Rather than just translating directly from a NetworkX class to OpenGL, I should have thought about how to generally interface with a drawing system. This is reflected in the proposal to develop the visualization engine.
After some discussion with the NetworkX developers, I am going to retool my proposal to focus more on an interface with Gephi as well as improvements to the matplotlib drawing functions. Hopefully this will be of some more use.

No comments:

Post a Comment