Friday, February 10th, 2006
New Javascript/Canvas Graph library
<>p>Aslak Hellesøy and Dave Hoover have put together a JavaScript library that can draw interactive graphs (as in nodes, not as in charts).The library currently has three functional layers:
- The graph model (Graph, Node and edges)
- Layout algorithms: (Graph.Layout.*)
- Rendering schemes: (Graph.Renderer.*)
Usage
-
-
var g = new Graph();
-
-
g.addEdge($('fred'), $('wilma'));
-
g.addEdge($('wilma'), $('dino'));
-
g.addEdge($('fred'), $('barney'));
-
g.addEdge($('wilma'), $('barney'));
-
g.addEdge($('aslak'), $('fred'));
-
g.addEdge($('aslak'), $('dave'));
-
g.addEdge($('patty'), $('aslak'));
-
g.addEdge($('barney'), $('patty'));
-
-
var layouter = new Graph.Layout.Spring(g);
-
layouter.layout();
-
-
var renderer = new Graph.Renderer.Basic($('people'), g);
-
renderer.draw();
-
In related news, Benjamin Joffe posted an example on writing to a canvas element.
Related Content:












Dammit, there goes my weekend. Just when I get a weekend where nothing cool comes out that makes me want to take it apart and see what makes it tick this comes out! :)
Seriously, this looks very cool on the surface. If this works as good as the article reads this could be cool for mapping all these new “semantic web” nodes.
=C=
Cal Evans
http://blog.calevans.com
Should I be able to interact with this graph? It always comes across as a static element in Safari and the latest Firefox.
Site is down, anyone have a mirror?
Looks like the entire sits is not down. Only that page has a 500 Internal server error. For the javascript code checkout http://webfx.eae.net/dhtml/chart/chart.html
Hate to mention this guys, but the first link is definately not available – keep getting a 500 response for: http://aslakhellesoy.com/articles/2006/02/09/announcement-new-javascript-canvas-graph-library
Might be sensible to remove this or replace with an alternate link!!
Hi,
I have seen a javascript Canvas / Graph library on http://www.openjacob.org
or http://www.openjacob.org/draw2d.html
….the target of the lib is a “Visio like javascript SDK” library under LGPL
greetings
Andreas Herz
Hi,
Open-jacob draw2d seems to be a “moving target”.
API is still in change. But at the moment the API is cool.
….fine
David
we have used the open jacob sdk to develop a workflow
editor based on the “jacob.blooper” bugtracker starter kit
and it works perfect.
I think it is not a “moving target”.
thanks
Mark
Here’s a mirror of the code:
http://snipplr.com/view/1950/graph-javascript-framework-version-001/
Hi,
Open jacob has a AJAX workflow editor too. Fine and fast
Congratulation!
thx to the jacob team.
mark
Hi,
Looks great, neat and simple.
Doesnt work for IE 7.0?. Is there any change in the script needed.
Thanks
Prasanna
mail the error to the developer of draw2d!
greetings
Draw2D + Yahoo UI library
Demo: http://www.openjacob.org/draw2d/single/YahooUI_integration/index.html
Greetings
Andreas
Congratulation!
thx to the jacob team.
wang