Type Alias: BaseHeatmapTrace
ts
type BaseHeatmapTrace = Omit<CommonTraceAttributes, 'hovertext'> &
CartesianTraceAttributes &
object;Heatmap: a grid of values drawn as colored cells (one GPU texture with a colorscale lookup), with optional cell labels.
Type Declaration
| Name | Type | Description |
|---|---|---|
autocolorscale? | boolean | Pick the colorscale from the sign of the color domain (layout.colorscale.sequential, sequentialminus or diverging) instead of colorscale. |
coloraxis? | "coloraxis" | `coloraxis${number}` | Share a colorscale and domain with other traces through layout.coloraxis ('coloraxis', 'coloraxis2', …). Overrides this trace's colorscale attributes. |
colorbar? | Colorbar | The colorbar of this colorscale (plan E5.3). |
colorscale? | | ColorScale | readonly string[] | readonly readonly (number | string)[][] | Colorscale of the aggregated values: a name ('Viridis', 'RdBu', …), a list of colors, or [position, color] stops from 0 to 1. Default: Plotly's RdBu; the default holochart template uses its sequential neon plasma. |
connectgaps? | boolean | Fill gaps by interpolating their neighbours (Plotly’s Laplace fill). Default: true for 1D z with zsmooth, else false. |
dx? | number | Step between columns when x is not given (milliseconds on date axes). |
dy? | number | Step between rows when y is not given (milliseconds on date axes). |
hoverongaps? | boolean | Show hover labels on gaps (cells without a value), with an empty z. |
hovertext? | DataColumn | Hover text per cell (2D like z); takes precedence over text in hover. |
reversescale? | boolean | Reverse the colorscale (the lowest value gets the last color). |
showscale? | boolean | Show a colorbar for the colorscale (drawn by the colorbar component). |
text? | DataColumn | Text per cell (2D like z, or 1D with column data): shown in hover labels and as %{text} in templates. |
textfont? | Histogram2dTraceTextfont | Font of the cell labels (texttemplate). |
texttemplate? | string | Label drawn in every cell: %{z}, %{x}, %{y} (cell centers), %{text}, with optional d3 formats (%{z:.1f}). Empty: no labels. |
transpose? | boolean | Swap rows and columns of a 2D z (z[column][row]). |
type | "heatmap" | Trace type. |
x? | DataColumn | X coordinates (numbers, dates or categories): one per column of z (cell centers; the cell edges are halfway between them) or one more (the cell edges). With 1D z, the x value of each point. |
x0? | unknown | Center of the first column when x is not given (or xtype: 'scaled'); the next ones step by dx. |
xgap? | number | Horizontal gap between cells, in px (only without zsmooth). Minimum: 0 |
xhoverformat? | string | d3 number or date format of x values in hover labels. Default: the axis format. |
xperiod? | unknown | Only on date or linear x axes: snap each x value to its period of this length (ms, or 'M<n>' months on date axes), positioned per xperiodalignment. |
xperiod0? | unknown | A period boundary for xperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise. |
xperiodalignment? | "start" | "middle" | "end" | Where points sit within their xperiod. |
xtype? | "array" | "scaled" | 'array' (default with x): place the cells at x; 'scaled' (default without): at x0 + i × dx. |
y? | DataColumn | Y coordinates (numbers, dates or categories): one per row of z (cell centers; the cell edges are halfway between them) or one more (the cell edges). With 1D z, the y value of each point. |
y0? | unknown | Center of the first row when y is not given (or ytype: 'scaled'); the next ones step by dy. |
ygap? | number | Vertical gap between cells, in px (only without zsmooth). Minimum: 0 |
yhoverformat? | string | d3 number or date format of y values in hover labels. Default: the axis format. |
yperiod? | unknown | Only on date or linear y axes: snap each y value to its period of this length (ms, or 'M<n>' months on date axes), positioned per yperiodalignment. |
yperiod0? | unknown | A period boundary for yperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise. |
yperiodalignment? | "start" | "middle" | "end" | Where points sit within their yperiod. |
ytype? | "array" | "scaled" | 'array' (default with y): place the cells at y; 'scaled' (default without): at y0 + i × dy. |
z? | DataColumn | Cell values: a 2D array (z[row][column], rows along y), or a 1D array with x and y columns (one value per point, placed on the grid of their distinct x and y values). Non-numeric entries are gaps. |
zauto? | boolean | Compute the color domain from the aggregated values. Defaults to false when both zmin and zmax are given. |
zhoverformat? | string | d3 number format of z values in hover labels (and %{z} in templates). |
zmax? | number | Value mapped to the last colorscale color (with zmin; turns zauto off). |
zmid? | number | With zauto, widen the automatic domain so it is symmetric around this value (diverging data). |
zmin? | number | Value mapped to the first colorscale color (with zmax; turns zauto off). |
zorder? | number | Stacking order among the traces of a subplot: higher is drawn on top. At equal zorder, heatmaps draw below contours, bars and scatter traces (Plotly’s layer order). |
zsmooth? | "fast" | "best" | false | Cell smoothing: none (false, flat cells), 'fast' (bilinear between cell centers by cell index; off on log axes and uneven grids, as in Plotly) or 'best' (bilinear between cell centers in data space). Drawn on the GPU either way. |