Skip to content

feat(country-map): redesign with worldview selection, Admin 0/1 support [SIP draft] - #40078

Draft
rusackas wants to merge 2 commits into
masterfrom
feat/plugin-chart-country-map-rework
Draft

rusackas wants to merge 2 commits into
masterfrom
feat/plugin-chart-country-map-rework

Conversation

@rusackas

Copy link
Copy Markdown
Member

Status: DRAFT — SIP scratchpad

This PR is the working POC for a Country Map plugin redesign. It will eventually be referenced by a SIP (filed once the design is more concrete and the POC compiles end-to-end).

What's in this commit

  • superset-frontend/plugins/plugin-chart-country-map/SIP_DRAFT.md — the design draft, capturing motivation, goals, proposed architecture, spike findings, open questions, and a phased implementation plan.

What we've validated so far

  • Default worldview: spike confirms Natural Earth's _ukr (Ukraine) worldview cleanly delivers Crimea-as-Ukrainian plus aligned positions on Kosovo (separate from Serbia), Western Sahara (separate from Morocco), Palestine (recognized), Cyprus (undivided), Kashmir (aligned with India), Aksai Chin (excluded from China). 18 of 258 features differ from NE Default; 9 micro-territories are dropped.
  • Pipeline approach: replace the Jupyter notebook with a mapshaper-CLI-based script that consumes pinned NE shapefiles and emits one GeoJSON per (worldview × admin level). Reproducible, diff-able, no notebook state.
  • Plugin approach: build new plugin-chart-country-map (no legacy- prefix) against the modern chart/data endpoint, supporting both Admin 0 (countries) and Admin 1 (subdivisions) — folding in years of bespoke per-country contributions (French departments, Italian regions, Türkiye city map, etc.) into a single infrastructure.
  • Deprecation: in-UI "switch to new Country Map" button + deprecation banner on the legacy plugin. No DB migrations needed.

What's NOT in scope for this SIP

  • World map plugin (bubble overlays) — separate concern, future work.
  • Custom GeoJSON upload as a first-class control — separate feature.
  • Combining geometries at runtime — out of scope; users wanting this should upload custom GeoJSON.
  • Admin 2 (counties, communes) — could come later.

Next commits on this branch (rough)

  1. Audit existing notebook touchups; categorize keep/drop/port-to-YAML
  2. Write scripts/country-maps/build.sh
  3. Generate first batch of GeoJSON outputs
  4. Scaffold the new plugin (modern ChartPlugin, chart/data endpoint)
  5. Port rendering logic from legacy plugin
  6. Add controls (worldview, admin level, region include/exclude, flying islands, language)
  7. Wire up legacy plugin deprecation banner + "switch" button

Reviewing this PR

Read SIP_DRAFT.md and ping back on the open questions section. The doc will be kept up to date as the POC progresses; eventual SIP issue will be a snapshot of this file.

Additional information

  • Has associated issue:
  • Required feature flags:
  • Changes UI (eventually — not yet)
  • Includes DB Migration: no
  • Introduces new feature or API: yes (eventually)
  • Removes existing feature or API: yes (deprecates legacy-plugin-chart-country-map across two majors)

@netlify

netlify Bot commented May 12, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a4b1eca
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a03a6f5d6c5020008ad1b73
😎 Deploy Preview https://deploy-preview-40078--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.33948% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.92%. Comparing base (de11628) to head (af027b1).
⚠️ Report is 94 commits behind head on master.

Files with missing lines Patch % Lines
...ins/plugin-chart-country-map-v2/src/CountryMap.tsx 18.23% 130 Missing ⚠️
...n-chart-country-map-v2/src/plugin/controlPanel.tsx 87.67% 9 Missing ⚠️
...ns/plugin-chart-country-map-v2/src/plugin/index.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40078      +/-   ##
==========================================
- Coverage   85.97%   85.92%   -0.06%     
==========================================
  Files        3128     3134       +6     
  Lines      217773   218044     +271     
  Branches    51629    51721      +92     
==========================================
+ Hits       187230   187352     +122     
- Misses      27119    27267     +148     
- Partials     3424     3425       +1     
Flag Coverage Δ
hive 33.81% <ø> (ø)
javascript 82.68% <48.33%> (-0.11%) ⬇️
mysql 51.63% <ø> (ø)
postgres 51.65% <ø> (-0.01%) ⬇️
presto 35.51% <ø> (ø)
python 88.47% <ø> (-0.01%) ⬇️
sqlite 51.33% <ø> (ø)
unit 83.96% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added dependencies:npm packages github_actions Pull requests that update GitHub Actions code labels May 12, 2026
@rusackas rusackas added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label May 13, 2026
@github-actions github-actions Bot added 🎪 ae7a947 🚦 building 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR 🎪 ae7a947 🚦 building labels May 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 11f6109

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 6f882f2

