0.0.5 • Published 9 years ago

parametric-svg v0.0.5

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

Travis CICode climateDavid DM

Parametric 2D graphics in the browser. With pure SVG.

Heads up! This package is in an early development stage. Not ready for use yet.

Installation

$ npm install parametric-svg

API

parametricSVG(svgRoot, [parameters])

Parse and render all elements within the svgRoot. Defaults set with <ref> elements will be used for calculation, unless you override them with parameters.

Parameters

parametertypedescription
svgRootSVGSVGElementAn <svg> element.
[parameters]Objectoptional: A hash of additional parameters. They'll extend and override defaults set with <ref> elements.

Returns VirtualTree, A cached virtual DOM tree for lightning-fast redraws.

parametricSVG(element, parameters)

Pass any SVG node (like <circle>) to parse and render the node and all its descendants.

Parameters

parametertypedescription
elementSVGElement
parametersObjectA hash of parameters.

Returns VirtualTree, A cached virtual DOM tree for lightning-fast redraws.

parametricSVG(virtualTree, [parameters])

Pass a cached VirtualTree to render the tree without reparsing any DOM. This is the fastest option.

Parameters

parametertypedescription
virtualTreeVirtualTree
[parameters]Objectoptional: Supply a hash of additional parameters. They'll extend and replace cached ones.

Returns VirtualTree, A cached virtual DOM tree for lightning-fast redraws.

undefined

License

MIT © Tomek Wiszniewski.