src/ScaleSlider.js
/**
   * Function enabling modification of any color scale attribute
   * @param {number} index - index of the scale object to be modified
   * @param {string} parameter - the parameter to be replaced
   * @param {(number|string)} value - the new value of the parameter
   */
Function enabling modification of any color scale attribute
@param {number} index - index of the scale object to be modified
@param {string} parameter - the parameter to be replaced
@param {(number|string)} value - the new value of the parameter
Function enabling modification of any color scale attribute @param { number } index - index of the scale object to be modified @param { string } parameter - the parameter to be replaced @param { ( number|string ) } value - the new value of the parameter
scaleChange (index, parameter, value) {
    if (parameter === 'value' &&
      (parseFloat(value) > this.props.stats.max ||
      value < this.props.stats.min)) {
      console.warn('Invalid color scale')
    } else {
      let newScale = null
      if (parameter === 'type' && value !== 'value') {
        newScale = update(this.props.scale, {
          [index]: {
            [parameter]: {$set: value},
            $unset: ['value']
          }
        })
        this.props.onChange(newScale)
      } else if (value === 'value') {
        newScale = update(this.props.scale, {
          [index]: {
            [parameter]: {$set: value},
            $merge: {'value': this.props.stats[this.props.scale[index].type]}
          }
        })
        this.props.onChange(newScale)
      } else if (!isNaN(parseFloat(value))) {
        newScale = update(this.props.scale, {
          [index]: {
            [parameter]: {$set: value}
          }
        })
        this.props.onChange(newScale)
      }
    }
  }
scaleChange ( index , parameter , value ) { if ( parameter === 'value' && ( parseFloat ( value ) > this . props . stats . max || value < this . props . stats . min ) ) { console . warn ( 'Invalid color scale' ) } else { let newScale = null if ( parameter === 'type' && value !== 'value' ) { newScale = update ( this . props . scale , { [ index ] : { [ parameter ] : { $set : value } , $unset : [ 'value' ] } } ) this . props . onChange ( newScale ) } else if ( value === 'value' ) { newScale = update ( this . props . scale , { [ index ] : { [ parameter ] : { $set : value } , $merge : { 'value' : this . props . stats [ this . props . scale [ index ] . type ] } } } ) this . props . onChange ( newScale ) } else if ( ! isNaN ( parseFloat ( value ) ) ) { newScale = update ( this . props . scale , { [ index ] : { [ parameter ] : { $set : value } } } ) this . props . onChange ( newScale ) } } }
Function enabling modification of any color scale attribute
 @param {number} index - index of the scale object to be modified
 @param {string} parameter - the parameter to be replaced
 @param {(number|string)} value - the new value of the parameter
Function enabling modification of any color scale attribute @param { number } index - index of the scale object to be modified @param { string } parameter - the parameter to be replaced @param { ( number|string ) } value - the new value of the parameter