Skip to content

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 ​

NameTypeDescription
autocolorscale?booleanPick 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?ColorbarThe 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?booleanFill gaps by interpolating their neighbours (Plotly’s Laplace fill). Default: true for 1D z with zsmooth, else false.
dx?numberStep between columns when x is not given (milliseconds on date axes).
dy?numberStep between rows when y is not given (milliseconds on date axes).
hoverongaps?booleanShow hover labels on gaps (cells without a value), with an empty z.
hovertext?DataColumnHover text per cell (2D like z); takes precedence over text in hover.
reversescale?booleanReverse the colorscale (the lowest value gets the last color).
showscale?booleanShow a colorbar for the colorscale (drawn by the colorbar component).
text?DataColumnText per cell (2D like z, or 1D with column data): shown in hover labels and as %{text} in templates.
textfont?Histogram2dTraceTextfontFont of the cell labels (texttemplate).
texttemplate?stringLabel drawn in every cell: %{z}, %{x}, %{y} (cell centers), %{text}, with optional d3 formats (%{z:.1f}). Empty: no labels.
transpose?booleanSwap rows and columns of a 2D z (z[column][row]).
type"heatmap"Trace type.
x?DataColumnX 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?unknownCenter of the first column when x is not given (or xtype: 'scaled'); the next ones step by dx.
xgap?numberHorizontal gap between cells, in px (only without zsmooth). Minimum: 0
xhoverformat?stringd3 number or date format of x values in hover labels. Default: the axis format.
xperiod?unknownOnly 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?unknownA 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?DataColumnY 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?unknownCenter of the first row when y is not given (or ytype: 'scaled'); the next ones step by dy.
ygap?numberVertical gap between cells, in px (only without zsmooth). Minimum: 0
yhoverformat?stringd3 number or date format of y values in hover labels. Default: the axis format.
yperiod?unknownOnly 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?unknownA 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?DataColumnCell 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?booleanCompute the color domain from the aggregated values. Defaults to false when both zmin and zmax are given.
zhoverformat?stringd3 number format of z values in hover labels (and %{z} in templates).
zmax?numberValue mapped to the last colorscale color (with zmin; turns zauto off).
zmid?numberWith zauto, widen the automatic domain so it is symmetric around this value (diverging data).
zmin?numberValue mapped to the first colorscale color (with zmax; turns zauto off).
zorder?numberStacking 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" | falseCell 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.

Released under the MIT License.