File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
superset-frontend/plugins/legacy-plugin-chart-world-map/src Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const propTypes = {
3131 data : PropTypes . arrayOf (
3232 PropTypes . shape ( {
3333 country : PropTypes . string ,
34+ code : PropTypes . string ,
3435 latitude : PropTypes . number ,
3536 longitude : PropTypes . number ,
3637 name : PropTypes . string ,
@@ -116,7 +117,7 @@ function WorldMap(element, props) {
116117 const selected = Object . values ( filterState . selectedValues || { } ) ;
117118 const key = source . id || source . country ;
118119 const country =
119- countryFieldtype === 'name' ? mapData [ key ] ?. name : mapData [ key ] ?. country ;
120+ countryFieldtype === 'name' ? mapData [ key ] ?. name : mapData [ key ] ?. code ;
120121
121122 if ( ! country ) {
122123 return undefined ;
@@ -170,7 +171,7 @@ function WorldMap(element, props) {
170171 pointerEvent . preventDefault ( ) ;
171172 const key = source . id || source . country ;
172173 const val =
173- countryFieldtype === 'name' ? mapData [ key ] ?. name : mapData [ key ] ?. country ;
174+ countryFieldtype === 'name' ? mapData [ key ] ?. name : mapData [ key ] ?. code ;
174175 let drillToDetailFilters ;
175176 let drillByFilters ;
176177 if ( val ) {
Original file line number Diff line number Diff line change @@ -1313,6 +1313,7 @@ def get_data(self, df: pd.DataFrame) -> VizData:
13131313 self .form_data ["country_fieldtype" ], row ["country" ]
13141314 )
13151315 if country :
1316+ row ["code" ] = country [self .form_data ["country_fieldtype" ]]
13161317 row ["country" ] = country ["cca3" ]
13171318 row ["latitude" ] = country ["lat" ]
13181319 row ["longitude" ] = country ["lng" ]
You can’t perform that action at this time.
0 commit comments