normalize-svg-path

1.1.0 • Public • Published

normalize-svg-path build

Convert all segments in a path to curves. Usefull if you intend to animate one shape to another. By defining all segments with curves instead of a mix of lines, arcs, and curves tweening becomes much simpler. It could also help you rewrite your SVG code according to the principles of narcissistic design.

Usage

npm install normalize-svg-path

var parse = require('parse-svg-path')
var abs = require('abs-svg-path')
var normalize = require('normalize-svg-path')
 
var segments = normalize(abs(parse('M0 0L10 10A10 10 0 0 0 20 20Z')))

API

normalize(path)

Translate each segment in path to an equivalent cubic bézier curve. The input path must be absolute.

normalize([['L',1,2]]) // => [['C',0,0,1,2,1,2]]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    734,153
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    734,153
  • 1.0.1
    23,483
  • 1.0.0
    1
  • 0.1.0
    207,587

Package Sidebar

Install

npm i normalize-svg-path

Weekly Downloads

965,224

Version

1.1.0

License

MIT

Unpacked Size

13.7 kB

Total Files

8

Last publish

Collaborators

  • jkroso
  • dfcreative