1.0.1 • Published 5 years ago

svg2object v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

##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