Add function to return SVG as JSON Array
In addition to returning SVG document contents, a getJSON(). This allows users to create their own SVGs using the given paths, and allows for easier data manipulation. The information returned from the new function is similar to what is returned from the other functions. It holds the width and height data of the svg, and the data of each of the svg's created paths.
The structure of the resulting array is as follows:
[
{
height: 320,
width: 240
},
{
d: "M 636.282 50.537 C 628.002 52.767, ...",
id: 1,
fill: "black",
stroke: "black",
fillRule: "evenodd"
},
{
d: "M 639.487 67.746 C 632.040 70.400, ...",
id: 2,
fill: "black",
stroke: "black",
fillRule: "evenodd"
},
...
]
Interesting.
Seems relatively straightforward. Couple points:
- There's a conflict in package-lock.json currently
- Could we get a test?
I have bumped the version number in package.json. That was the conflict that you mentioned. I will now add some tests.