From 484d30804fbba793b536625f4737ecbd261a07ca Mon Sep 17 00:00:00 2001 From: Jashanpreet Singh Date: Sat, 19 Oct 2019 07:41:47 +0530 Subject: [PATCH] feat(calendar): add support for custom color scale (#703) --- packages/calendar/src/enhance.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/calendar/src/enhance.js b/packages/calendar/src/enhance.js index 85cdda1db..fcd7c0b21 100644 --- a/packages/calendar/src/enhance.js +++ b/packages/calendar/src/enhance.js @@ -22,15 +22,16 @@ const commonEnhancers = [ withTheme(), withDimensions(), withPropsOnChange( - ['data', 'minValue', 'maxValue', 'colors'], - ({ data, minValue, maxValue, colors }) => { + ['data', 'minValue', 'maxValue', 'colors', 'colorScale'], + ({ data, minValue, maxValue, colors, colorScale }) => { + if (colorScale) return { colorScale } const domain = computeDomain(data, minValue, maxValue) - const colorScale = scaleQuantize() + const defaultColorScale = scaleQuantize() .domain(domain) .range(colors) - return { colorScale } + return { colorScale: defaultColorScale } } ), withPropsOnChange(