Monday, October 15, 2012

Prefuse: The Right Choice

I found and fixed a years-old bug in Prefuse that was preventing maps of local space from displaying correctly. As I said before, Prefuse is very powerful and flexible. It owes much of its flexibility to its complexity, but there is an underlying simplicity in its design that emerges as you begin to understand how it works. My notes about the sequence of method calls that led to a variable getting clobbered filled two pages in my notebook. And yet, the fact that I was able to identify and solve the problem in a day reaffirms that Prefuse was the right choice for this project. Its active user base may be limited, but the quality of its code speaks volumes.

The day after figuring out how to extend the Graph class to represent mixed graphs, I realized that I don't really need mixed graphs; all I need is to draw them as if they were mixed. I achieved this by writing a Predicate to check for the existence of a return edge, and another to match only the ascending edge of two-way pairs. The result is what you see here:

This mockup is still far from finished, but it should give you some idea of how gorgeous the map will be. I love how even the one-ways in are included in the distance filter; Prefuse took care of that detail automatically. The final version will convey a lot more information through colors and icons, and of course it'll have a nice starry background and look totally awesome.

No comments:

Post a Comment