
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
svgpath-toolkit
Advanced tools
用于 SVG path 转换的工具包
注: 本工具只针对 path data 字符串, 不能使用 svg xml
npm install svgpath-toolkit
import 引用import {SvgPath} from 'svgpath-toolkit';
var transformed = SvgPath('path string')
.scale(0.5)
.translate(100,200)
.rel()
.round(1)
.toString();
script 标签<script type="module">
import {SvgPath} from 'node_modules/svgpath-toolkit/lib/index.js';
</script>
或者
<script src="node_modules/svgpath-toolkit/index.js"></script>
<script>
var SvgPath = svgpathToolkit.SvgPath;
</script>
所有方法都是链式的 (返回对象本身).
用链式方法创建新的 SvgPath 对象实例
类似于 Array.from(). 从字符串或其他SvgPath 实例创建新的SvgPath 对象实例
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.
MIT
FAQs
SVG path 转换工具包
The npm package svgpath-toolkit receives a total of 2 weekly downloads. As such, svgpath-toolkit popularity was classified as not popular.
We found that svgpath-toolkit 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.