mirror of
https://github.com/apache/superset.git
synced 2026-05-28 11:15:24 +00:00
Bootstrap the new @superset-ui/plugin-chart-country-map package with
the modern ChartPlugin pattern. Mirrors plugin-chart-handlebars'
structure (the leanest existing modern plugin in the repo).
Files:
package.json — workspace pkg with d3-* deps
tsconfig.json — extends frontend root tsconfig,
references core/chart-controls
types/external.d.ts — ambient types for png/jpg/geojson
README.md — what this plugin is + status
src/
index.ts — package entry
types.ts — CountryMapFormData + transform props
CountryMap.tsx — placeholder renderer (real D3 port
in a follow-up commit)
plugin/
index.ts — ChartPlugin class with metadata
buildQuery.ts — modern chart/data query (this is
the core difference from the legacy
plugin's explore_json path)
controlPanel.tsx — minimal placeholder; full control
set (worldview / admin level /
country / region include-exclude /
fly-islands / language) ports next
transformProps.ts — derives geoJsonUrl from form_data
using the build-script's output
naming convention
Renderer scaffold fetches the resolved GeoJSON URL and shows a small
diagnostic block (URL + feature count + data row count + metric name)
so the plugin compiles end-to-end and can be wired to the chart-type
registry without a real D3 render. Real renderer + controls land in
the next commits.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
2.2 KiB
Markdown
43 lines
2.2 KiB
Markdown
# `@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
|