mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
Three coordinated changes:
1. **VizType.CountryMapV2 = 'country_map_v2'** — new enum value for the
modern plugin's chart type. Existing dashboards continue to use
`country_map` (legacy plugin); new charts get `country_map_v2`.
Naming follows the established pattern (LegacyBubble='bubble',
Bubble='bubble_v2'). Eventual swap (in a major version) can rename
so 'country_map' points to the new plugin.
2. **Legacy plugin marked deprecated**:
- Display name changed to "Country Map (Legacy)" so the chart picker
shows them side-by-side unambiguously
- label: ChartLabel.Deprecated — surfaces the standard deprecation
badge in the UI without hiding from the picker (existing dashboards
keep working; users see "this is deprecated" when editing)
- labelExplanation pointing users at the new chart
3. **MainPreset registers both**:
- CountryMapChartPlugin (legacy) → VizType.CountryMap
- CountryMapV2ChartPlugin (new) → VizType.CountryMapV2
Plus added @superset-ui/plugin-chart-country-map as a workspace
dependency in superset-frontend/package.json so the symlink resolves
during npm install.
Not yet wired (next commits):
- "Switch to new Country Map" button on the legacy plugin's UI
(the deprecation banner shows; the button to migrate form_data
is a separate change in the explore controls)
- Hosting path for the new plugin's GeoJSON outputs (currently
stubbed in transformProps — no static file serving wired yet)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@superset-ui/legacy-plugin-chart-country-map
This plugin provides Country Map for Superset.
Usage
Configure key, which can be any string, and register the plugin. This key will be used to
lookup this chart throughout the app.
import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map';
new CountryMapChartPlugin().configure({ key: 'country-map' }).register();
Then use it via SuperChart. See
storybook
for more details.
<SuperChart
chartType="country-map"
width={600}
height={600}
formData={...}
queriesData={[{
data: {...},
}]}
/>
Update Map
To update the country maps or add a new country, run scripts in the Jupyter notebook
scripts/Country Map GeoJSON Generator.ipynb.
pip install geopandas shapely matplotlib notebook
jupyter notebook