All Projects → elrumordelaluz → svg-path-tools

elrumordelaluz / svg-path-tools

Licence: other
Tools to manipulate svg path (d)

Programming Languages

javascript
184084 projects - #8 most used programming language

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 'svg-path-tools'

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'

Related

element-to-path Convert SVG element into path

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].