svg-path-bounds
Retrieve bounding box from svg path data.
Usage
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
- parse-svg-path - return svg path data segments
- abs-svg-path - convert svg path to absolute values
- rel-svg-path - convert svg path to relative values
- normalize-svg-path - make path consist of only bezier curve segments
- draw-svg-path - create canvas shape based on svg path data
- normalize-svg-coords - bring svg path coordinates to any linear range
Similar
License
MIT © Dima Yv