diff --git a/plugins/legacy-plugin-chart-world-map/package.json b/plugins/legacy-plugin-chart-world-map/package.json index 988b61ce2d..5163809078 100644 --- a/plugins/legacy-plugin-chart-world-map/package.json +++ b/plugins/legacy-plugin-chart-world-map/package.json @@ -28,7 +28,9 @@ "access": "public" }, "dependencies": { + "@superset-ui/color": "^0.14.9", "d3": "^3.5.17", + "d3-array": "^2.4.0", "datamaps": "^0.5.8", "prop-types": "^15.6.2" }, diff --git a/plugins/legacy-plugin-chart-world-map/src/WorldMap.js b/plugins/legacy-plugin-chart-world-map/src/WorldMap.js index 8a3900bb67..a980b8db9c 100644 --- a/plugins/legacy-plugin-chart-world-map/src/WorldMap.js +++ b/plugins/legacy-plugin-chart-world-map/src/WorldMap.js @@ -53,8 +53,7 @@ function WorldMap(element, props) { // Ignore XXX's to get better normalization const filteredData = data.filter(d => d.country && d.country !== 'XXX'); - const ext = d3.extent(filteredData, d => d.m1); - const extRadius = d3.extent(filteredData, d => d.m2); + const extRadius = d3.extent(filteredData, d => Math.sqrt(d.m2)); const radiusScale = d3.scale .linear() .domain([extRadius[0], extRadius[1]]) @@ -66,7 +65,7 @@ function WorldMap(element, props) { const processedData = filteredData.map(d => ({ ...d, - radius: radiusScale(d.m2), + radius: radiusScale(Math.sqrt(d.m2)), fillColor: colorScale(d.m1), }));