scale-svg-path

0.0.1 • Public • Published

scale-svg-path

scale-svg-path scales the position of a parsed SVG path along its X/Y axes. It was extracted from Fontello’s wonderful svgpath toolkit.

Build status

Browser support

Older browsers might require a polyfill for Array.prototype.map.

Install

$ npm install scale-svg-path

API

scale(path, sx [, sy]) // sy = sx if undefined

Example

var parse = require('parse-svg-path')
var scale = require('scale-svg-path')
var serialize = require('serialize-svg-path')
 
var path = parse('M10 10 L15 15')
var x = scale(path, 0.5)
var xy = scale(path, 0.5, 1.5)
 
serialize(x)
// => 'M5 5 L7.5 7.5'
 
serialize(xy)
// => 'M5 15 L7.5 22.5'

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    7,895
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    7,895
  • 0.0.0
    1

Package Sidebar

Install

npm i scale-svg-path

Weekly Downloads

6,444

Version

0.0.1

License

MIT

Last publish

Collaborators

  • michaelrhodes