
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@luncheon/simplify-svg-path
Advanced tools
Extracts Path#simplify()
from Paper.js.
http://paperjs.org/reference/path/#simplify
$ npm i @luncheon/simplify-svg-path
import simplifySvgPath from '@luncheon/simplify-svg-path'
const points = [[10, 10], [10, 20], [20, 20]];
const path = simplifySvgPath(points);
// "M10,10c0,3.33333 -2.35702,7.64298 0,10c2.35702,2.35702 6.66667,0 10,0"
<script src="https://cdn.jsdelivr.net/npm/@luncheon/simplify-svg-path@0.2.0"></script>
<script>
const path = simplifySvgPath([[10, 10], [10, 20], [20, 20]]);
</script>
simplifySvgPath(
points: [x: number, y: number][], // `{ x: number, y: number }[]` is also acceptable
{
tolerance: number = 2.5,
precision: number = 5,
} = {}
): string
// SVG path command string such as
// "M10,10c0,3.33333 -2.35702,7.64298 0,10c2.35702,2.35702 6.66667,0 10,0"
The logic is a copy of Paper.js v0.12.11.
If you like this, please send your thanks and the star to Paper.js.
FAQs
Extracts Path#simplify() from Paper.js.
The npm package @luncheon/simplify-svg-path receives a total of 881 weekly downloads. As such, @luncheon/simplify-svg-path popularity was classified as not popular.
We found that @luncheon/simplify-svg-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.