Skip to content

Chart editing from VSCode#5667

Closed
Marigold wants to merge 3 commits intowip-prototype-graph-metadatafrom
chart-preview-extension
Closed

Chart editing from VSCode#5667
Marigold wants to merge 3 commits intowip-prototype-graph-metadatafrom
chart-preview-extension

Conversation

@Marigold
Copy link
Copy Markdown
Collaborator

@Marigold Marigold commented Feb 12, 2026

Motivation

We currently edit chart configs through the Admin UI, which works well. But if we go the route of having YAML-based chart configs in ETL (the graph step prototype), we'd want a nice editing experience for those too — schema validation, autocomplete, and quick preview without needing a staging deploy.

This PR builds that tooling. More interestingly, it also enables agentic workflows: you can ask an LLM to work on chart configs, iterate on them, and explore meaningful ways to represent your data — all with visual feedback in the loop.

What's in here

  • .chart.yml rename — chart configs renamed from .meta.yml to .chart.yml so VSCode can associate them with the grapher JSON schema for validation and autocomplete
  • schemas/chart-schema.json — generated from the upstream grapher schema, plus a script to regenerate it
  • scripts/render_chart.py — renders a .chart.yml to standalone HTML (or PNG via --png for headless/AI use)
  • chart-preview VSCode extension — live preview panel that hot-reloads on save
  • chart-editing Claude Code skill — teaches Claude how to edit chart configs and verify results visually
  • Dataset.read(columns=...) parameter — faster reads for wide tables (used by the render script)

Workflow demo

1. Install the extension and build upstream data

make vsce-compile EXT=chart-preview INSTALL=1
.venv/bin/etlr grapher/animal_welfare/2025-01-07/fur_laws --private

Reload VSCode (Cmd+Shift+P → "Reload Window").

2. Open a chart with live preview

Open etl/steps/graph/animal_welfare/latest/fur-farming-ban.chart.yml. Click the preview icon in the editor title bar — an interactive Grapher chart appears in a side panel. Edit the YAML, save, and the preview refreshes automatically.

3. Let Claude Code edit charts for you

Start Claude Code in the repo and ask it to make changes:

> /chart-editing
> Change the color of "Banned" to dark red and add a subtitle explaining what fur farming bans mean

Claude reads the schema, edits the YAML, renders a PNG to verify, and iterates. The VSCode preview panel hot-reloads on every save, so you see changes live as Claude works.

Limitations

This is a prototype — only works on etl/steps/graph/animal_welfare/latest examples. Not yet supported:

  • Inheritance from variable metadata
  • Dynamic placeholders in chart YAMLs (e.g. {definitions.description})
  • Multidimensional indicator configs

All could be added. The render script could also be made faster with a persistent Python process (~0.8s startup overhead per render currently).

🤖 Generated with Claude Code

- Rename .meta.yml to .chart.yml for VSCode schema linting
- Add chart-schema.json + generation script
- Add render_chart.py to preview charts as HTML
- Add chart-preview VSCode extension with live reload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@owidbot
Copy link
Copy Markdown
Contributor

owidbot commented Feb 12, 2026

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-chart-preview-extension

chart-diff: ❌
  • 0/2 reviewed charts
  • Modified: 0/2
  • New: 0/0
  • Rejected: 0
  • Data changes: 0
  • Metadata changes: 0
data-diff: ✅ No differences found

Automatically updated datasets matching excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included

Edited: 2026-02-13 12:46:30 UTC
Execution time: 5.24 seconds

Marigold and others added 2 commits February 12, 2026 14:29
…t.read

- Update all references from .meta.yml to .chart.yml for graph steps
- Add PathFinder.chart_path property for graph steps
- Add columns parameter to Dataset.read/Table.read_feather/Table.read_parquet
  for faster reads of wide tables
- Update docstrings and help text throughout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add chart-editing Claude Code skill for editing .chart.yml files
- Add --png export to render_chart.py using playwright
- Add playwright dev dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Marigold
Copy link
Copy Markdown
Collaborator Author

Some parts of this were already merged, but we need to wait for the support of chart configs. Then we should rebase.

@github-actions
Copy link
Copy Markdown

This PR has had no activity within the last 30 days. It is considered stale and will be closed in 7 days if no further activity is detected.

@github-actions github-actions Bot added the stale label Mar 27, 2026
@github-actions github-actions Bot closed this Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants