# balance-svg-paths

> balance svg paths

Latest version **0.1.0** (published 2014-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install balance-svg-paths
pnpm add balance-svg-paths
yarn add balance-svg-paths
bun add balance-svg-paths
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-01-04 |
| First published | 2014-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Rosoman |
| Maintainers | jkroso |
| Keywords | balance, svg, path, normalize, restructure |

## Links

- npm: https://www.npmjs.com/package/balance-svg-paths
- Repository: https://github.com/jkroso/balance-svg-paths
- Issues: https://github.com/jkroso/balance-svg-paths/issues
- npm.io page: https://npm.io/package/balance-svg-paths

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-01-04

## README

# 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](test/cases.js) for an analysis.

## Installation

With your favorite package manager:

- [packin](//github.com/jkroso/packin): `packin add balance-svg-paths`
- [component](//github.com/component/component#installing-packages): `component install jkroso/balance-svg-paths`
- [npm](//npmjs.org/doc/cli/npm-install.html): `npm install balance-svg-paths`

then in your app:

```js
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](//github.com/jkroso/normalize-svg-path) paths. It returns an Array containing the balanced paths in the same order they were input.

```js
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]])]
```

---
_Source: https://npm.io/package/balance-svg-paths · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
