← 返回
AI智能 中文

Echarts Chart Skill

Generate charts from natural language or tabular data, recommend chart types, and export ECharts-based HTML or SVG. Use when users ask for one-sentence chart...
根据自然语言或表格数据生成图表,推荐图表类型并导出ECharts的HTML或SVG。用于用户请求一句话图表时。
davaded
AI智能 clawhub v0.1.1 1 版本 99849.1 Key: 无需
★ 2
Stars
📥 1,283
下载
💾 69
安装
1
版本
#latest

概述

ECharts Chart Skill

Use this skill when the user wants chart output from a short description or from table-like data.

Workflow

  1. Translate the user's request into a ChartRequest JSON object.
  2. If the chart type is unclear, run the recommendation command first.
  3. Run the generation command to produce a stable ECharts option.
  4. Run the render command when the user wants an embeddable html or svg.

Files

  • Core types: src/types/chart.ts
  • Chart recommendation: src/core/recommend.ts
  • Option generation: src/core/spec-to-option.ts
  • Rendering: src/core/render.ts
  • Sample input: examples/study-progress.request.json
  • Universal metadata: manifest.yaml, agents/openai.yaml

Setup

npm install

Output rules

  • --out writes to an exact file path.
  • --out-dir writes the default file into a directory you choose.
  • desktop and home are valid aliases for --out-dir when the user explicitly asks for those locations.
  • ~ is expanded to the current user's home directory.
  • If no output path is provided, files default to the current working directory.

Commands

node dist/cli/recommend-chart.js --input examples\study-progress.request.json
node dist/cli/generate-chart.js --input examples\study-progress.request.json
node dist/cli/render-chart.js --input option.json --format html
node dist/cli/render-chart.js --input option.json --format svg --out D:\reports\study-chart.svg

Default output filenames:

  • Recommendation: spec.json
  • Option: option.json
  • HTML preview: preview.html
  • SVG preview: preview.svg

ChartRequest shape

{
  "title": "Monthly study completion",
  "dataset": [
    { "day": "2026-03-01", "completionRate": 62, "targetRate": 75 },
    { "day": "2026-03-02", "completionRate": 68, "targetRate": 75 }
  ],
  "goal": "trend",
  "xField": "day",
  "yField": "completionRate",
  "series": [
    { "name": "Completion", "field": "completionRate" },
    { "name": "Target", "field": "targetRate" }
  ]
}

Guidance

  • Prefer deterministic field mapping over free-form inference when the user has already named fields.
  • For pie charts, keep one category field and one metric field.
  • For scatter charts, require numeric xField and yField.
  • If the user only gave natural language, construct the smallest valid ChartRequest before calling scripts.
  • If the user needs a report artifact, render html first and svg second.

版本历史

共 1 个版本

  • v0.1.1 当前
    2026-03-29 12:22 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,836
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,138
ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 418 📥 115,219