This is an automated email from the ASF dual-hosted git repository.
willbarrett pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 4ee5247 improve documentation for country maps (#10621)
4ee5247 is described below
commit 4ee524736de7c19c746ac211f4a5a9c9ba03b6db
Author: Cory Zue <[email protected]>
AuthorDate: Tue Aug 18 18:36:35 2020 +0200
improve documentation for country maps (#10621)
---
docs/visualization.rst | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/docs/visualization.rst b/docs/visualization.rst
index b56a979..b8d53a9 100644
--- a/docs/visualization.rst
+++ b/docs/visualization.rst
@@ -1959,7 +1959,9 @@ List of Countries
Need to add a new Country?
-------------------------------
-To add a new country in country map tools, we need to follow the following
steps :
+Warning: adding a new country is not easy and requires building superset from
source!
+
+To add a new country in country map tools, you need to follow the following
steps :
1. You need shapefiles which contain data of your map.
You can get this file on this site: https://www.diva-gis.org/gdata
@@ -1970,13 +1972,17 @@ To add a new country in country map tools, we need to
follow the following steps
3. You need to convert shapefile to geojson file.
This action can make with ogr2ogr tools: https://www.gdal.org/ogr2ogr.html
-4. Put your geojson file in next folder :
superset-frontend/src/visualizations/CountryMap/countries with the next name :
nameofyourcountries.geojson
+4. You can to reduce size of geojson file on this site: https://mapshaper.org/
+
+5. You will need to put your geojson file in the right place in the
@superset-ui npm package. This is the "countries" folder in
+
./superset-frontend/node_modules/@superset-ui/legacy-plugin-chart-country-map/esm/.
+ The .geojson files for other countries are already in this folder.
-5. You can to reduce size of geojson file on this site: https://mapshaper.org/
+6. You will also need to edit the "countries.js" file in the same directory,
following the pattern of the other countries.
-6. Go in file superset-frontend/src/explore/controls.jsx
+7. Then go to the file superset-frontend/src/explore/controls.jsx
-7. Add your country in component 'select_country'
+8. Add your country in component 'select_country'
Example :
.. code-block:: javascript
@@ -2005,3 +2011,6 @@ To add a new country in country map tools, we need to
follow the following steps
].map(s => [s, s]),
description: 'The name of country that Superset should display',
},
+
+
+9. Rebuild the front end from source and restart superset.