Skip to content

felixknox/normalize-svg-path

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

normalize-svg-path

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.

Installation

With your favourite package manager:

  • packin: packin add normalize-svg-path
  • component: component install jkroso/normalize-svg-path
  • npm: npm install normalize-svg-path

then in your app:

var normalize = require('normalize-svg-path')

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]]

About

"simplify" an svg path

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.9%
  • HTML 25.8%
  • Makefile 3.3%