vega
Vega/Vega-Liteは、簡潔なJSON設定を通じて、棒グラフ、折れ線グラフ、散布図、ヒートマップなど、様々なデータ駆動型チャートを迅速に生成できる強力なデータ視覚化ツールです。数値データ配列の統計分析や、レーダーチャート、ワードクラウドのような複雑な視覚化に最適で、データ洞察の効率を大幅に向上させます。
npx skills add markdown-viewer/skills --skill vegaBefore / 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
| Issue | Solution |
|---|---|
| Chart not rendering | Check JSON validity, verify $schema |
| Data not showing | Field names must match exactly |
| Wrong chart type | Match mark to data structure |
| Colors not visible | Check color scale contrast |
| Dual-axis issues | Add 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)
レビューを書く
レビューなし
統計データ
ユーザー評価
この Skill を評価