Gathering detailed insights and metrics for svgpath
Gathering detailed insights and metrics for svgpath
Gathering detailed insights and metrics for svgpath
Gathering detailed insights and metrics for svgpath
npm install svgpath
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
542 Stars
156 Commits
57 Forks
13 Watching
2 Branches
12 Contributors
Updated on 22 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.9%
63,287
Compared to previous day
Last week
8.2%
346,342
Compared to previous week
Last month
11%
1,403,758
Compared to previous month
Last year
15.5%
14,806,533
Compared to previous year
Low level toolkit for SVG paths transformations. Sometimes you can't use
transform
attributes and have to apply changes to svg paths directly. Then this package is for you :) !
Note: this package works with path data strings, not with full svg xml sources.
1npm install svgpath
1var svgpath = require('svgpath'); 2 3var transformed = svgpath(__your_path__) 4 .scale(0.5) 5 .translate(100,200) 6 .rel() 7 .round(1) 8 .toString();
All methods are chainable (return self).
Constructor. Creates new SvgPath
class instance with chainable methods.
new
can be omited.
Similar to Array.from()
. Creates SvgPath
instance from string or another
instance (data will be cloned).
Converts all path commands to absolute.
Converts all path commands to relative. Useful to reduce output size.
Rescale path (the same as SVG scale
transformation). sy
= sx
by default.
Rescale path (the same as SVG translate
transformation). y
= 0 by default.
Rotate path to angle
degrees around (rx, ry) point. If rotation center not set,
(0, 0) used. The same as SVG rotate
transformation.
Skew path along the X axis by degrees
angle.
Skew path along the Y axis by degrees
angle.
Apply 2x3 affine transform matrix to path. Params - array. The same as SVG
matrix
transformation.
Any SVG transform or their combination. For example rotate(90) scale(2,3)
.
The same format, as described in SVG standard for transform
attribute.
Converts smooth curves T
/t
/S
/s
with "missed" control point to
generic curves (Q
/q
/C
/c
).
Replaces all arcs with bezier curves.
Returns final path string.
Round all coordinates to given decimal precision. By default round to integer. Useful to reduce resulting output string size.
Apply iterator to all path segments.
segment
, index
, x
and y
params.
Where (x, y) - absolute coordinates of segment start point.[]
means
that current segment should be delated).If second param keepLazyStack
set to true
, then iterator will not evaluate
stacked transforms prior to run. That can be useful to optimize calculations.
You can support this project via Tidelift subscription.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 5/25 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More