svg-path-bounds
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/svg-path-bounds package

1.0.2 • Public • Published

svg-path-bounds Build Status

Retrieve bounding box from svg path data.

Usage

npm install svg-path-bounds

const getBounds = require('svg-path-bounds')

let [left, top, right, bottom] = getBounds('M0 0L10 10 20 0Z') // [0, 0, 20, 10]

API

bounds = getBounds(path|segments)

Calculate bounding box for svg path data string or parsed path segments array. The box is detected by controlling points, not the real path.

Related

Similar

License

MIT © Dima Yv

Package Sidebar

Install

npm i svg-path-bounds

Weekly Downloads

200,119

Version

1.0.2

License

MIT

Unpacked Size

8.33 kB

Total Files

6

Last publish

Collaborators

  • dfcreative
  • dy