module:SVGLoader

module:SVGLoader

Utility class to load an external SVG file and extract discrete paths as simple arrays of point coordinates

Constructor

new (require("SVGLoader"))()

Source:

Methods

(static) load(svgNode) → {array}

Source:
Extract an array of simplified paths from an SVG DOM node
Parameters:
Name Type Description
svgNode node SVG DOM node containing the document to parse
Returns:
Array of simple objects containing the starting X and Y coordinates and an array of subsequent points that define the path
Type
array

(static) loadFromFileContents(contents) → {array}

Source:
Kick of parsing of an SVG file that has been imported via `require()` as a flat string
Parameters:
Name Type Description
contents string Entire contents of an SVG file as a flat string
Returns:
Array of paths produced via `load()`
Type
array