Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@jamsch/normalize-svg-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jamsch/normalize-svg-path

Convert all segments in a path to curves

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

normalize-svg-path build

Convert all segments in a path to curves. Usefull if you intend to animate one shape to another. By defining all segments with curves instead of a mix of lines, arcs, and curves tweening becomes much simpler. It could also help you rewrite your SVG code according to the principles of narcissistic design.

Usage

npm install normalize-svg-path

import parse from 'parse-svg-path'
import abs from 'abs-svg-path'
import normalize from 'normalize-svg-path'

const segments = normalize(abs(parse('M0 0L10 10A10 10 0 0 0 20 20Z')))

API

normalize(path)

Translate each segment in path to an equivalent cubic bézier curve. The input path must be absolute.

normalize([['L',1,2]]) // => [['C',0,0,1,2,1,2]]

Keywords

svg

FAQs

Package last updated on 10 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts