How to add a new Country Map when using Docker?
According to the docs, a user can add a new CountryMap by putting the .geojson file in this directory: superset/assets/src/visualizations/CountryMap/countries. This directory however does not exist in this path. It's located only in node modules directory.
Is it possible to add a new country when Superset is installed with Docker? Or is building from source the only way to achieve this?
Issue-Label Bot is automatically applying the label #question to this issue, with a confidence of 0.64. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
@klazaj You need to refer here: https://github.com/apache-superset/superset-ui-plugins/tree/master/packages/superset-ui-legacy-plugin-chart-country-map
@syazwan0913 which file do I configure the key and Superchart?
Same issue here Dont know where I should place the .geojson file inside the docker for superset or add the key and config
@visakhmurukes what I did was put the CountryMap in /visualizations directory and change the path of the plugin in MainPreset.js file, so that it points to the CountryMap in visualizations directory.
Where can I find MainPreset.js? I searched inside Superset docker using find but couldn't find the specified file.
On Tue, Oct 29, 2019 at 4:25 PM klazaj [email protected] wrote:
@visakhmurukes https://github.com/visakhmurukes what I did was put the CountryMap https://github.com/apache-superset/superset-ui-plugins/tree/master/packages/superset-ui-legacy-plugin-chart-country-map/src in /visualizations directory and change the path of the plugin in MainPreset.js file, so that it points to the CountryMap in visualizations directory.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-superset/issues/8429?email_source=notifications&email_token=ADMF53NHNRMAGZRQXM7MMFLQRATTFA5CNFSM4JDSFAZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECQJHPY#issuecomment-547394495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMF53NA7JFNSYW3MNTQ7ZDQRATTFANCNFSM4JDSFAZQ .
@visakhmurukes https://github.com/apache/incubator-superset/blob/master/superset/assets/src/visualizations/presets/MainPreset.js
@visakhmurukes The file is under your local if you create the docker from source. it is mapped to docker volume
So we need to build it from source? Is there not a direct way to add map to superset running from docker?
@visakhmurukes you don't need to build it from source, and yes there is a direct way (at least when I installed superset). As I mention above, move https://github.com/apache-superset/superset-ui-plugins/tree/master/packages/superset-ui-legacy-plugin-chart-country-map/src to /visualizations and do this

I dont have Mainpreset.js. Instead I see MapChartPreset.js And it already has these lines
import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map';
export default class MapChartPreset extends Preset {
constructor() {
super({
name: 'Maps',
plugins: [
new CountryMapChartPlugin().configure({ key: 'country_map' })
],
});
}
substitute import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map'; with import CountryMapChartPlugin from '../CountryMap/CountryMapChartPlugin';
I substituted the lines as specified and added new country geojson file to assets/src/visualizations/CountryMap/countries folder I also added new country name to explore/controls.jsx I restarted docker container as well Still the map doesnt show new country in the list
That is weird, the country name at least has to show on the list, since docker updates frontend with every change you make. Is your superset in development mode?
Yes The webserver is in development mode Do you want me to change it?
@visakhmurukes no, the websever should stay in development mode in order for the frontend to be updated
Sorry @klazaj still not much luck with this :(
@visakhmurukes Hi, were able to figure it out in the end?