Chart preview extension using staging server#5673
Open
Conversation
Contributor
|
Quick links (staging server):
Login: chart-diff: ❌
data-diff: ✅ No differences foundAutomatically updated datasets matching excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included Edited: 2026-02-23 11:05:22 UTC |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nder_chart.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
493f715 to
f3e5221
Compare
In watch mode, etlr doesn't print "All datasets up to date!" — it just outputs "OK" after dirty detection and waits. Use a 500ms timer after detection OK to trigger reload, cancelled if "--- Running" arrives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # dag/main.yml # etl/command.py
- Read slug from YAML instead of deriving from filename
- Build full catalogPath with version for mdim charts
- Use /admin/grapher/{encodedCatalogPath} URL for mdim
- Load mdim charts via direct iframe src (not embed script)
- Add vscode-extension-dev skill for build/install workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New `chart-preview.dataset` command (cmd+shift+v) shows indicator cards with per-indicator metadata, stats, sparklines, and quality flags - Per-indicator cards: title, unit, dtype, null%, min/max/mean, sparklines (numeric) or top-10 value distribution (string columns) - Sparklines show per-entity time series (up to 50 entities, 200 points) - Quality flags: missing title, unit, description, origins - Tracks in-flight Python processes; kills on panel close/new run/deactivate - 10-minute timeout on preview script - Caps indicators at 200 for wide datasets (e.g. WDI ~1500 cols) - Uses PREFER_DOWNLOAD=1 and STAGING=1 env vars on watch processes - Friendly error/retry UI when dataset not yet built Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- etl/command.py: print '--- Dataset rebuild complete' sentinel after every successful watch cycle so the extension has a reliable trigger - Extension: replace fragile stdout parsing + filesystem polling with single sentinel line detection; handles any number of upstream deps - Unify cmd+alt+p keybinding for both chart and dataset preview, dispatching based on file type (.chart.yml vs steps/data/*.py) - Fix random entity selection using crypto.getRandomValues() - Fix feather file path (dataset_path/table.feather not subdir) - Use pyarrow column projection for fast feather reads (WDI: 67s→1.3s) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused existsSync import - Remove redundant args/command aliases in startWatchProcess - Use crypto.getRandomValues consistently in randomizeEntity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Restore `command` variable in startWatchProcess (was lost in cleanup, caused "command is not defined" for multidim previews) - Reset recentOutput at start of each new detecting cycle so errors from previous cycles don't bleed into subsequent runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Show a small ★ score next to the type chip for indicators with non-zero popularity from analytics_popularity. Also fix popularity key to include namespace (namespace/dataset/table#col) so it correctly matches across dataset versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move `import rdata` inside each function body so it's only required when actually reading R data files, not at module load time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Some parts of this were already merged, but we need to wait for the support of chart configs. Then we should rebase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We manage chart configurations through two systems: the Admin UI and, more recently, YAML-based
.chart.ymlfiles in ETL (graph steps). This PR builds the infrastructure for graph steps — a new ETL pipeline channel that lets you define charts as code, push them to the database, and preview them live.It also ships a VSCode extension with a live preview panel, enabling fast iteration on chart configs — both for humans and for agentic workflows where an LLM edits chart YAML with visual feedback in the loop.
What's in here
graph://pipeline channel — new DAG channel with--graphflag;.chart.ymlfiles define chart configs (single charts or multi-dimensional collections)--graph-pushoverwrites Admin UI edits,--graph-pullsyncs DB changes back to YAML, with conflict detection when both sides have been editedfur_farming_statusthat auto-expand to full catalog paths using DAG dependencies (no hardcoded versions)chart-previewVSCode extension — live preview panel that hot-reloads on save, supports regular charts, mdim graph steps, and export/multidim stepsexport://multidim/steps (.config.ymland.pyfiles), running them with--export --watchWorkflow demo
1. Install the extension and build upstream data
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. Preview export/multidim steps
The extension also works with the older Python-based multidim steps. Open
etl/steps/export/multidim/war/latest/ucdp.pyorucdp.config.ymland click preview — it runsetlr --export --watchand shows the mdim chart from staging.4. Let Claude Code edit charts for you
Start Claude Code in the repo and use the
/chart-editingskill:Claude reads the schema, edits the YAML, and iterates. The VSCode preview panel hot-reloads on every save.
Graph step examples
Simple chart (
fur-farming-ban.chart.yml):Mdim collection (
covid-cases.chart.yml):Limitations
This is a prototype. Not yet supported:
{definitions.description})🤖 Generated with Claude Code