mirror of
https://github.com/apache/superset.git
synced 2026-05-25 17:55:15 +00:00
feat(plugin-chart-country-map): ship all 33 NE worldviews at Admin 0
Previously the build only emitted the ukr (Ukraine) worldview, so the worldview dropdown had a single option even though it claimed otherwise. Build now produces Admin 0 GeoJSON for every NE-published editorial: default, arg, bdg, bra, chn, deu, egy, esp, fra, gbr, grc, idn, ind, iso, isr, ita, jpn, kor, mar, nep, nld, pak, pol, prt, pse, rus, sau, swe, tur, twn, ukr, usa, vnm (33 total). NE does not publish per-worldview Admin 1 variants, so subdivisions within a country come from a single shared file. The frontend now always points Admin 1, regional aggregation, and composite URLs at the ukr-prefixed shared outputs regardless of the selected worldview — the worldview control only affects the world (Admin 0) map. - build.py: expand WORLDVIEWS_ADMIN_0 to 33 worldviews; main() builds Admin 0 for all of them, Admin 1 only for ukr - transformProps.ts: introduce SHARED_ADMIN1_WORLDVIEW = 'ukr'; pin all non-Admin-0 URLs to it - controlPanel.tsx: WORLDVIEW_LABELS now covers all 33 codes; unrecognized codes still fall back to raw code for forward-compat - transformProps.test.ts: cover shared-Admin1 contract (admin1+chn still resolves to ukr_admin1_*) - pre-commit: exclude .geo.json from check-added-large-files (existing rule only excluded .geojson and would block these ~2MB worldview files) - README + SIP: document the worldview model and check off Phase 1 item Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -45,7 +45,7 @@ test('Admin 0 (no country) → world choropleth URL', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('Admin 1 + country → per-country file URL', () => {
|
||||
test('Admin 1 + country → per-country file URL (worldview-agnostic)', () => {
|
||||
const out = transformProps(
|
||||
buildChartProps({ admin_level: 1, country: 'FRA', worldview: 'ukr' }),
|
||||
);
|
||||
@@ -54,13 +54,22 @@ test('Admin 1 + country → per-country file URL', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('Region set + country → regional aggregation URL', () => {
|
||||
test('Admin 1 stays on the shared (ukr) file regardless of worldview', () => {
|
||||
const out = transformProps(
|
||||
buildChartProps({ admin_level: 1, country: 'FRA', worldview: 'chn' }),
|
||||
);
|
||||
expect(out.geoJsonUrl).toBe(
|
||||
'/static/assets/country-maps/ukr_admin1_FRA.geo.json',
|
||||
);
|
||||
});
|
||||
|
||||
test('Region set + country → regional aggregation URL (shared)', () => {
|
||||
const out = transformProps(
|
||||
buildChartProps({
|
||||
admin_level: 1,
|
||||
country: 'TUR',
|
||||
region_set: 'nuts_1',
|
||||
worldview: 'ukr',
|
||||
worldview: 'rus', // exotic worldview — regional URL still resolves to ukr
|
||||
}),
|
||||
);
|
||||
expect(out.geoJsonUrl).toBe(
|
||||
@@ -68,13 +77,13 @@ test('Region set + country → regional aggregation URL', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('Composite overrides admin_level + country', () => {
|
||||
test('Composite overrides admin_level + country (shared across worldviews)', () => {
|
||||
const out = transformProps(
|
||||
buildChartProps({
|
||||
admin_level: 1,
|
||||
country: 'FRA',
|
||||
composite: 'france_overseas',
|
||||
worldview: 'ukr',
|
||||
worldview: 'chn',
|
||||
}),
|
||||
);
|
||||
expect(out.geoJsonUrl).toBe(
|
||||
|
||||
Reference in New Issue
Block a user