This PR adjusts the API to allow for the usage of a custom element creation function. This means that instead of always returning a string, gerber-to-svg can now return the SVG node as whatever type of object you want. For example:
Real live DOM nodes via document.createElementNS
VDOM nodes via something like React or Deku
A string that doesn't use self-closing tags
A string that is only emoji
This is a breaking change because I removed the color and className options from the main function and parameters from the render method. I doubt anyone was using them, but version numbers are cheap so whatever. I also added an attributes option and parameter, respectively, to allow arbitrary attributes to be attached to the node. See API.md for more details.
This PR adjusts the API to allow for the usage of a custom element creation function. This means that instead of always returning a string, gerber-to-svg can now return the SVG node as whatever type of object you want. For example:
document.createElementNS
This is a breaking change because I removed the
color
andclassName
options from the main function and parameters from therender
method. I doubt anyone was using them, but version numbers are cheap so whatever. I also added an attributes option and parameter, respectively, to allow arbitrary attributes to be attached to the node. See API.md for more details.