SVG Movable Node Graph

I’ve been having fun lately with JavaScript, SVG, and simple node graphs. I just added movable/draggable nodes to my VisualizeInteractions project. It’s helping me get my head around closures.


I’m not at the point of mastering JavaScript. I never think of closures in advanced when building a project. I sort of just throw them in when an event doesn’t work or my context is suddenly wrong. At least I’m no longer using global variables to get things working.

Much of the code for this was borrowed from the Raphaël sample which does use global variables for the event methods and array of edges in the graph. Most of the heavy lifting is done by the Raphaël JavaScript library which I really like since it is compatible with most browsers. The only issue I have seen is old version of android which didn’t support SVG.

Leave a Reply

Your email address will not be published. Required fields are marked *