🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

balance-svg-paths

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balance-svg-paths

balance svg paths

0.1.0
latest
npm
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

balance-svg-paths

Make two paths equivalent in terms of structure while respecting their original shapes. So they can be easily tweened and animated. Currently its a pretty half-ass implementation. See test/cases.js for an analysis.

Installation

With your favorite package manager:

  • packin: packin add balance-svg-paths
  • component: component install jkroso/balance-svg-paths
  • npm: npm install balance-svg-paths

then in your app:

var balance = require('balance-svg-paths')

API

balance(a, b)

Define a and b using the same number of path segments while preserving their shapes. Where both a and b are normalized paths. It returns an Array containing the balanced paths in the same order they were input.

var a = [['c',0,0,50,0,50,0], ['c',0,0,0,50,0,50]]
var b = [['c',5,5,45,5,50,0]]
balance(a, b) // => [a, b.concat([['c',0,0,0,0,0,0]])]

Keywords

balance

FAQs

Package last updated on 04 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts