Agent Skillszebbern/claude-code-guide › data-viz-renderer

data-viz-renderer

GitHub

根据JSON数据生成自包含的HTML/SVG信息图,支持统计卡片、柱状图、流程图和混合仪表盘,内置多种配色与图标。

skills/data-viz-renderer/SKILL.md zebbern/claude-code-guide

Trigger Scenarios

用户请求数据可视化 用户请求制作信息图或图表

Install

npx skills add zebbern/claude-code-guide --skill data-viz-renderer -g -y
More Options

Use without installing

npx skills use zebbern/claude-code-guide@data-viz-renderer

指定 Agent (Claude Code)

npx skills add zebbern/claude-code-guide --skill data-viz-renderer -a claude-code -g -y

安装 repo 全部 skill

npx skills add zebbern/claude-code-guide --all -g -y

预览 repo 内 skill

npx skills add zebbern/claude-code-guide --list

SKILL.md

Frontmatter
{
    "name": "data-viz-renderer",
    "tags": [
        "infographic",
        "visualization",
        "svg",
        "html",
        "chart",
        "dashboard"
    ],
    "type": "tool",
    "license": "MIT",
    "description": "Generate self-contained HTML\/SVG infographics from JSON data, including stat cards, bar charts, flow diagrams, and mixed dashboards. Offers 8 color palettes and built-in icons with no external dependencies. Triggered when users request data visualization, infographics, charts, or dashboards."
}

Data Viz Renderer

Generate self-contained HTML/SVG infographics from JSON data. Four supported types:

  1. Stats Cards — KPI big numbers + trend arrows + icons
  2. Comparison Chart — Grouped bar chart with multiple series
  3. Flow Diagram — Step-by-step process with numbering, icons, and connecting arrows
  4. Dashboard — Mixed layout: stat cards + bar chart + donut chart + flow

Output is a fully self-contained HTML file (all CSS/SVG inline, no external dependencies), ready to open directly in a browser.

Usage

Basic Usage

python3 scripts/build_infographic.py config.json

Also supports reading from stdin:

cat config.json | python3 scripts/build_infographic.py

The script outputs a JSON status to stdout and writes the generated HTML to the path specified in the output field.

JSON Configuration Format

Common fields:

Field Type Required Description
title string No Infographic title
subtitle string No Subtitle
type string Yes stats / comparison / flow / dashboard
palette string No Color palette (default: auto)
data object/array Yes Data content (format depends on type)
output string No Output file path (default: infographic.html)
footer string No Footer text

Color Palettes

Available values: auto (automatically chosen based on data), ocean, sunset, forest, berry, vibrant, corporate, pastel, earth

Data Format by Type

1. stats — Stat Cards

{
  "type": "stats",
  "data": [
    {
      "label": "Total Revenue",
      "value": "$1.2M",
      "icon": "money",
      "trend": "+12.5%",
      "trend_dir": "up"
    },
    {
      "label": "Users",
      "value": "45,230",
      "icon": "users",
      "trend": "+8.2%",
      "trend_dir": "up"
    }
  ]
}

icon options: users, user, money, percent, globe, clock, check, star, target, zap, chart-bar, chart-pie, database, rocket, shield, heart, light, search, mail, settings, flag, trending-up, trending-down

trend_dir: up (green upward arrow) or down (red downward arrow)

2. comparison — Bar Chart Comparison

{
  "type": "comparison",
  "data": {
    "chart_title": "Quarterly Revenue Comparison",
    "categories": ["Q1", "Q2", "Q3", "Q4"],
    "series": [
      {"name": "2024", "values": [320, 410, 380, 520]},
      {"name": "2025", "values": [380, 490, 450, 610]}
    ]
  }
}

3. flow — Flow Diagram

{
  "type": "flow",
  "data": [
    {"step": 1, "title": "Requirements", "description": "Gather user needs", "icon": "search"},
    {"step": 2, "title": "Design", "description": "Create technical plan", "icon": "light"},
    {"step": 3, "title": "Development", "description": "Code and test", "icon": "settings"},
    {"step": 4, "title": "Launch", "description": "Deploy to production", "icon": "rocket"}
  ]
}

4. dashboard — Mixed Dashboard

{
  "type": "dashboard",
  "data": {
    "stats": [
      {"label": "DAU", "value": "12.3K", "icon": "users", "trend": "+5%", "trend_dir": "up"},
      {"label": "Conversion Rate", "value": "3.8%", "icon": "target", "trend": "-0.2%", "trend_dir": "down"}
    ],
    "chart": {
      "chart_title": "Monthly Trend",
      "categories": ["Jan", "Feb", "Mar", "Apr"],
      "series": [{"name": "DAU", "values": [10200, 11500, 11800, 12300]}]
    },
    "breakdown": [
      {"label": "iOS", "value": 45},
      {"label": "Android", "value": 38},
      {"label": "Web", "value": 17}
    ],
    "flow": [
      {"step": 1, "title": "Sign Up", "description": ""},
      {"step": 2, "title": "Activate", "description": ""},
      {"step": 3, "title": "Retain", "description": ""}
    ]
  }
}

Output Format

The script outputs a JSON result to stdout:

{
  "status": "success",
  "output": "/absolute/path/to/infographic.html",
  "type": "stats",
  "title": "My Infographic",
  "palette": "auto",
  "size_bytes": 8432
}

On error:

{
  "status": "error",
  "errors": ["Missing required field: data"]
}

Design Highlights

  • Zero external dependencies: Pure Python standard library, no pip install needed
  • Self-contained output: HTML with all CSS and SVG inline, no network required
  • Responsive layout: Works on both desktop and mobile browsers
  • Professional palettes: 8 preset color schemes + automatic selection
  • 24+ built-in icons: Common SVG icons, no font files needed
  • CJK-friendly: Font stack includes Noto Sans SC, PingFang SC, Microsoft YaHei

Use Cases

  • Visualization modules in data reports
  • Product data dashboards
  • Business process illustrations
  • Quarterly/monthly data comparisons
  • Team KPI displays

Dependencies

  • Python 3.7+ (standard library only)

Version History

  • 1ed99ef Current 2026-07-25 05:52

Same Skill Collection

skills/academic-paper-reviewer/SKILL.md
skills/active-directory-attacks/SKILL.md
skills/api-fuzzing-bug-bounty/SKILL.md
skills/api-shape-explorer/SKILL.md
skills/audit-flow/SKILL.md
skills/authentication-patterns/SKILL.md
skills/aws-penetration-testing/SKILL.md
skills/broken-authentication/SKILL.md
skills/burp-suite-testing/SKILL.md
skills/caching/SKILL.md
skills/chart-image/SKILL.md
skills/cloud-penetration-testing/SKILL.md
skills/code-documenter/SKILL.md
skills/code-to-diagram/SKILL.md
skills/composition-patterns/SKILL.md
skills/cross-examine/SKILL.md
skills/cv-tailor/SKILL.md
skills/database-optimizer/SKILL.md
skills/database-scout/SKILL.md
skills/dataset-quality-audit/SKILL.md
skills/deep-module-refactor/SKILL.md
skills/design-system-builder/SKILL.md
skills/dev-guide-generator/SKILL.md
skills/ethical-hacking-methodology/SKILL.md
skills/file-path-traversal/SKILL.md
skills/html-injection-testing/SKILL.md
skills/http-load-profiler/SKILL.md
skills/idor-testing/SKILL.md
skills/linux-privilege-escalation/SKILL.md
skills/linux-shell-scripting/SKILL.md
skills/localization-toolkit/SKILL.md
skills/log-error-digest/SKILL.md
skills/metasploit-framework/SKILL.md
skills/network-101/SKILL.md
skills/nextjs-developer/SKILL.md
skills/pdf/SKILL.md
skills/pentest-checklist/SKILL.md
skills/pentest-commands/SKILL.md
skills/pipeline-blueprint/SKILL.md
skills/playwright/ci/SKILL.md
skills/playwright/core/SKILL.md
skills/playwright/migration/SKILL.md
skills/playwright/playwright-cli/SKILL.md
skills/playwright/pom/SKILL.md
skills/playwright/SKILL.md
skills/privilege-escalation-methods/SKILL.md
skills/project-sizing-guide/SKILL.md
skills/r2-upload/SKILL.md
skills/r3f-animation/SKILL.md

Metadata

Files
0
Version
90de986
Hash
94f01a27
Indexed
2026-07-25 05:52

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 07:15
浙ICP备14020137号-1 $mapa de visitantes$