V

vega

by @markdown-viewerv
4.5(437)

Vega/Vega-Lite 是一款强大的数据可视化工具,能帮助您通过简洁的 JSON 配置快速生成条形图、折线图、散点图、热力图等各类数据驱动图表。它特别适用于需要对数值数组进行统计分析和复杂可视化(如雷达图、词云)的场景,显著提升数据洞察效率。

data-visualizationchartingvega-litedata-analysisjsonGitHub
安装方式
npx skills add markdown-viewer/skills --skill vega
compare_arrows

Before / After 效果对比

1
使用前

过去,制作复杂的数据图表需要手动在电子表格软件中调整参数,或编写冗长的代码,耗时且容易出错,难以保持图表风格一致性,尤其在处理多系列数据时效率低下。

使用后

使用 Vega/Vega-Lite 后,只需通过结构化的 JSON 配置,就能快速生成专业且高度定制化的数据图表。图表样式统一,修改便捷,大幅缩短了从数据到可视化的时间。

description SKILL.md

Vega / Vega-Lite Visualizer

Quick Start: Structure data as array of objects → Choose mark type (bar/line/point/area/arc/rect) → Map encodings (x, y, color, size) to fields → Set data types (quantitative/nominal/ordinal/temporal) → Wrap in ```vega-lite or ```vega fence. Always include $schema, use valid JSON with double quotes, field names are case-sensitive. Use Vega-Lite for 90% of charts; Vega only for radar, word cloud, force-directed.


Critical Syntax Rules

Rule 1: Always Include Schema

"$schema": "https://vega.github.io/schema/vega-lite/v5.json"

Rule 2: Valid JSON Only

❌ {field: "x",}     → Trailing comma, unquoted key
✅ {"field": "x"}    → Proper JSON

Rule 3: Field Names Must Match Data

❌ "field": "Category"  when data has "category"
✅ "field": "category"  → Case-sensitive match

Rule 4: Type Must Be Valid

✅ quantitative | nominal | ordinal | temporal
❌ numeric | string | date

Common Pitfalls

IssueSolution
Chart not renderingCheck JSON validity, verify $schema
Data not showingField names must match exactly
Wrong chart typeMatch mark to data structure
Colors not visibleCheck color scale contrast
Dual-axis issuesAdd resolve: {scale: {y: "independent"}}

Output Format

```vega-lite
{...}
```

Or for full Vega:

```vega
{...}
```

Related Files

For advanced chart patterns and complex visualizations, refer to references below:

  • examples.md — Stacked bar, grouped bar, multi-series line, area, heatmap, radar (Vega), word cloud (Vega), and interactive chart examples

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量9.3K
评分4.5 / 5.0
版本
更新日期2026年4月29日
对比案例1 组

用户评分

4.5(437)
5
65%
4
25%
3
6%
2
3%
1
1%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年4月12日
最后更新2026年4月29日
🎁 Agent 知识卡片