cpettitt/dagre — pull request #62 by bpodgursky (2013-08-09 09:19:35+00:00)
Title: Add helper file for rendering to d3 and corresponding demo files

This is an awesome library. I've been looking for graphviz-like graph rendering in the browser for a while now, and was pretty unhappy with the force-directed rendering d3 did.

When I started playing with dagre I found there was a fair amount of overhead in translating my graph data into a decent-looking d3 svg--a lot of the code in demo.html felt boilerplatey. I took a shot at factoring the d3 integration code from demo.html into a separate file that people new to the library (like me) could use easily. That file is dagre-d3-simple.js.

I also did some fiddling with the styling and edge routing to make it easier to make smooth-looking graphs out of the box (added dagre-d3-simple.css).

You can see three demo pages I added here:

http://bpodgursky.github.io/dagre-demo/demo/sentence-tokenization.html
http://bpodgursky.github.io/dagre-demo/demo/state-graph-dot.html
http://bpodgursky.github.io/dagre-demo/demo/state-graph-js.html

I'm a total noob when it comes to javascript, so let me know if there's a better place to put this code; I wasn't sure if it made more sense here or as a separate library or what.

Thanks for all your work on this project, I'm really happy it exists.