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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    213,723
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    213,723
  • 1.0.1
    22,035
  • 1.0.0
    413

Package Sidebar

Install

npm i svg-path-bounds

Weekly Downloads

236,171

Version

1.0.2

License

MIT

Unpacked Size

8.33 kB

Total Files

6

Last publish

Collaborators

  • dfcreative
  • dy