← 返回 Skills 市场
openlark

SVG.js — lightweight SVG manipulation & animation library.

作者 OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
37
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install svgjs
功能描述
SVG.js — lightweight SVG manipulation & animation library. Zero dependencies, chainable API, full SVG spec coverage. Create/position/animate shapes (rect/cir...
使用说明 (SKILL.md)

SVG.js

Zero-dependency SVG manipulation and animation. npm install @svgdotjs/svg.js or import { SVG } from '@svgdotjs/svg.js'

Use Cases

Use when drawing SVG, animating vector graphics, building data visualizations, creating SVG-based UI components, or manipulating SVG DOM.

Core API

SVG() — entry point for everything: create doc, get from DOM, create from fragment:

const draw = SVG().addTo('body').size(300, 300)  // SVG doc MUST have explicit size()
const rect = SVG('#myRect')                       // get from DOM
const el = SVG('\x3Ccircle>')                        // create from fragment

Chainable — every setter returns this:

draw.rect(100, 100).fill('#f06').stroke({ width: 2, color: '#000' }).move(50, 50)

// .animate() starts animation chain, returns SVG.Runner (NOT the element)
rect.animate(1000).move(200, 200).fill('#0f0')
rect.animate({ duration: 2000, delay: 500, times: 3 }).rotate(45)
// Sequence: rect.animate().fill('#f03').animate().dmove(50, 50)

Quick example:

import { SVG } from '@svgdotjs/svg.js'
const draw = SVG().addTo('body').size(400, 300)
draw.rect(100, 100).fill('#f06').move(50, 50)
draw.circle(50).fill('#0f0').center(200, 150)
draw.text('Hello').font({ family: 'Arial', size: 24 }).move(50, 200)

Progressive References

  • Shapes: rect/circle/ellipse/line/polyline/polygon/path → references/shapes.md
  • Text, images, masks, gradients, patterns → references/text-image.md
  • Positioning, sizing, attr, transforms, tree manipulation → references/manipulating.md
  • Animation, Runner, Timeline, easing, controllers → references/animating.md
  • Containers: groups, nested SVG, defs, symbols, links → references/containers.md
  • Events, custom events, namespaces → references/events.md
  • Import/export, extend, subclass → references/utilities.md
  • Color, Matrix, Point, Box, List, PointArray, PathArray → references/classes.md

Gotchas

  1. SVG doc must have explicit size() — defaults to 0×0 without it
  2. .animate() returns Runner, not element — chain .animate() again for sequencing
  3. Positioning works on ALL elementsrect.cx(50) works though cx isn't native to rect
  4. Groups have no geometry — no x/y/w/h; use nested() for positioned containers
  5. Text needs explicit newlines — SVG has no flowing text; use \ or tspan().newLine()
  6. Path animation needs same command structure — both paths must have identical M/C/S commands
  7. css() ≠ attr()css() sets inline styles, attr() sets SVG attributes
  8. First SVG() call creates invisible parser \x3Csvg> — normal, documented in FAQ
安全使用建议
Safe to install as SVG.js reference material. If you copy its examples into a project, review any normal dependency addition such as installing @svgdotjs/svg.js, but the skill itself does not request special privileges or sensitive access.
能力标签
crypto
能力评估
Purpose & Capability
The artifact coherently provides SVG.js API reference material for drawing, manipulating, and animating SVGs. Metadata includes an odd 'crypto' capability tag, but the artifact text itself contains no crypto, wallet, credential, or financial behavior.
Instruction Scope
Instructions are limited to library usage examples and reference notes; no prompt overrides, role changes, hidden commands, or agent-control instructions were found.
Install Mechanism
The package contains only Markdown documentation files. The only install-related content is a normal example command for adding the public SVG.js npm dependency to a project.
Credentials
No API keys, local session/profile stores, broad filesystem access, network exfiltration, or sensitive data flows are requested.
Persistence & Privilege
No background workers, autostart behavior, privilege escalation, destructive operations, or agent-level persistence are present. The 'runner.persist' mention is SVG.js animation API documentation, not host persistence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install svgjs
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /svgjs 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the svgjs skill. - Provides concise documentation for SVG.js, a lightweight SVG manipulation and animation library. - Covers core API usage, including element creation, chaining, and animation handling. - Lists common use cases such as drawing, animating, and SVG DOM manipulation. - Highlights important usage gotchas and best practices. - Includes references for advanced features and API details.
元数据
Slug svgjs
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

SVG.js — lightweight SVG manipulation & animation library. 是什么?

SVG.js — lightweight SVG manipulation & animation library. Zero dependencies, chainable API, full SVG spec coverage. Create/position/animate shapes (rect/cir... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 37 次。

如何安装 SVG.js — lightweight SVG manipulation & animation library.?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install svgjs」即可一键安装,无需额外配置。

SVG.js — lightweight SVG manipulation & animation library. 是免费的吗?

是的,SVG.js — lightweight SVG manipulation & animation library. 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

SVG.js — lightweight SVG manipulation & animation library. 支持哪些平台?

SVG.js — lightweight SVG manipulation & animation library. 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 SVG.js — lightweight SVG manipulation & animation library.?

由 OpenLark(@openlark)开发并维护,当前版本 v1.0.0。

💬 留言讨论