← Back to Skills Marketplace
todd-9527

Info Visualize

by TODD-9527 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
266
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install info-visualize
Description
信息可视化技能,将结构化数据渲染为深色主题的高质量图表和长图报告。 支持两类输出:第一类是零依赖 SVG/HTML 交互式横向条形图,直接在浏览器打开; 第二类是基于 Pillow 的 PNG 长图报告,含标题区、KPI 卡片、文字段落、表格、 条形图、卡片组、时间线、页脚等模块,适合监控报告、日报、排行榜等场景...
README (SKILL.md)

\r \r

info-visualize\r

\r 将数据渲染为专业深色主题图表和长图报告的通用技能。\r \r

核心脚本\r

\r 两个脚本均位于 scripts/ 目录,按需选择:\r \r | 脚本 | 输出格式 | 适用场景 | 依赖 |\r |------|---------|---------|------|\r | svg_bar_chart.py | SVG + HTML | 排行榜、对比图、任意条形图 | 无(纯标准库) |\r | png_longform.py | PNG 长图 | 日报/周报、监控报告、综合信息图 | pip install Pillow |\r \r

工作流\r

\r

1. SVG 横向条形图\r

\r 数据准备 — 将数据整理为标准 JSON:\r \r

{\r
  "title": "A股涨幅 TOP 20",\r
  "subtitle": "2026-03-14  |  全市场 5481 只股票",\r
  "footer": "数据来源: Tushare Pro",\r
  "value_suffix": "%",\r
  "kpis": [\r
    {"label": "榜首涨幅", "value": "+20.01%"},\r
    {"label": "涨停个股", "value": "18"},\r
    {"label": "合计成交额", "value": "342.5 亿"}\r
  ],\r
  "items": [\r
    {"label": "中红医疗", "value": 20.01, "tag": "医疗保健", "extra": "300981.SZ"},\r
    {"label": "通裕重工", "value": 19.94, "tag": "工程机械", "extra": "300185.SZ"}\r
  ]\r
}\r
```\r
\r
**调用方式**(命令行):\r
```bash\r
python scripts/svg_bar_chart.py --input data.json --output chart.html --value-suffix %\r
```\r
\r
**调用方式**(Python 导入):\r
```python\r
from scripts.svg_bar_chart import build_svg_chart\r
items = [{"label": "标签", "value": 数字, "tag": "分类"}, ...]\r
config = {"title": "...", "subtitle": "...", "kpis": [...], "value_suffix": "%"}\r
svg_str, html_str = build_svg_chart(items, config)\r
with open("chart.html", "w", encoding="utf-8") as f:\r
    f.write(html_str)\r
```\r
\r
**关键配置项**:\r
- `show_reference_line`: 在指定值处绘制垂直参考线(如涨停线10%)\r
- `reference_label`: 参考线标签\r
- `max_value_override`: 手动指定 X 轴最大值\r
- `bar_threshold_colors`: 按阈值分色,格式 `[(20, "#FF2244"), (10, "#FFAA00")]`\r
\r
### 2. PNG 长图报告\r
\r
**数据结构**:\r
```json\r
{\r
  "title": "报告标题",\r
  "subtitle": "2026-03-14 20:00 更新",\r
  "status_tag": {"text": "CRITICAL", "level": "critical"},\r
  "kpis": [\r
    {"label": "布伦特原油", "value": "$103/桶"},\r
    {"label": "风险等级", "value": "CRITICAL"},\r
    {"label": "海峡通行", "value": "2艘/日"}\r
  ],\r
  "sections": [\r
    {\r
      "type": "text",\r
      "title": "态势综述",\r
      "content": "当前局势摘要...\
第二段..."\r
    },\r
    {\r
      "type": "table",\r
      "title": "关键指标",\r
      "headers": ["指标", "当前值", "变化"],\r
      "rows": [["布伦特", "$103", "+21%"]]\r
    },\r
    {\r
      "type": "bar",\r
      "title": "各国影响",\r
      "value_suffix": "%",\r
      "items": [{"label": "中国", "value": 35}, {"label": "日本", "value": 25}]\r
    },\r
    {\r
      "type": "cards",\r
      "title": "风险要素",\r
      "items": [\r
        {"title": "封锁风险", "content": "说明文字", "level": "critical"},\r
        {"title": "储备缓冲", "content": "说明文字", "level": "warning"}\r
      ]\r
    },\r
    {\r
      "type": "timeline",\r
      "title": "近期事件",\r
      "events": [\r
        {"date": "2026-02-28", "text": "美以联合空袭伊朗"},\r
        {"date": "2026-03-01", "text": "海峡通行量骤降97%"}\r
      ]\r
    }\r
  ],\r
  "footer": "数据来源: Jane's / EIA / 新浪财经",\r
  "next_update": "下次更新: 明日 20:00"\r
}\r
```\r
\r
**调用方式**(命令行):\r
```bash\r
python scripts/png_longform.py --input report.json --output report.png\r
# 同时归档到指定目录:\r
python scripts/png_longform.py --input report.json --output report.png --archive "C:/Users/user/.ai-memory/news"\r
```\r
\r
**调用方式**(Python 导入):\r
```python\r
from scripts.png_longform import render_from_json, LongformRenderer\r
import json\r
\r
with open("report.json") as f:\r
    data = json.load(f)\r
