TLDR; I'm going with Snap.svg. It's new but based on a mature library.
This is a round up of the best three libraries I've found as of November 2013.
jQuery SVG
jQuery SVG by Keith Wood is a series of extensions to the jQuery framework for handling SVG. jQuery works brilliantly for working with a DOM, so it is only reasonable to assume that SVG (which uses a DOM) should also be suitable for jQuery too. The documentation is good, there is a community and plenty of examples.The syntax for building and animating is sensible:
Working Example. My concern with jQuery-SVG is that the last update was in April 2012, for jQuery 1.7. This does not feel like a project that has someone owning it under active development.
Raphael
Raphael by Dmitry Baranovskiy is a well established SVG library that acts as an abstraction in front of SVG and VML (used in IE6 and 7). If you need to support older browsers, it's the best choice. The problem with supporting older browsers is that it is very difficult to implement modern SVG functionality and still support IE6 and 7.The syntax for building and animating a rectangle is neat too:
Working example. For my project, supporting older browsers is not a requirement. Raphael is still well supported and there is documentation, but I didn't get on well with the docs: I needed more concrete examples of use of the various elements and how they fit together. That's a matter of taste, you might get on better.
Snap
Snap.svg is also by Dmitry Baranovskiy and is supported by Adobe (since Dmitry was hired by their Web team - fair play!). Snap shares a lot of code with Raphael and is identical in places. Snap drops support from IE6/7 and is lighter for it. The interface is much like Raphael.The interface for building and animating is simple:
Working example. The current version of the Snap framework is 0.1 and usually this would set off alarm bells. I am not concerned in this case as Snap is based so heavily on Raphael that it brings with it a long history and support community. Snap is going to be my choice.
0 comments:
Post a Comment