$ cnpm install svg-path-bounds
Retrieve bounding box from svg path data.
const getBounds = require('svg-path-bounds')
let [left, top, right, bottom] = getBounds('M0 0L10 10 20 0Z')
Calculate bounding box for svg path data string or parsed path segments array. The box is detected by controlling points, not the real path.
0..1
rangeMIT © Dima Yv
Copyright 2013 - present © cnpmjs.org