JSPM

svg-path-tools

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1669
  • Score
    100M100P100Q139614F
  • License MIT

Package Exports

  • svg-path-tools

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svg-path-tools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

SVG Path Tools!

Tools to manipulate path, such as parse and scale.
[wip]

Install

yarn add svg-path-tools

Usage

import { parse, scale, stringify } from 'path-utils'

const d = 'M15 10A5 5 0 0 1 10 15A5 5 0 0 1 5 10A5 5 0 0 1 15 10z'
const parsed = parse(d)
const scaled = scale(parsed, { scale: 0.5 })
const stringified = stringify(scaled)

// 'M7.5 5A2.5 2.5 0 0 1 5 7.5A2.5 2.5 0 0 1 2.5 5A2.5 2.5 0 0 1 7.5 5z'

element-to-path Convert SVG element into path