charting-vega-lite
БесплатноЗапускает вложенные скриптыНе проверенCreate interactive data visualizations using Vega-Lite declarative JSON grammar. Supports 20+ chart types (bar, line, scatter, histogram, boxplot…
Об этом скилле
Overview
This skill creates interactive Vega-Lite visualizations from uploaded data. The workflow:
- Analyze data structure and context
- Select 5-10 meaningful chart types based on what the data represents
- Build chart specifications programmatically
- Generate React artifact with embedded visualizations
Critical Technical Constraint: Inline Data Island
Claude artifacts cannot use fetch() for computer:// URLs.
All data must be embedded as an inline JavaScript constant:
const DATA = [ /* embedded data array */ ];
// Later in chart specs:
spec.data = { values: DATA };
DO NOT:
- Use fetch() to load external files
- Reference external data URLs
- Create separate data files
This is the only pattern that works in Claude's artifact environment.
Primary Workflow: Data Upload → Chart Explorer
Execute this sequence when user uploads data without specifying chart type:
1. Analyze Data Structure
python /mnt/skills/user/charting-vega-lite/scripts/analyze_data.py /mnt/user-data/uploads/<filename>
Extract from output:
fields[](with types and statistics)suggested_charts[](suggested chart types with encodings)sample_data(first 10 rows for understanding context)
If script fails: Use manual pandas analysis
import pandas as pd
df = pd.read_csv('/mnt/user-data/uploads/<filename>')
# Classify: numeric→quantitative, datetime→temporal, <20 unique→nominal
2. Understand Data Context
Read sample data and column names to infer what the data represents:
- Biomedical data? → Biomarkers, patient outcomes, clinical relevance
- Financial data? → Trends, comparisons, performance metrics
- Sensor data? → Temporal patterns, anomalies, correlations
- E-commerce? → Sales trends, product comparisons, conversions
Ask: What questions would someone analyzing this data want answered?
Examples:
- Assay data: Which biomarkers strongest? Patterns across samples? Variability?
- Financial: What are trends? How volatile? Seasonal patterns?
- IoT: Temporal patterns? Anomalies? Sensor correlations?
3. Select Meaningful Charts (5-10 suggestions)
Filter analyze_data.py suggestions based on context and readability:
Apply readability filters:
- Pie chart with >7 categories → Skip (unreadable)
- Heatmap with >50 categories per axis → Aggregate first
- Multi-line with >10 series → Consider faceting
Prioritize charts that answer domain questions:
- Comparison needs → Bar, box plot, grouped bar
- Distribution analysis → Histogram, box plot
- Pattern recognition → Heatmap, scatter
- Temporal trends → Line, area
- Part-to-whole → Stacked bar (pie only if <7 categories)
Don't suggest charts just because data types match - choose charts that reveal insights.
4. Generate Chart Specs
Build specs programmatically using analyze_data.py encodings:
For each suggested chart type, construct spec using:
- Templates from
assets/templates/for basic types (bar, line, scatter, pie, heatmap, area) - Builder patterns from
references/spec-builder-patterns.mdfor variations (histogram, boxplot, grouped-bar, etc.) - Vega-Lite examples from
references/vega-lite-examples-inventory.mdfor uncommon types
Structure each chart as:
{"type": "Chart Name", "reason": "Why this chart", "spec": {/* vega-lite spec */}}
5. Create Artifact with Inline Data Island
Load data, read template, replace __DATA__ and __CHART_SPECS__ placeholders, write using bash heredoc.
6. Provide Link
[View chart explorer](computer:///mnt/user-data/outputs/ChartExplorer.jsx)
Created 7 contextually relevant charts for your data.
Secondary Workflow: Specific Chart Request
When user specifies chart type (e.g., "make a bar chart"):
1. Analyze Data
python /mnt/skills/user/charting-vega-lite/scripts/analyze_data.py /mnt/user-data/uploads/<filename>
2. Validate Chart Fits Data
Check requirements:
- Bar: needs 1 nominal + 1 quantitative
- Line: needs 1 temporal + 1 quantitative
- Scatter: needs 2 quantitative
- Heatmap: needs 2 nominal + 1 quantitative
- Pie: needs 1 nominal + 1 quantitative + <7 categories
If data doesn't fit:
- Explain: "Bar chart needs categorical data, but all columns are numeric"
- Suggest 2-3 alternatives
- Use Primary Workflow to create explorer with alternatives
3. Generate Spec
Use templates or programmatic builders based on chart type complexity.
4. Create Artifact
Same pattern as Primary Workflow step 5, but with single chart.
Error Prevention
Common failures:
Using fetch() in artifacts
- Solution: Always use inline data island pattern
- Never create external data files
Chart doesn't render
- Verify scripts load: Vega → Vega-Lite → Vega-Embed
- Check data is injected:
spec.data = {values: DATA} - Confirm field names match data columns
Generic/random chart suggestions
- Solution: C
Установить charting-vega-lite в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл charting-vega-lite?
Create interactive data visualizations using Vega-Lite declarative JSON grammar. Supports 20+ chart types (bar, line, scatter, histogram, boxplot, grouped/stacked variations, etc.) via templates and programmatic builders. Use when users upload data for charting, request specific chart types, or mention visualizations. Produces portable JSON specs with inline data islands that work in Claude artifacts and can be adapted for production.
Как установить скилл charting-vega-lite?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл charting-vega-lite запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic