Assuming you don't care about IE, what's the Pros/Cons for SVG vs Canvas? Canvas seems to be pretty nice from what I've used it for so far...
Canvas is pixel oriented whereas with SVG you have a hierarchical document structure to work with. So if you want to do an online image editor I'd probably go with canvas. For something that needs multiple objects with their own individual event handling - SVG looks a lot easier to me.
Here's why Raphael.js and SVG totally rock.
41–50 of 56 posts
Re: Here's why Raphael.js and SVG totally rock.
#42Earlier quoted context omitted.
I've worked with gRaphael. it's still immature, and the code base is still immature. I'd look at protovis before taking a look at gRaphael. However, I do wish that protovis is based on Raphael and jQuery.
define immature
Re: Here's why Raphael.js and SVG totally rock.
#43Earlier quoted context omitted.
What makes you say that? SVG is pretty much standard drawing primitives wrapped in a XML-based syntax.
Not exactly. SVG syntax describes a scene, it does not draw on screen directly. When you animate an SVG image, you update the DOM. The browser then needs to parse the DOM (attributes) again, then clear the screen and draw each element again. This is a lot more work than just mapping the drawing primitives of Canvas to the lower-level GPU functions. Check this presentation for the two technologies compared in terms of…
I guess it's good to have the choice though - for some things Canvas looks a good choice, for others SVG is better.
Re: Here's why Raphael.js and SVG totally rock.
#44Re: Here's why Raphael.js and SVG totally rock.
#45Earlier quoted context omitted.
define immature
you couldn't put y-axis tick mark labels on bar graphs, to start.
It's worth the effort though - works on iPhone/iPad out of the box, and is super snappy even on OS X (unlike most Flash charting solutions, including Google Viz.)
Re: Here's why Raphael.js and SVG totally rock.
#46Earlier quoted context omitted.
I've worked with gRaphael. it's still immature, and the code base is still immature. I'd look at protovis before taking a look at gRaphael. However, I do wish that protovis is based on Raphael and jQuery.
define immature
but the demos are pretty impressive.
Re: Here's why Raphael.js and SVG totally rock.
#47Re: Here's why Raphael.js and SVG totally rock.
#48Re: Here's why Raphael.js and SVG totally rock.
#49Re: Here's why Raphael.js and SVG totally rock.
#50Assuming you don't care about IE, what's the Pros/Cons for SVG vs Canvas? Canvas seems to be pretty nice from what I've used it for so far...
Canvas is significantly faster for animation: http://www.themaninblue.com/writing/perspective/2010/03/22/ It is also more likely to get faster in the future, as browsers might implement GPU acceleration for it. I wouldn't hold my breath waiting for GPU acceleration for SVG, since SVG is not as easily mapped to drawing primitives, like Canvas is.