Construct a PalettedFill object, specifying any amount of its properties.
// Example 1, palette by 'y' coordinate.
const paletteY = new PalettedFill({
lookUpProperty: 'y',
lut: new LUT({
interpolate: true,
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 10, color: ColorRGBA( 255, 0, 0 ) },
{ value: 20, color: ColorRGBA( 0, 255, 0 ) },
{ value: 30, color: ColorRGBA( 0, 0,255 ) },
]
})
})
// Example 2, palette by user supplied data point values.
const paletteValue = new PalettedFill({
lookUpProperty: 'value',
lut: new LUT({
interpolate: true,
steps: [
{ value: 0, color: ColorRGBA( 0, 0, 0 ) },
{ value: 100, color: ColorRGBA( 255, 0, 0 ) },
]
})
})
For more details, see LUT, and LookUpProperty.
Object containing any amount of PalettedFill properties.
Get automatically computed highlight style.
FillStyle object
Get look up property of PalettedFill.
Get LUT lookup table.
LUT object.
Construct a new PalettedFill object based on this one, but with modified 'lookUpProperty'.
Example:
palettedFill.setLookUpProperty( 'y' )
New PalettedFill object.
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.
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"
True if maybeRecord
is an instance of a Record.
Style class for describing a dynamically looked up fill color. Using a PalettedFill, each data point (or even pixel) can be colored individually. The basis of coloring can be configured extensively, with a variety of different option combinations (read below for details).
Instances of PalettedFill, 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 PalettedFill:
lut
: color lookup table. Essentially a list of colors paired with numeric values. See LUT for more details.lookUpProperty
: selects basis of color lookup. See LookUpProperty for possible options.PalettedFill Usage:
PalettedFill can be used with a select group of features:
// Example 1, paletted points fill by 'y' coordinates. PointSeries.setPointFillStyle(new PalettedFill({ lookUpProperty: 'y', lut: new LUT({ interpolate: true, steps: [ { value: 0, color: ColorRGBA( 0, 0, 0 ) }, { value: 10, color: ColorRGBA( 255, 0, 0 ) }, { value: 20, color: ColorRGBA( 0, 255, 0 ) }, { value: 30, color: ColorRGBA( 0, 0,255 ) }, ] }) }))
// Example 2, paletted points fill by user supplied data point values. PointSeries .setPointFillStyle(new PalettedFill({ lookUpProperty: 'value', lut: new LUT({ interpolate: true, steps: [ { value: 0, color: ColorRGBA( 0, 0, 0 ) }, { value: 100, color: ColorRGBA( 255, 0, 0 ) }, ] }) })) .add([ { x: Math.random() * 100, y: Math.random() * 100, value: Math.random() * 100 }, { x: Math.random() * 100, y: Math.random() * 100, value: Math.random() * 100 }, { x: Math.random() * 100, y: Math.random() * 100, value: Math.random() * 100 }, { x: Math.random() * 100, y: Math.random() * 100, value: Math.random() * 100 }, { x: Math.random() * 100, y: Math.random() * 100, value: Math.random() * 100 }, ])
Related information:
For more fill styles, see: