Construct a LUT object, specifying any amount of its properties.
Example 1, LUT with interpolation disabled.
const lut = new LUT({
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 10, color: ColorRGBA( 255, 0, 0 ) },
{ value: 100, color: ColorRGBA( 0, 255, 0 ) }
],
interpolate: false
})
Example 2, LUT with interpolation enabled.
const lut = new LUT({
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 10, color: ColorRGBA( 255, 0, 0 ) },
{ value: 100, color: ColorRGBA( 0, 255, 0 ) }
],
interpolate: true
})
Readonly
colorFallback color, which is used if LUT steps are defined as empty or defined incorrectly.
Default value: Black.
Readonly
interpolateInterpolation behavior of the LUT, which describes the distribution of color for the data:
Default value: true.
Readonly
isValidation flag which describes that the LUT is configured correctly.
Readonly
lengthAmount of LUT steps.
Readonly
maxMaximal value of the entire LUT.
Readonly
minMinimal value of the entire LUT.
Readonly
Beta
percentageWhether values represent percentages or explicit values.
This is a beta feature, which mainly means that it is not supported by all chart features yet. The most important features should have support for it:
This feature is currently not optimized for real-time applications where the value range may change frequently.
Thus, if you are supplying data updates frequently, there is a large performance down side to having percentageValues
enabled compared to disabled.
This can be optimized in the future, so please contact your account manager if you have an use case where this is relevant.
// Example of percentage LUT
const lut = new LUT({
interpolate: true,
percentageValues: true,
steps: [
{ value: 0, color: ColorCSS('black') }, // lowest value will be black
{ value: 1, color: ColorCSS('red') }, // highest value will be red
]
})
Readonly
stepsThe collection of LUTSteps, which specifies the colors and their corresponding values to describe the location and color of a transition point in a gradient. Each represented as a pair object {value: number, color: Color}.
Default value: [].
Readonly
subrangesCollection of subranges.
Readonly
titleTitle of the LUT, which describes the visualization.
Default value: Empty string.
Readonly
typeReadonly
unitsUnits of the data-values in the LUT, which describes the data domain.
Default value: Empty string.
Get the color associated with the given value.
Example:
const color = lut.getColors( 5 )
Associated color if the LUT is valid, otherwise fallback color.
Single value.
Get the colors associated with the given collection of values.
Example:
const colors = lut.getColors( [ 5, 10, 15 ] )
Collection of associated colors if the LUT is valid, otherwise fallback colors.
1D collection of value.
Get the colors associated with the given collection Matrix2D of values.
Example:
const colors = lut.getColors(
[
[ 3, 7, 9 ],
[ 5, 10, 15 ]
]
)
Collection of associated colors if the LUT is valid, otherwise fallback colors.
2D collection of values.
Beta
Get whether values represent percentages or explicit values.
See percentageValues for more information.
Boolean.
Set interpolation behavior of the LUT, which describes the distribution of color for the data:
Interpolation behavior: True - gradient, False - uniform.
Beta
Set whether values represent percentages or explicit values.
See percentageValues for more information.
Boolean.
Style class for describing a table of colors with associated lookup values (numbers).
Instances of LUT, like all LCJS style classes, are immutable, meaning that its setters don't modify the actual object, but instead return a completely new modified object.
Properties of LUT:
steps
: List of color steps (color + number value pair).interpolate
:true
enables automatic linear interpolation between color steps.LUT Behavior:
Example 1, LUT with interpolation disabled.
Example 2, LUT with interpolation enabled.
LUT Usage:
Use LUT with: