Commit 0815882
committed
feat: add gallery examples registry mapping examples to datasets
Adds cross-ecosystem registry cataloging ~470 examples from Vega, Vega-Lite,
and Altair galleries, tracking which datasets each example uses.
New files:
- _data/gallery_examples.toml: Configuration (URLs, Altair name mappings)
- scripts/generate_gallery_examples.py: Generator (2,289 lines, fully typed)
- gallery_examples.json: Generated output (~470 examples)
When joined with datapackage.json, enables:
- Dataset-first learning (find all examples using specific dataset)
- Curation analytics (dataset coverage matrices, gap analysis)
- High-quality training data for visualization AI/ML systems
Examples are curated by the Vega community to demonstrate essential
visualization techniques and design patterns.
Implementation details:
- Handles different spec formats per framework (Vega, Vega-Lite, Altair)
- Normalizes all references to canonical datapackage.json names
- Altair deduplication: Uses method-based syntax (preferred as of Altair 5)
when examples exist in both syntax directories (116 cases)
- Temporary name mappings for Altair API (3 mappings, will be removed after
Altair PR #3859 lands)
- Comprehensive type safety with TypedDict, Protocols, semantic type aliases
- Protocol-based validation infrastructure for extensibility
Runtime: ~15 seconds to collect all examples
Quality: All checks pass (taplo, ruff, pyright, npm build)1 parent 552ecc5 commit 0815882
File tree
3 files changed
+8759
-0
lines changed- _data
- scripts
3 files changed
+8759
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
0 commit comments