Skip to content

Commit

Permalink
gradient color scale issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Nov 26, 2024
1 parent 9d396d6 commit a19e377
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/util/colorScale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}) {
Expand Down

0 comments on commit a19e377

Please sign in to comment.