dockerapache-superset

How add a new map to chart "country_map" Apache Superset


Good day. I copied russia.geojson from superst/superset-frontend/plugins/legacy-plugin-chart-country-map/src/countries and renamed it to newrussia.geojson to check the country addition function according to the instructions from https://superset.apache.org/docs/miscellaneous/country-map-tools/. After that, I added the file name to the import and the list "export const countries". I'm stuck on the third. Error: npm: The npm name is not recognized as the name of a cmdlet, function, script file, or executable program.

I am working with Superset v3.1.1 installed in Docker via Pycharm terminal. I tried to install npm via pip install. the installation was successful, but the error remained. In many guides, there are no steps 3 and 4, the container is immediately launched. However, the following error occurs at startup: ERROR in src/visualizations/TimeTable/controlPanel.js:33:10


Solution

  • I solved the problem by downloading node.js and by completing steps 3 and 4 on the Node terminal. In Windows, it appears as an application after installation Node.js. After that, the docker built command was launched, and the map was added to the country_map chart

    There were also issues with the execution of the command, in many guides this is not explained. Here is the command that worked for me:

    docker build -f Dockerfile --force-rm -t <name> <path> 
    

    name is the name of the container you want to install; path is the full path to your Dockerfile

    Installation Instructions Node.js: https://medium.com/devops-with-valentine/how-to-install-node-js-and-npm-on-windows-10-windows-11-139442f90f12

    Download the installer from the website https://nodejs.org / and install it with basic settings. LTS (Long Term Support) version is recommended.