Skip to content

parametric-svg/parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Tomek Wiszniewski
Oct 13, 2015
db644fd · Oct 13, 2015

History

98 Commits
Oct 13, 2015
Sep 15, 2015
Sep 10, 2015
Sep 9, 2015
Sep 9, 2015
Sep 16, 2015
Sep 9, 2015
Sep 11, 2015
Sep 10, 2015
Oct 13, 2015
Sep 9, 2015
Sep 9, 2015
Sep 9, 2015
Oct 13, 2015
Oct 12, 2015
Sep 15, 2015

Repository files navigation

Coveralls – test coverage Travis – build status David – status of dependencies Stability: experimental Code style: airbnb

parametric-svg-parse

A JS-based parser for parametric.svg graphics

Works in node and in browsers.

 

Install

$ npm install parametric-svg-parse
 

Use

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.

 

License

MIT © Tomek Wiszniewski