blob: de05db9fcdfb49e5c0e3a73afda6cdfd4b57ec95 [file] [log] [blame]
"use strict";(self.webpackChunkdocs_v_2=self.webpackChunkdocs_v_2||[]).push([[7271],{79925:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=n(83117),a=(n(67294),n(3905));const o={title:"Country Map Tools",hide_title:!0,sidebar_position:1,version:1},i=void 0,l={unversionedId:"miscellaneous/country-map-tools",id:"miscellaneous/country-map-tools",title:"Country Map Tools",description:"The Country Map Visualization",source:"@site/docs/miscellaneous/country-map-tools.mdx",sourceDirName:"miscellaneous",slug:"/miscellaneous/country-map-tools",permalink:"/docs/miscellaneous/country-map-tools",draft:!1,editUrl:"https://github.com/apache/superset/tree/master/docs/docs/miscellaneous/country-map-tools.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Country Map Tools",hide_title:!0,sidebar_position:1,version:1},sidebar:"tutorialSidebar",previous:{title:"Querying across databases",permalink:"/docs/databases/meta-database"},next:{title:"Timezones",permalink:"/docs/miscellaneous/timezones"}},u={},s=[{value:"The Country Map Visualization",id:"the-country-map-visualization",level:2},{value:"Included Maps",id:"included-maps",level:2},{value:"Adding a New Country",id:"adding-a-new-country",level:2}],p={toc:s},c="wrapper";function m(e){let{components:t,...n}=e;return(0,a.kt)(c,(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"the-country-map-visualization"},"The Country Map Visualization"),(0,a.kt)("p",null,"The Country Map visualization allows you to plot lightweight choropleth maps of\nyour countries by province, states, or other subdivision types. It does not rely\non any third-party map services but would require you to provide the\n",(0,a.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/ISO_3166-2"},"ISO-3166-2")," codes of your country's\ntop-level subdivisions. Comparing to a province or state's full names, the ISO\ncode is less ambiguous and is unique to all regions in the world."),(0,a.kt)("h2",{id:"included-maps"},"Included Maps"),(0,a.kt)("p",null,"The Country Maps visualization already ships with the maps for the following countries:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Belgium"),(0,a.kt)("li",{parentName:"ul"},"Brazil"),(0,a.kt)("li",{parentName:"ul"},"Bulgaria"),(0,a.kt)("li",{parentName:"ul"},"Canada"),(0,a.kt)("li",{parentName:"ul"},"China"),(0,a.kt)("li",{parentName:"ul"},"Egypt"),(0,a.kt)("li",{parentName:"ul"},"France"),(0,a.kt)("li",{parentName:"ul"},"Germany"),(0,a.kt)("li",{parentName:"ul"},"India"),(0,a.kt)("li",{parentName:"ul"},"Iran"),(0,a.kt)("li",{parentName:"ul"},"Italy"),(0,a.kt)("li",{parentName:"ul"},"Japan"),(0,a.kt)("li",{parentName:"ul"},"Korea"),(0,a.kt)("li",{parentName:"ul"},"Liechtenstein"),(0,a.kt)("li",{parentName:"ul"},"Morocco"),(0,a.kt)("li",{parentName:"ul"},"Myanmar"),(0,a.kt)("li",{parentName:"ul"},"Netherlands"),(0,a.kt)("li",{parentName:"ul"},"Portugal"),(0,a.kt)("li",{parentName:"ul"},"Russia"),(0,a.kt)("li",{parentName:"ul"},"Singapore"),(0,a.kt)("li",{parentName:"ul"},"Spain"),(0,a.kt)("li",{parentName:"ul"},"Switzerland"),(0,a.kt)("li",{parentName:"ul"},"Syria"),(0,a.kt)("li",{parentName:"ul"},"Thailand"),(0,a.kt)("li",{parentName:"ul"},"Timorleste"),(0,a.kt)("li",{parentName:"ul"},"Turkey"),(0,a.kt)("li",{parentName:"ul"},"UK"),(0,a.kt)("li",{parentName:"ul"},"Ukraine"),(0,a.kt)("li",{parentName:"ul"},"Uruguay"),(0,a.kt)("li",{parentName:"ul"},"USA"),(0,a.kt)("li",{parentName:"ul"},"Zambia")),(0,a.kt)("h2",{id:"adding-a-new-country"},"Adding a New Country"),(0,a.kt)("p",null,"To add a new country to the list, you'd have to edit files in\n",(0,a.kt)("a",{parentName:"p",href:"https://github.com/apache/superset/tree/master/superset-frontend/plugins/legacy-plugin-chart-country-map"},"@superset-ui/legacy-plugin-chart-country-map"),"."),(0,a.kt)("ol",null,(0,a.kt)("li",{parentName:"ol"},"Generate a new GeoJSON file for your country following the guide in ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-plugin-chart-country-map/scripts/Country%20Map%20GeoJSON%20Generator.ipynb"},"this Jupyter notebook"),"."),(0,a.kt)("li",{parentName:"ol"},"Edit the countries list in ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/apache/superset/blob/master/superset-frontend/plugins/legacy-plugin-chart-country-map/src/countries.ts"},"legacy-plugin-chart-country-map/src/countries.ts"),"."),(0,a.kt)("li",{parentName:"ol"},"Install superset-frontend dependencies: ",(0,a.kt)("inlineCode",{parentName:"li"},"cd superset-frontend && npm install")),(0,a.kt)("li",{parentName:"ol"},"Verify your countries in Superset plugins storybook: ",(0,a.kt)("inlineCode",{parentName:"li"},"npm run plugins:storybook"),"."),(0,a.kt)("li",{parentName:"ol"},"Build and install Superset from source code.")))}m.isMDXComponent=!0},3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>y});var r=n(67294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=r.createContext({}),s=function(e){var t=r.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=s(e.components);return r.createElement(u.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,u=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),c=s(n),d=a,y=c["".concat(u,".").concat(d)]||c[d]||m[d]||o;return n?r.createElement(y,i(i({ref:t},p),{},{components:n})):r.createElement(y,i({ref:t},p))}));function y(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var l={};for(var u in t)hasOwnProperty.call(t,u)&&(l[u]=t[u]);l.originalType=e,l[c]="string"==typeof e?e:a,i[1]=l;for(var s=2;s<o;s++)i[s]=n[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);