kristw commented on a change in pull request #6234: [reviewable] Integrate 
@superset-ui/{core,color,chart} modules
URL: 
https://github.com/apache/incubator-superset/pull/6234#discussion_r232401281
 
 

 ##########
 File path: superset/assets/src/modules/colors.js
 ##########
 @@ -25,13 +23,9 @@ export const colorScalerFactory = function (colors, data, 
accessor, extents, out
     ext = extents;
   }
   if (data) {
-    ext = d3.extent(data, accessor);
+    ext = d3Extent(data, accessor);
   }
   const chunkSize = (ext[1] - ext[0]) / (colors.length - 1);
   const points = colors.map((col, i) => ext[0] + (i * chunkSize));
-  const scaler = d3.scale.linear().domain(points).range(colors).clamp(true);
-  if (outputRGBA) {
-    return v => hexToRGB(scaler(v));
-  }
-  return scaler;
+  return d3.scale.linear().domain(points).range(colors).clamp(true);
 
 Review comment:
   There are slight difference between d3 v3 `scale.linear` and v4 
`scaleLinear`. The `deck.gl` util that uses this function fails the test after 
the swap. I want to take a closer look at it in another PR and remove this 
`colorScalerFactory` function completely.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to