Files
superset2/superset-frontend/plugins/plugin-chart-country-map/README.md
Evan Rusackas 9fd7fd441a fix(country-map): CI failures — license headers, lockfile sync, reproducible build
Three coordinated fixes for the 25 CI failures on the initial PR push:

1. **Lockfile sync.** Added @superset-ui/plugin-chart-country-map as
   a workspace dep in the previous commit but didn't update
   package-lock.json. CI's `npm ci` failed across frontend-build,
   cypress (12 jobs), playwright (4 jobs), docker (2 jobs), and
   frontend-check-translations. Re-ran `npm install --package-lock-only`
   to add the new workspace's 71 lock entries.

2. **License headers added** to 13 new files flagged by License Check:
   - 5 markdown READMEs / SIP_DRAFT (HTML-comment headers)
   - 5 YAML config files (`# Licensed ...`)
   - 2 Python files (`# Licensed ...`)
   - 1 shell script (preserves shebang)

3. **Reproducible build outputs.** The regen workflow detected drift
   on manifest.json + ukr_admin1_CAN.geo.json. Two root causes:
   - `build_timestamp_utc` field made manifest non-deterministic →
     dropped from the schema
   - Floating mapshaper version (`npx --yes mapshaper`) caused subtle
     simplification differences across runners → pinned to
     `mapshaper@0.7.15` via `npx --yes mapshaper@<version>`

Verified locally: rebuild from clean cache reproduces every output
byte-identically except the manifest (which now also matches once
the timestamp is gone).

Files changed:
  .gitignore                           — re-include rule for static dir
  superset-frontend/package-lock.json  — +71 lines for new workspace
  13 new files                         — ASF headers
  build.py                             — pin mapshaper, drop timestamp
  manifest.json (× 2)                  — regenerate w/o timestamp
  README.md (in static dir)            — header

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 22:32:51 -07:00

62 lines
2.9 KiB
Markdown

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# `@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