You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/09/12 22:39:40 UTC

[GitHub] williaster closed pull request #5878: remove getColorFromScheme usage in histogram

williaster closed pull request #5878: remove getColorFromScheme usage in histogram
URL: https://github.com/apache/incubator-superset/pull/5878
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/visualizations/Histogram.jsx b/superset/assets/src/visualizations/Histogram.jsx
index 6de9829f16..44ffafbe99 100644
--- a/superset/assets/src/visualizations/Histogram.jsx
+++ b/superset/assets/src/visualizations/Histogram.jsx
@@ -6,7 +6,7 @@ import { chartTheme } from '@data-ui/theme';
 import { LegendOrdinal } from '@vx/legend';
 import { scaleOrdinal } from '@vx/scale';
 import WithLegend from './WithLegend';
-import { getColorFromScheme } from '../modules/colors';
+import { getScale } from '../modules/CategoricalColorNamespace';
 
 const propTypes = {
   className: PropTypes.string,
@@ -48,10 +48,11 @@ class CustomHistogram extends React.PureComponent {
       yAxisLabel,
     } = this.props;
 
+    const colorFn = getScale(colorScheme).toFunction();
     const keys = data.map(d => d.key);
     const colorScale = scaleOrdinal({
       domain: keys,
-      range: keys.map(key => getColorFromScheme(key, colorScheme)),
+      range: keys.map(colorFn),
     });
 
     return (


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org