mcpField
V
vega

vega

github.com/markdown-viewerData & databases3.4k3.1k installsUpdated 3w ago
Repository

About vega

A skill for creating Vega and Vega-Lite chart specifications. It guides users through choosing marks, mapping data fields, and producing valid fenced JSON for visualization.

Key features

  1. 01Guidance for Vega-Lite and Vega charts
  2. 02Mark and encoding selection
  3. 03Data type mapping
  4. 04Schema and JSON validation rules
  5. 05Examples for advanced chart patterns

Use cases

  1. 01Building bar, line, and area charts
  2. 02Creating radar charts or word clouds
  3. 03Checking chart specifications for common syntax errors

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/markdown-viewer/skills --skill vega

After installing, type/vegain Claude Code to confirm it loaded.

Bundled filesreferences/examples.md

Details

From the project README

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

Comments

Markdown supported