svg-path-bounds

Get bounding box of an svg path data

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
svg-path-bounds
5421.0.22 years ago6 years agoMinified + gzip package size for svg-path-bounds in KB

Readme

svg-path-bounds Build Status
Retrieve bounding box from svg path data.

Usage

npm install svg-path-bounds ```js 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