Thursday, July 12, 2007

Node goes up... Node goes down...

Throughout the past week I have been focusing pretty steadily on my Summer of Code project. Last week I reported that container support had been added to Zest. Since then, I have been updating and fixing up many of the issues containers presented. There were a number of small changes that needed fixing (like the fact that my labels were all truncated), but I also managed to add a number of new features. In particular I added open close animations, and container layout and scaling. Now each container can have its own layout and scale depending on the number of nodes. I also reversed the direction of my gradient, although I really should work with the UI team and use the Kelvin Colours.


The most exciting feature I added was a new open / close algorithm. Now, when a container is opened, it moves the nodes below it out of the way. I attempt to put the nodes back when the container closes again. Moving nodes out of the way (without really altering the graph) is considered a pretty hard problem in graph drawing, but since I knew my nodes always grow downward, it made it somewhat easier for me.


Finally I added a fisheye feature. Now, if enabled, when you mouse over a small node you can have it zoom into focus. Using this technique, I chose only to show the icons on the small nodes, but on hover you get the full text. (In this screenshot I moved my mouse over the centre node in top container).



The snippet used to create these screenshots is less than 70 LoC (and if I was a more clever programmer I could probably do it in less than 40).

It was a pretty busy week with a lot of late nights and I haven't seen my wife and daughter much, so I think I will head home and enjoy the nice west coast weather we have been receiving.

5 comments:

Chris Aniszczyk (zx) said...

awesome...

if you double click a "container" does it zoom in and take focus (ie., you only see what's in the container and keep drilling down)?

Cool stuff! Have fun on your break, and don't bring the CPU. The wife will kill you ;)

Bull said...

Chris, zooming in is the plan. right now a container cannot be added to a container, so you don't really need to zoom. But I will add this shortly.

I think the nested containers and zooming will be a bit of work to get right. Queue this up next :)

Villane said...

Cool! Maybe this could eventually be used to port Creole ( http://www.thechiselgroup.org/creole ) to SWT/GEF?

Bull said...

Villane, :) I am actually part of the chiselgroup (I sit 5 feet from the main developer of Creole). This was our plan, when we first started creating Zest, but other research interests kept getting in the way :)

vishwas said...

Awesome !