svg-path-bounds

    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

    Install

    npm i svg-path-bounds

    DownloadsWeekly Downloads

    96,950

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.33 kB

    Total Files

    6

    Last publish

    Collaborators

    • dfcreative
    • dy