new ColorScale()
modules/tools/colorScale/model.js, line 13
Listens to Events:
- Tools.ColorScale#event:RadioRequestGetColorScaleByValues
Extends
Methods
-
createLegendValues(scale, values){Array.<string>}
modules/tools/colorScale/model.js, line 109 -
gets the rgbs for the corresponding values
Name Type Description scaleobject d3 scale valuesArray.<number> legend values Returns:
of rgbs
-
generateColorScale(values, colorspace, type){function|object}
modules/tools/colorScale/model.js, line 31 -
generates a function to use for color generation from values
Name Type Description valuesArray.<number> Array of all values to build the scale from. Default: [0, 1] colorspaced3.interpolator | Array.<color> colorspace of the scale, either 2 values for linearScale or string selector for d3.interpolator from d3-scale-chromatic. Default: "interpolateBlues" typestring type of the scale. Possbile values: "sequential", "linear". Returns:
returns both the scale function and a legend with value/color-pairs for visualization.
-
interpolateValues(min, max, steps){Array.<number>}
modules/tools/colorScale/model.js, line 92 -
calculates the values for the legend using the min and max values and the number of steps
Name Type Description minnumber min value maxnumber max value stepsnumber number of steps Returns:
values