Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jul 29, 2020
1 parent 3b9c4f3 commit a72a43c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions plugins/legacy-plugin-chart-world-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
5 changes: 2 additions & 3 deletions plugins/legacy-plugin-chart-world-map/src/WorldMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand All @@ -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),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import { rgb } from 'd3-color';

export default function transformProps(chartProps) {
const { width, height, formData, queryData } = chartProps;
const { maxBubbleSize, showBubbles, linearColorScheme, colorPicker } = formData;
Expand Down

0 comments on commit a72a43c

Please sign in to comment.