• Environment: http://35.90.51.159:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for d9f4367

• Environment: http://44.255.105.149:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for d9f04d6

@github-actions

github-actions Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Country Map: drift detected between the locally committed GeoJSON outputs and what CI just regenerated for commit 610c435. Either the YAML configs were updated without re-running ./scripts/build.sh, OR mapshaper output differs cross-platform (macOS dev vs Linux CI). Investigate before merge.

This comment is sticky and updated on every push; old drift comments are not stacked.

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for d9f04d6

• Environment: http://35.93.203.199:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for d9f04d6

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for d9f04d6

• Environment: http://35.91.84.220:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for df479e7

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 610c435

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for df479e7

• Environment: http://16.145.89.166:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@github-actions

Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 610c435

• Environment: http://54.245.129.231:8080 (admin/admin)
• Lifetime: 48h auto-cleanup
• Updates: New commits create fresh environments automatically

@sha174n

sha174n commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Structure looks right for a SIP POC — the ~20k lines are overwhelmingly generated geo data plus a reproducible build.py/mapshaper pipeline, with the actual code (CountryMap.tsx, controlPanel.tsx, build.py) staying modest, and the render path uses createElementNS/appendChild rather than innerHTML. Main thing to settle before it leaves draft: checking in both the generated GeoJSON and the build pipeline duplicates the source of truth — worth deciding whether the assets are committed artifacts or CI-built (the regen workflow suggests the latter) so they don't drift. Otherwise this reads as land-the-SIP-discussion-first.

@rusackas

Copy link
Copy Markdown
Member Author

@sha174n on the committed-vs-CI-built question, SIP_DRAFT.md already covers it: the GeoJSON output gets committed so a fresh ephemeral env can render without running the build first, and the regen workflow just diffs CI's rebuild against that to catch drift, it's not building anything at request time.

Bigger problem though: master already shipped a plugin-chart-country-map (dropping the legacy- prefix) via #41714, using the old per-country geojson + notebook pipeline. That's the same path this PR wants, with a totally different design, so this isn't a rebase conflict anymore, it's two implementations claiming the same slot. Needs sorting out before a rebase here would even mean anything.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Country Map: drift detected between the locally committed GeoJSON outputs and what CI just regenerated for commit af027b1. Either the YAML configs were updated without re-running ./scripts/build.sh, OR mapshaper output differs cross-platform (macOS dev vs Linux CI). Investigate before merge.

This comment is sticky and updated on every push; old drift comments are not stacked.

rusackas and others added 2 commits November 23, 2026 21:05
…untry_map_v2

Ports the SIP proof of concept onto current master as a separate plugin,
`plugin-chart-country-map-v2`, registered as `country_map_v2` next to the
existing `plugin-chart-country-map` (`country_map`). The original branch
created its plugin at the path and package name that master has since
given to the existing plugin, so the two could no longer be rebased
together.

What carries over from the original 49 commits, squashed:
- the D3 renderer, control panel, buildQuery/transformProps and the
  form-data migration from `country_map`
- the Natural Earth + mapshaper build pipeline, its YAML configs and tests
- the committed GeoJSON outputs under superset/static/assets/country-maps
  and the ignore-file re-includes that ship them
- the drift-check workflow, Playwright spec and SIP draft

What changed in the port:
- the existing Country Map plugin is left untouched: no deprecation
  label, rename, or UPDATING.md entry
- the new chart is named "Country Map (Experimental)"
- the workflow uses pinned actions, job-scoped permissions, and skips its
  sticky comment on fork PRs
- d3-geo is allowed through jest's transform, and the generated manifest
  is exempt from oxfmt so the build output stays byte-stable
- theme color fallbacks are typed against the tokens they read
- map files are fetched through SupersetClient.getUrl so subdirectory
  deployments resolve them, and the Playwright spec polls for the drawn
  map instead of counting the loading indicator's paths
- messages.pot carries the new chart's strings

Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Evan Rusackas <evan@preset.io>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies:npm dependencies:python github_actions Pull requests that update GitHub Actions code i18n Namespace | Anything related to localization packages plugins requires:rebase Requires rebasing on top of current master review:draft risk:chart-metadata size/XXL 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants