Files
superset2/superset-frontend/plugins/plugin-chart-country-map
Evan Rusackas 1817e37b06 feat(country-map): wire build outputs to Flask static path + commit them
Move build pipeline outputs from a sibling `output/` directory into
Superset's Flask-served `superset/static/assets/country-maps/` so the
plugin can fetch them at runtime without webpack involvement (Flask
serves the tree at `/static/...` directly).

Commit the 220 generated GeoJSONs + manifest.json so a fresh
ephemeral environment can render the chart immediately, no build
step required at deploy time. Trade-off: ~17 MB of generated files
in-tree. (For comparison the legacy plugin commits ~34 MB of
GeoJSON; net change is -17 MB once we remove the legacy plugin in a
future major version.)

Files committed:
  superset/static/assets/country-maps/
    README.md                                         (humans, not data)
    manifest.json
    ukr_admin0.geo.json                          2.1 MB
    ukr_admin1_<adm0_a3>.geo.json    × 214      ~50 KB - 662 KB each
    regional_<country>_<set>_ukr.geo.json × 4   ~30 KB each
    composite_france_overseas_ukr.geo.json       322 KB

Build script changes:
- OUTPUT_DIR computed via SCRIPT_DIR.parents[3] / "superset" /
  "static" / "assets" / "country-maps"
- mkdir(parents=True) so a fresh checkout works first run
- Stale `output/` entry kept in scripts/.gitignore for safety
  (some local checkouts may have it from earlier iterations)

.gitignore: add re-include lines so superset/static/assets/country-maps/**
gets committed despite the broader superset/static/* exclusion.

SIP_DRAFT updated with the hosting-decision rationale.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 17:26:39 -07:00
..

@superset-ui/plugin-chart-country-map

Modern country/region choropleth chart for Apache Superset. Replaces legacy-plugin-chart-country-map.

Status

🚧 Work in progress — see SIP_DRAFT.md in this directory for the full design rationale and implementation phases. This plugin lives in the same PR as the build pipeline that produces its data; both are currently scaffolded and being progressively fleshed out.

What it offers vs. the legacy plugin

Legacy New
Backend endpoint explore_json chart/data (modern)
Disputed-region handling Hardcoded NE editorial Configurable per-deployment + per-chart worldview (NE _ukr default)
Subdivisions level Country-only Country (Admin 0) and Subdivisions (Admin 1) and Aggregated regions
Data pipeline Jupyter notebook Reproducible script + YAML configs (see scripts/)
Per-deployment customization Fork required superset_config.COUNTRY_MAP block + chart-level controls
Composite maps (e.g. France-with-Overseas) Hardcoded in notebook Declarative in composite_maps.yaml
Regional aggregations (NUTS-1 etc.) Hardcoded Declarative in regional_aggregations.yaml

Layout

src/
  index.ts          — package entry; exports CountryMapChartPlugin and types
  types.ts          — TypeScript types for form data + transform props
  CountryMap.tsx    — React component; renders the SVG chart
  plugin/
    index.ts        — ChartPlugin class with metadata
    buildQuery.ts   — modern chart/data query builder
    controlPanel.tsx— form controls (worldview, admin level, country, ...)
    transformProps.ts — form_data → renderer props
scripts/            — build pipeline (NE shapefile → simplified GeoJSON outputs)
SIP_DRAFT.md        — design draft for the eventual SIP issue

See also

  • SIP_DRAFT.md — design rationale, audit of legacy notebook, obsolescence findings, open questions
  • scripts/README.md — build pipeline operating principles
  • scripts/config/*.yaml — declarative transform configs (5 schemas for the 5 transform categories)
  • scripts/procedural/README.md — escape hatch for edge cases YAML can't express