From a19e377d8c3b3b3590b5c86557999427bbf56d3f Mon Sep 17 00:00:00 2001 From: jrobinso <933148+jrobinso@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:28:19 -0800 Subject: [PATCH] gradient color scale issue --- js/util/colorScale.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/util/colorScale.js b/js/util/colorScale.js index 0227c33e2..2aa591f58 100644 --- a/js/util/colorScale.js +++ b/js/util/colorScale.js @@ -66,9 +66,15 @@ class BinnedColorScale { class GradientColorScale { - constructor({min, max, minColor, maxColor}) { + constructor(config) { this.type = 'gradient' - this.setProperties({min, max, minColor, maxColor}) + const fixed = { + min: config.min !== undefined ? config.min : config.low, + max: config.max !== undefined ? config.max : config.high, + minColor: config.minColor || config.lowColor, + maxColor: config.maxColor || config.highColor + } + this.setProperties(fixed) } setProperties({min, max, minColor, maxColor}) {