tracespace / gerber-to-svg

gerber-to-svg development moved to tracespace/tracespace
https://github.com/tracespace/tracespace
MIT License
81 stars 20 forks source link

Allow custom createElement function #30

Closed mcous closed 8 years ago

mcous commented 8 years ago

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:

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.