# @antv/path-util

> A common util collection for antv projects

Latest version **3.0.1** (published 2022-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @antv/path-util
pnpm add @antv/path-util
yarn add @antv/path-util
bun add @antv/path-util
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2022-05-03 |
| First published | 2019-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 351.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 72 |
| Author | https://github.com/orgs/antvis/people |
| Maintainers | zhangjunjie-loki, rainy25ghz, zeyuwang, yanxiong, susiwen8, freestyle21, soundquiet, elaine.q.10, sturuby, lviser, sakuya223, serializedowen, xdzhao, yangzhanmei, wjgogogo, leungwensen, dori, iaaron, yard, simaq, dxq613, intchous, susan_ann, jinke.li, lzxue, army8735, atool, baizn, dengfuping, neoddish, jeffy2012, zqlu, afc163, pomelo-nwu, kopiluwaky, ccnuzindex, panyuqi, bubkoo, zengyue, kasmine, boyu.zlj, l1ud0ngq1, newbyvector, winniexing, chenluli, kn9117, xdddst, semious2020, esora, nadia_liu, bbsqq, mxz96102, openwayne, pearmini, pddpd, yiqianyao, zhanba, cxxxxxn |
| Keywords | util, antv, g |

## Links

- npm: https://www.npmjs.com/package/@antv/path-util
- Repository: https://github.com/antvis/util
- Homepage: https://github.com/antvis/util#readme
- Issues: https://github.com/antvis/util/issues
- npm.io page: https://npm.io/package/@antv/path-util

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.0.3
- [gl-matrix](https://npm.io/package/gl-matrix.md) ^3.1.0
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 3.0.1 (latest) — 2022-05-03
- 3.0.1-alpha.0 — 2022-05-03
- 2.0.15 — 2021-10-06
- 2.0.14 — 2021-09-27
- 2.0.13 — 2021-09-23
- 2.0.12 — 2021-09-07
- 2.0.11 — 2021-09-05
- 2.0.10 — 2021-08-31
- 2.0.9 — 2020-12-21
- 2.0.8 — 2020-05-07
- 2.0.7 — 2020-03-11
- 2.0.6 — 2020-03-10
- 2.0.5 — 2020-02-24
- 2.0.4 — 2019-10-15
- 2.0.3 — 2019-06-06
- … 6 more at https://npm.io/package/@antv/path-util/versions

## README

# path-util

> 为 `antv` 开发的轻量级 path 处理的工具库。


## 安装下载

> tnpm i --save @antv/util

```js
// 所有的 api 是都这么引入，名字不同而已
import { parsePathString, path2Curve } from '@antv/path-util';
```


## API 文档
* catmullRom2Bezier(arr, closed): 将点的数组转成曲线
* fillPath(source, target): 动画前填充path
* fillPathByDiff(source, target): 左右平移动画前的填充 path
* pathIntersection(path1, path2): 两条线的交点
* parsePathArray(arr) `String` ： 将数组转成字符串
* parsePathString(str)`String[]`: 将字符串转换成数组
* path2Curve(arr|str) `String[]`: 转曲
* path2Absolute(arr|str) `String[]`: 都转换成大写绝对路径的写法
* reactPath(x, y, w, h, r) `String[]`: 支持圆角的矩形

## 实例

> TODO 完善上述各个方法的使用实例。

---
_Source: https://npm.io/package/@antv/path-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
