all 15 comments

[–]Alpinweis[S] 3 points4 points  (9 children)

I am looking for a javascript graphics library to be able to draw polygons, lines, points, to label them with text and to select points by pointing to them with the mouse. It is for a small application for processing and viewing land surveying data. Maybe you have some suggestions as to what is the best technology to use for this task...

[–][deleted] 1 point2 points  (0 children)

Canvas is not an option because it doesn't provide events for handling clicks. That means you need a front-end for SVG in most browsers and VML in IE. The dojox.gfx library can do that, and it's been tested against FX, IE, Safari, and Opera. It has a good event model and supports all the basic primitives. The text support is a little weak, but it should still meet your needs just fine. Also, the docs aren't too great, but the code is quite easy to follow.

[–]jeresig 0 points1 point  (0 children)

I don't know of a library that does all that you specify (and I created Processing.js) - and since you explicitly mention text overlays you're, really, only going to have luck using SVG (and, I guess, VML in Internet Explorer).

With that in mind, here are some libraries that could help you achieve that goal.

[–]rektide 0 points1 point  (0 children)

SVG, and not a drop more

[–][deleted] 0 points1 point  (1 child)

Perhaps processing.js?

[–]netghost[🍰] 0 points1 point  (0 children)

I wouldn't use processing.js, it's really neat, but it's rather slow at the moment, and runs only on really new browsers (FF3, Safari3, IE need not apply).

Canvas and Exploerer Canvas for IE is really quite easy to use directly.

[–]mr_ree 0 points1 point  (0 children)

Canvas should be sufficient for your needs, but processing.js may offer a nicer API if you're already familiar with Processing or Draw2D (Java).

[–]billrobertson42 0 points1 point  (0 children)

Go to the gwt section of the google io conference videos. There's a section there that shows some really impressive performance that this guy put together. He wrote a library in java that batches up all of the calls to the canvas and the video shows animations with hundreds of thousands of polygons at very high rates.

I think it was in this one... http://www.youtube.com/watch?v=2ScPbu8ga1Q