3

I am trying to add a new country map to Apache Superset.
I followed the instructions on "You need to add a new Country ?".

However, step 7 is not working for me. Even if I add the country in the "select country" component, it still does not appear on the scrolling list in the UI.

Thanks for your help. This is step 7:

Add your country in component ‘select_country’ Example:

And this is its code:

select_country: {
    type: 'SelectControl',
    label: 'Country Name Type',
    default: 'France',
    choices: [
    'Belgium',
    'Brazil',
    'China',
    'Egypt',
    'France',
    'Germany',
    'Italy',
    'Morocco',
    'Netherlands',
    'Russia',
    'Singapore',
    'Spain',
    'Uk',
    'Usa',
    ].map(s => [s, s]),
    description: 'The name of country that Superset should display',
},
Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Jean Valet
  • 131
  • 1
  • 2
  • 7

3 Answers3

3

Your changes in

  1. superset/assets/javascripts/explorev2/stores/controls.jsx and

  2. Put your geojson file in next folder : superset/assets/visualizations/countries

would not work if you changes these inside installed packages.

For loading your own country map or getting reflection of your changes inside front end assets you need to follow the following steps,

  1. install superset from source (details instructions are install superset from source)
  2. You have to install npm/nodejs (I had followed the instructions of install nodejs in ubuntu for my environment)
  3. Do the changes of your assets (javascript, geojson) in superset
  4. Rebuild front end assets

    # from the root of the repository, move to where our JS package.json lives

    cd superset/assets/

    # Start a web server that manages and updates your assets as you modify them

    npm run dev

  5. run superset and check your changes.

1

You have to install npm/nodejs and run the npm run dev command for the changes in your visualization update.

here is the documentation, with that should be enough.

https://github.com/apache/incubator-superset/blob/master/CONTRIBUTING.md#npm-packages

  • Can you be a little more specific about what this user needs to do? An external link can always go offline - especially if it links to the head of a specific branch. – Aaron V Apr 26 '18 at 18:29
0

step 4 : I don't start a web server that manages and updates your assets as you modify them and have error

(venv) ubuntu@ip-172-31-43-165:~$ npm run dev
npm ERR! missing script: dev

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-09-27T04_10_01_655Z-debug.log.

i don't understand script dev ? Thanks

Rahul Agarwal
  • 4,034
  • 7
  • 27
  • 51
  • try to run the above command after routing to superset/assets folder `find -name assets` gives you where the assets folder of superset is located – John Chornelius Jan 22 '19 at 09:27