A JS-based parser for parametric.svg graphics
Works in node and in browsers.
$ npm install parametric-svg-parse
const parse = require('parametric-svg-parse');
// In the browser:
const domify = require('domify');
const svg = domify('<svg><rect parametric:width="a + 5" /></svg>');
// …or in node:
const svg = document.querySelect('#my-svg');
const ast = parse(svg);
ast;
//» { type: 'ParametricSvgAst',
// version: 1,
// parameters: [object Set],
// defaults: [object Set] }
You can now pass the ast
to parametric-svg-patch.