nicer api for creating and manipulating svg elements
$ component install matthewmueller/svg-element
var element = require('svg-element');
var box = element('rect')
.size(100)
.attr('fill', 'black')
.rotate(20)
.move(50);
var svg = document.getElementsByTagName('svg')[0];
svg.appendChild(box.el);
Initialize Element
.
Access to the raw svg element.
Get and set attributes
Set the width and height
Perform a transform on the element. Options include: rotate
, scale
, skewX
, skewY
, translate
, transform
.
Move
Rotate the element
Scale the element
MIT