Adds heatmap coloring to cells. By default colors based on min and max
in the data and the magma color scheme via d3-scale
.
This plugin provides the following fields:
- id:
heatmap
- tdClassName:
has-heatmap
- summarize: minMaxSummarizer
- tdStyle
- columnTest
- ColorSchemes
Plugin Options
Plugin options found in column.plugins.heatmap
since the plugin has id heatmap
.
- domain {Number[]} the domain to use for the color scale, if not provided, uses columnSummary min and max
- backgroundScale {Function} the scale to use for the background-color
- colorScale {Function} the scale to use for the color
- colorShift {Number} if provided, shifts the background color to create the foreground color. It is a number between 0 and 1 describing how far to shift.
- colorScheme {String} if provided, specifies which d3-scale/d3-scale-chromatic special scale to use. Options are: Viridis, Inferno, Magma, Plasma, Warm, Cool, Rainbow, CubehelixDefault, BrBG, PRGn, PiYG, PuOr, RdBu, RdGy, RdYlBu, RdYlGn, Spectral, Blues, Greens, Greys, Oranges, Purples, Reds, BuGn, BuPu, GnBu, OrRd, PuBuGn, PuBu, PuRd, RdPu, YlGnBu, YlGn, YlOrBr, YlOrRd
- reverseColors {Boolean} If true, the colors in the scheme will be applied in reverse order
- Source:
Members
(inner, constant) ColorSchemes :String
Special color schemes available via d3-scale and d3-scale-chromatic
interpolate${scheme}(t)
functions.
See https://github.com/d3/d3-scale-chromatic and https://github.com/d3/d3-scale#interpolateViridis
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
Viridis |
String | |
Inferno |
String | |
Magma |
String | |
Plasma |
String | |
Warm |
String | |
Cool |
String | |
Rainbow |
String | |
CubehelixDefault |
String | |
BrBG |
String | |
PRGn |
String | |
PiYG |
String | |
PuOr |
String | |
RdBu |
String | |
RdGy |
String | |
RdYlBu |
String | |
RdYlGn |
String | |
Spectral |
String | |
Blues |
String | |
Greens |
String | |
Greys |
String | |
Oranges |
String | |
Purples |
String | |
Reds |
String | |
BuGn |
String | |
BuPu |
String | |
GnBu |
String | |
OrRd |
String | |
PuBuGn |
String | |
PuBu |
String | |
PuRd |
String | |
RdPu |
String | |
YlGnBu |
String | |
YlGn |
String | |
YlOrBr |
String | |
YlOrRd |
String |
- Source:
Methods
(inner) columnTest(column) → {Boolean}
Apply this plugin if it is a number and plugins.heatmap isn't explicitly set to false OR if plugins.heatmap is set
Parameters:
Name | Type | Description |
---|---|---|
column |
Object | The column definition |
- Source:
Returns:
true to run the plugin on the column, false to not
- Type
- Boolean
(inner) tdStyle(cellData, props) → {Object}
Compute the style for the td elements by setting the background and color based on the sort value.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cellData |
Object | the data for the cell |
|||||||||||||||
props |
Object | Additional properties for the cell Properties
|
- Source:
Returns:
the style object
- Type
- Object