• Public
  • Public/Protected
  • All

Class LUT <TProps >

Lookup Table class stores information about values and its associated colors. It provides efficient lookup of the color based on provided value as well as linear and step interpolation between colors.

Instances of LUT are immutable, meaning that its setters don't modify the object, but instead return a completely new modified object.

PieChart, DonutChart, GaugeChart: When this LUT is set, the Charts will colorize the Slices based on Value property of the slice.

Can be used in PalettedFill style to colorize the data based on value.




  • Create a new color-value lookup table using LUTOptions.


    // create LUT from 0..100 with gradient steps.
    const lut = new LUT( {
     steps: [
          { value: 0, color: ColorRGBA( 0, 0, 0 ) },
          { value: 30, color: ColorRGBA( 255, 255, 0 ) },
          { value: 45, color: ColorRGBA( 255, 204, 0 ) },
          { value: 60, color: ColorRGBA( 255, 128, 0 ) },
          { value: 100, color: ColorRGBA( 255, 0, 0 ) }
     interpolate: true
     } )


    • options: LUTOptions

      Object containing parameters for creation of the LUT.

    Returns LUT



  • getColors(values: number): Color
  • getColors(values: number[]): Color[]
  • getColors(values: number[][]): Color[][]
  • Get the color associated with the given value.


    const color = lut.getColors( 5 )


    • values: number

      Single value.

    Returns Color

    Associated color if the LUT is valid, otherwise fallback color.

  • Get the colors associated with the given collection of values.


    const colors = lut.getColors( [ 5, 10, 15 ] )


    • values: number[]

      1D collection of value.

    Returns Color[]

    Collection of associated colors if the LUT is valid, otherwise fallback colors.

  • Get the colors associated with the given collection Matrix2D of values.


    const colors = lut.getColors(
       [ 3, 7, 9 ],
       [ 5, 10, 15 ]


    • values: number[][]

      2D collection of values.

    Returns Color[][]

    Collection of associated colors if the LUT is valid, otherwise fallback colors.


  • getFallbackColor(): Color
  • Get fallback color of value the LUT.

    Returns Color

    Color object.


  • getInterpolation(): boolean
  • Get interpolation behavior of the LUT.

    Returns boolean

    Intepolation behaviour state. True - gradient, False - uniform.


  • Get collection of LUT steps.

    Returns LUTStep[]

    Collection of steps.


  • getTitle(): string
  • Get title of the LUT.

    Returns string

    Title of the LUT as string.


  • getUnits(): string
  • Get units of the LUT.

    Returns string

    Units of the LUT as string.


  • setFallbackColor(color: Color): this
  • Set fallback color. The following color would be used as a backup. Meaning, the LUT might be configured incorrectly or the data is incorrect.


    • color: Color

      Color object.

    Returns this


  • setInterpolation(interpolate: boolean): this
  • Set interpolation behavior of the LUT, which describes the distribution of color for the data:

    • True: creates a gradient LUT using linear-interpolation (LERP) between colors, which were defined in the collection of steps.
    • False: creates a uniform LUT using step-function for each color to describe the range of values where this color is used.


    • interpolate: boolean

      Interpolation behavior: True - gradient, False - uniform.

    Returns this


  • Set new collection of LUT steps.


    • steps: LUTStep[]

      Collection of color-value pairs.

    Returns this


  • setTitle(title: string): this
  • Set title of the LUT, which describes the data.


    • title: string

      Title of the LUT.

    Returns this


  • setUnits(units: string): this
  • Set units of the data-values in the LUT, which describes the data domain.


    • units: string

      Units of the LUT.

    Returns this

Static Factory

  • Factory(values?: Partial<TProps> | Iterable<[string, any]>): Record<TProps> & Readonly<TProps>
  • Type parameters

    • TProps: Object


    • Optional values: Partial<TProps> | Iterable<[string, any]>

    Returns Record<TProps> & Readonly<TProps>

Static Record

  • Record(defaultValues: TProps, name?: undefined | string): Factory<TProps>
  • Unlike other types in Immutable.js, the Record() function creates a new Record Factory, which is a function that creates Record instances.

    See above for examples of using Record().

    Note: Record is a factory function and not a class, and does not use the new keyword during construction.

    Type parameters

    • TProps


    • defaultValues: TProps
    • Optional name: undefined | string

    Returns Factory<TProps>

Static getDescriptiveName

  • getDescriptiveName(record: Record<any>): string
  • Records allow passing a second parameter to supply a descriptive name that appears when converting a Record to a string or in any error messages. A descriptive name for any record can be accessed by using this method. If one was not provided, the string "Record" is returned.

    const { Record } = require('immutable')
    const Person = Record({
      name: null
    }, 'Person')
    var me = Person({ name: 'My Name' })
    me.toString() // "Person { "name": "My Name" }"
    Record.getDescriptiveName(me) // "Person"


    • record: Record<any>

    Returns string

Static isRecord

  • isRecord(maybeRecord: any): boolean
  • True if maybeRecord is an instance of a Record.


    • maybeRecord: any

    Returns boolean