dojox/color/MeanColorModel (version 1.10)

dojox/color/NeutralColorModel

Summary

A color model that returns a color from a data value using an interpolation between two extremum colors around the mean value.

Usage

var foo = new MeanColorModel(startColor,endColor);
dojox/color/MeanColorModel
Parameter Type Description
startColor dojo/_base/Color

The start color.

endColor dojo/_base/Color
Optional

The end color.

See the dojox/color/MeanColorModel reference documentation for more information.

Property Summary

Method Summary

  • _getInterpoledValue(from,to,value)
  • computeNeutral(min,max,sum,values) Return the neutral value in this case the mean value of the data values.
  • getColor(value) return the color for a given data value.
  • getNormalizedValue(value) Return the normalized (between 0 and 1) value for a given data value.
  • initialize(items,colorFunc) Initialize the color model from a list of data items and using a function that returns the value used to compute the color for a given item.

Properties

_endColor
_max
_min
_startColor

Methods

_getInterpoledValue(from,to,value)
Parameter Type Description
from undefined
to undefined
value undefined
Returns:number
computeNeutral(min,max,sum,values)

Return the neutral value in this case the mean value of the data values.

Parameter Type Description
min Number

The minimal value.

max Number

The maximum value.

sum Number

The sum of all values.

values Number[]

The sorted array of values used to compute colors.

Returns:undefined
getColor(value)

return the color for a given data value.

Parameter Type Description
value Number

The data value.

Returns:undefined
getNormalizedValue(value)

Return the normalized (between 0 and 1) value for a given data value. This implementation uses an power function to map neutral value to 0.5 and distribute other values around it.

Parameter Type Description
value Number

The data value

Returns:number | undefined
initialize(items,colorFunc)

Initialize the color model from a list of data items and using a function that returns the value used to compute the color for a given item.

Parameter Type Description
items Object[]

The data items.

colorFunc Function

The function that returns the value used to compute the color for particular data item.

Error in the documentation? Can’t find what you are looking for? Let us know!