4 ms·
I have found myself using jQuery SVG more. This link shows what other people think of the two: http://stackoverflow.com/questions/588718/jquery-svg-vs-rapha
by Xurinos 17y ago
I have found myself using jQuery SVG more. This link shows what other people think of the two:
http://stackoverflow.com/questions/588718/jquery-svg-vs-raphael
The version of Raphael I used at one point had to be in complete control from object 1 and could not import SVGs. So let's say I generate an SVG via graphviz and then want to make some of the nodes interactive (or at least animate). I get a good amount of tweening via the jQuery interface, including the ability to load up the externally created SVG.
Anyway, for comparison, here is the jQuery SVG interface:
http://keith-wood.name/svg.html
Why have I used the SVG? It animates smoother in HTML4 on iPhone's Safari and on my linux distro's Firefox than when I tried canvas manipulations.
More recently, I noticed the HTML5 canvas stuff being smooth for both. Still, the benefit of the SVG is having the ability to treat each object as its own DOM element, where you have to rig all that framework yourself for graphical objects you create on the canvas.
- arethuza 17y agoI agree - I tried Raphael but actually found it a bit limiting. I can live without IE support (I can use Flex for that) so jQuery SVG looked like the better choice. The only criticism I could make of jQuery SVG is that the docs often assume that you know a lot about SVG, but that is pretty minor.
- chairface 17y agoI'm in enthusiastic agreement. I tried to use Raphael for a hobby project that required efficient scaling of a lot of elements, and I thought Raphael would be ideal for this. Unfortunately, Raphael's list-like data structure (I forget exactly what it's called) doesn't take advantage of SVG's natural advantages in this area. It loops over all the elements in the list and scales them individually, rather than putting them all in one <g> node and scaling that. It's horribly slow for large groups. edit: I should mention that I moved to jquery-svg and have been happy ever since. :)