1.0.1 • Published 9 years ago

parametric-svg-ast v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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

parametric.svg AST

The internal format of parametric.svg

What’s up?

This repo describes the structure of objects that different parts of parametric.svg use to communicate with each other. Here’s some reasoning behind the idea.

Install

npm install parametric-svg-ast

Use

const ast = require('parametric-svg-ast');

const myAst = ast({
  attributes: [
    {
      address: [2, 5, 4],
      name: 'width',
      dependencies: ['a', 'b'],
      relation: (a, b) => a + b,
    },
    {
      address: [4, 8],
      name: 'height',
      dependencies: [],
      relation: () => 59,
    },
  ],

  defaults: [
    {
      identifier: 'a',
      dependencies: [],
      relation: () => 10,
    },
    {
      identifier: 'b',
      dependencies: [],
      relation: () => 20,
    },
  ]
});
//» { type: 'ParametricSvgAst',
//    version: 1,
//    attributes: [object Set],
//    defaults: [object Set] }

API

See the API docs in the source. If you can help us render them in the readme, that would be awesome!

License

MIT © Tomek Wiszniewski