Type Alias: ContourTrace
ts
type ContourTrace = Omit<CommonTraceAttributes, 'hovertext'> & CartesianTraceAttributes & object;Contour plot: level lines of a grid of values (uneven grids allowed), drawn as filled bands, a smooth heatmap or lines, with level labels along the lines, or constraint contours shading where the values satisfy an inequality.
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. |
autocontour? | boolean | Pick the contour levels automatically (at most ncontours, at nice round values). Defaults to false when contours.start and contours.end are given. |
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 | Draw the contours across gaps (non-numeric z), which are always filled from their neighbours for contouring (Plotly’s Laplace fill). false clips the drawing to the data, leaving holes at the gaps. Default: true for 1D z, else false. |
contours? | ContourTraceContours | Contour levels, coloring, labels and constraints. |
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). |
fillcolor? | string | Fill of the shaded region of constraint contours. Default: line.color (else the trace's colorway color) at half opacity. |
hoverongaps? | boolean | Show hover labels on gaps (grid points without a value, with connectgaps: false), with an empty z. |
hovertext? | DataColumn | Hover text per grid point (2D like z); takes precedence over text in hover. |
line? | ContourTraceLine | Contour lines. |
ncontours? | number | Maximum number of contour levels with autocontour (or without contours.size); the actual number is chosen to give nice round levels. Minimum: 1 |
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 grid point (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 at every grid point with contours.coloring: 'heatmap': %{z}, %{x}, %{y}, %{text}, with optional d3 formats (%{z:.1f}). Empty: no labels. |
transpose? | boolean | Swap rows and columns of a 2D z (z[column][row]). |
type | "contour" | Trace type. |
x? | DataColumn | X coordinates (numbers, dates or categories) of the grid points: one per column of z (extra values are ignored; missing ones continue the last step). Uneven spacing is fine. With 1D z, the x value of each point. |
x0? | unknown | Coordinate of the first column when x is not given (or xtype: 'scaled'); the next ones step by dx. |
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 grid points at x; 'scaled' (default without): at x0 + i × dx. |
y? | DataColumn | Y coordinates (numbers, dates or categories) of the grid points: one per row of z (extra values are ignored; missing ones continue the last step). Uneven spacing is fine. With 1D z, the y value of each point. |
y0? | unknown | Coordinate of the first row when y is not given (or ytype: 'scaled'); the next ones step by dy. |
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 grid points at y; 'scaled' (default without): at y0 + i × dy. |
z? | DataColumn | Values to contour: 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, contours draw above heatmaps and below bars and scatter traces (Plotly’s layer order). |