Lightweight library for manipulating and animating SVG.
star
Why choose SVG.js?
SVG.js has no dependencies and aims to be as small as possible while providing full coverage of the SVG spec. If you’re not convinced yet, here are some highlights.
It’s fast.
SVG.js is fast. Obviously not as fast as vanilla JS, but several times faster than the competition:
Index:
rects,generate 10000 rectsfill,generate 10000 rects with fill colorgradient,generate 10000 rects with gradient fill
lower is better. Tested on Intel Core i7-4702MQ @ 2.2GHz.
Easy readable, well-organized syntax.
Creating and manipulating SVG using JavaScript alone is very complex. For example, creating a simple pink square requires a lot of code:
SVG.js provides a syntax that is concise and easy to read. Doing the same as the vanilla JS example above:
// SVG.js
var draw = SVG().addTo('#drawing')
, rect = draw.rect(100, 100).fill('#f06')
That is all Two lines of code instead TenAnd very little repetition.
go crazy with animation
there is more…
license
SVG.js is licensed under the terms of the MIT License.
of change
Wondering what’s changed in the latest release? Take a look at the change log.
<a href