svg2object
v1.0.1
Published
Convert svg element to js Object.
Downloads
2
Readme
##SVG2Object
Convert sve element to Object:
Use:
import svg2object from 'svg2object';
svg2object(document.getElementById('someElement'));
1, convert <circle />
to:
{
type: 'circle',
cx: 50,
cy: 50,
r: 20
}
2, convert <rect />
to:
{
type: 'rect',
height: 20,
width: 50,
x: 10,
y: 10,
rx: 2,
ry: 2
}
3, ... addon