render_from_json(data, "report.png")\r
```\r
\r
**section type 参考**:\r
- `text`:纯文字段落,支持 `\
` 换行\r
- `table`:表格,需 `headers`(列名列表)+ `rows`(二维列表)\r
- `bar`:横向条形图,需 `items`(`[{label, value, color?}]`)\r
- `cards`:双列卡片组,`level` 可选 `normal/warning/critical/info`\r
- `timeline`:时间线,需 `events`(`[{date, text}]`)\r
\r
## 设计规范(深色主题)\r
\r
所有输出遵循统一视觉规范,与用户已有报告风格完全一致:\r
\r
- **画布宽度**:900px\r
- **背景色**:深海军蓝 `#0E1624`\r
- **强调色**:青绿 `#2EC4B6`(标题、圆点、边框)\r
- **数字色**:金黄 `#FFC83C`(KPI 大数字)\r
- **状态色**:红 `#E65050`(critical)/ 橙 `#FF8C28`(warning)/ 绿 `#3CC878`(normal)\r
- **字体**:微软雅黑 `msyhbd.ttc`(标题)+ `msyh.ttc`(正文)\r
- **顶部**:3px 青绿色分割线 + 深色 Header\r
- **底部**:报告时间 + WorkBuddy 水印\r
\r
## 输出路径惯例\r
\r
- 当前项目目录:`./chart.html` / `./report.png`\r
- 若用户有归档需求(如自动化任务):额外复制到 `C:\Users\ToddC\.ai-memory\
ews\`\r
\r
## 常见问题\r
\r
**Q: SVG 在浏览器里空白?**  \r
A: 确保 HTML 中 SVG 已直接内嵌(inline SVG),不要使用 `\x3Cimg src="chart.svg">`,后者在某些浏览器会有 CORS 限制。`svg_bar_chart.py` 默认输出 inline HTML,直接双击打开即可。\r
\r
**Q: PNG 中文乱码?**  \r
A: 脚本自动按优先顺序搜索 `msyhbd.ttc → msyh.ttc → simhei.ttf → simsun.ttc`,Windows 系统通常自带。若仍乱码,确认 `C:\Windows\Fonts\msyh.ttc` 存在。\r
\r
**Q: 如何调整条形图颜色?**  \r
A: 在 `items` 中为每项添加 `"color": "#FF5533"`;或在 config 中设置 `bar_threshold_colors`。\r
Usage Guidance
This skill appears to do what it says (render SVG or PNG reports). Before installing or using it: 1) Note PNG rendering requires Pillow—use a virtualenv or test install in an isolated environment. 2) The code prefers Windows fonts under C:\Windows\Fonts; on Linux/macOS you may need to install or point it to appropriate TTF files. 3) Archiving/copying behavior is opt-in (via CLI flag); review the path you pass to --archive to avoid writing outputs into sensitive directories. 4) There are some minor code issues (e.g., an internal function references math without a top-level import) which may cause runtime errors in some paths—test with sample JSON before automating. 5) No network calls or secret exfiltration were found, but as with any code from an unknown source, review the scripts yourself if you need higher assurance.
Capability Analysis
Type: OpenClaw Skill Name: info-visualize Version: 1.0.1 The skill bundle provides legitimate tools for data visualization, rendering structured JSON data into dark-themed SVG/HTML charts and PNG long-form reports. The Python scripts (png_longform.py and svg_bar_chart.py) use standard libraries like Pillow to perform image processing and do not contain any network calls, obfuscated code, or unauthorized file access. While the documentation (SKILL.md) mentions a specific local archive path (C:\Users\ToddC\.ai-memory\news\), this appears to be a configuration convention for the intended environment rather than a malicious indicator.
Capability Assessment
Purpose & Capability
Name/description (render SVG and PNG long-form reports) lines up with the provided scripts and SKILL.md. The PNG renderer depends on Pillow (documented); the SVG script uses only the standard library. No unrelated credentials, binaries, or services are requested.
Instruction Scope
SKILL.md and the scripts stay within the stated purpose: they load JSON data, render SVG/HTML or PNG images, and optionally copy outputs to an archive folder. The README suggests copying to paths like a user .ai-memory folder as an example; the archive behavior is opt-in via a CLI flag rather than automatic. The skill does reference local font files (C:/Windows/Fonts) and includes a WorkBuddy watermark in outputs (intentional branding).
Install Mechanism
No install spec (instruction-only) and no network downloads in code. The only runtime dependency is Pillow for PNG output (documented). This is a low-risk install profile.
Credentials
The skill requests no environment variables or credentials. It accesses local filesystem paths for fonts and accepts an optional archive path provided by the user. Those filesystem accesses are proportionate to producing output images.
Persistence & Privilege
always:false and no mechanism to register or persist itself into the agent environment. The skill does not modify other skills or global agent configs; archive/copy is an explicit, user-specified action.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install info-visualize
  3. After installation, invoke the skill by name or use /info-visualize
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Initial release: SVG bar chart & PNG long-form report generation
v1.0.0
Initial release: SVG bar chart & PNG long-form report generation
Metadata
Slug info-visualize
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Info Visualize?

信息可视化技能,将结构化数据渲染为深色主题的高质量图表和长图报告。 支持两类输出:第一类是零依赖 SVG/HTML 交互式横向条形图,直接在浏览器打开; 第二类是基于 Pillow 的 PNG 长图报告,含标题区、KPI 卡片、文字段落、表格、 条形图、卡片组、时间线、页脚等模块,适合监控报告、日报、排行榜等场景... It is an AI Agent Skill for Claude Code / OpenClaw, with 266 downloads so far.

How do I install Info Visualize?

Run "/install info-visualize" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Info Visualize free?

Yes, Info Visualize is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Info Visualize support?

Info Visualize is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Info Visualize?

It is built and maintained by TODD-9527 (@todd-9527); the current version is v1.0.1.

💬 Comments