Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Thursday, June 8th, 2006

Time Event
9:47a
Graphing Package
I've been working on a graphing (as in nodes) package in javascript (with ruby on rails plugins)... It uses a <canvas> for decorations and for drawing lines; here's a link to a first prototype/proof of concept. I need to add in the links to excanvas so it will work with explorer, that will probably happen later today, but you can still look at the picture if you want ;-)

Image

Believe it or not, all of those nodes are created with <ul> lists and placed on top of the canvas. Yup. With absolute positions for the <li> and a recursive algorithm to calculate the layout. The borders of the nodes and the lines connecting them are drawn on the canvas. I could, if I so desired, draw the nodes as ellipses (which are not normally supported by <canvas>, but I've written some extensions to the CanvasRenderingContext2D class to support ellipses). I don't have the code written to draw the lines between the nodes for ellipses yet..... for a future day.

My (ugly) prototype code can be found at tarpaulin.rubyforge.org.

I hope to have it properly in a nice javascript class tonight, with the ability to render the graphs from Left to Right, Top to Bottom, Right to Left, or Bottom to Top.

And this should be packaged as a Ruby on Rails gem tonight.

Current Mood: geeky

<< Previous Day 2006/06/08
[Calendar]
Next Day >>
About LiveJournal.com
Image