rusackas commented on code in PR #19881:
URL: https://github.com/apache/superset/pull/19881#discussion_r861369225
##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -69,15 +74,27 @@ function WorldMap(element, props) {
.domain([extRadius[0], extRadius[1]])
.range([1, maxBubbleSize]);
- const colorScale = getSequentialSchemeRegistry()
- .get(linearColorScheme)
- .createLinearScale(d3Extent(filteredData, d => d.m1));
+ let processedData;
+ let colorScale;
+ if (colorBy === ColorBy.country) {
+ colorScale = CategoricalColorNamespace.getScale(colorScheme);
- const processedData = filteredData.map(d => ({
- ...d,
- radius: radiusScale(Math.sqrt(d.m2)),
- fillColor: colorScale(d.m1),
- }));
+ processedData = filteredData.map(d => ({
+ ...d,
+ radius: radiusScale(Math.sqrt(d.m2)),
+ fillColor: colorScale(d.name, sliceId),
Review Comment:
We could also base this on the metric, rather than the name, so that the
country with the highest value gets the first color in the palette.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]