Type Alias: SurfaceTrace
ts
type SurfaceTrace = Omit<CommonTraceAttributes, 'hovertext'> & object;Surface: a grid of heights drawn as a lit 3D surface, built on the GPU from a height texture, with contour lines, projections and an optional wireframe.
Type Declaration
| Name | Type | Description |
|---|---|---|
autocolorscale? | boolean | Pick the colorscale from the sign of the color domain (Reds for ≥ 0, Blues for ≤ 0, RdBu across 0). Defaults to true unless colorscale is given. |
cauto? | boolean | Compute the color domain from the numeric z or surfacecolor values. Defaults to false when both cmin and cmax are given. |
cmax? | number | Value mapped to the last colorscale color (with cmin; turns cauto off). |
cmid? | number | With cauto, widen the automatic domain so it is symmetric around this value (diverging data). |
cmin? | number | Value mapped to the first colorscale color (with cmax; turns cauto off). |
coloraxis? | "coloraxis" | `coloraxis${number}` | Share a colorscale and domain with other traces through layout.coloraxis ('coloraxis', 'coloraxis2', …). Overrides this container's colorscale attributes. |
colorbar? | Colorbar | The colorbar of this colorscale (plan E5.3). |
colorscale? | | ColorScale | readonly string[] | readonly readonly (number | string)[][] | Colorscale for numeric z or surfacecolor values: a name ('Viridis', 'RdBu', …), a list of colors, or [position, color] stops from 0 to 1. |
connectgaps? | boolean | Fill the gaps in z by interpolating their neighbours (Plotly's Laplace fill) instead of leaving holes. |
contours? | SurfaceTraceContours | Contour lines of constant x, y and z. |
hidesurface? | boolean | Hide the surface itself, keeping its contour lines and wireframe. |
hovertext? | DataColumn | Hover text per point (a 2D array like z, or one string); takes precedence over text. |
lighting? | SurfaceTraceLighting | Plotly's lighting model: coefficients of the ambient, diffuse and specular light. With scene.lighting, they scale the scene's lights. |
lightposition? | SurfaceTraceLightposition | Position of the light (Plotly's model, without scene.lighting), in clip space: it moves with the view. |
material? | Bar3dTraceMaterial | The material of the surface (Holochart extension). Plotly figures keep the default, plotly. |
opacityscale? | unknown | Opacity by color value, like a colorscale: [[0, 0.1], [0.5, 1], [1, 0.4]] (positions 0–1 of the color domain, opacities 0–1), or 'max' (the highest values opaque, the lowest faded to 0.1), 'min' (the reverse) or 'extremes' (both ends opaque, the middle faded). |
reversescale? | boolean | Reverse the colorscale (the lowest value gets the last color). |
scene? | "scene" | `scene${number}` | The 3D scene this trace is drawn in: 'scene' (layout.scene), 'scene2' (layout.scene2), …. |
showscale? | boolean | Show a colorbar for this colorscale (drawn by the colorbar component, plan E5.3). |
surfacecolor? | DataColumn | Values the colorscale colors the surface by, a 2D array like z. Default: z itself. |
text? | DataColumn | Text per point (a 2D array like z, or one string): shown in hover labels and as %{text}. |
type | "surface" | Trace type. |
wireframe? | SurfaceTraceWireframe | A wireframe over the surface: its grid lines, drawn in the shader (Holochart extension, not in Plotly). |
x? | DataColumn | x coordinates (numbers, dates or categories): one per column of z, or a 2D array like z (one per point, for grids that are not rectangular in x and y). Default: the column indices. |
xhoverformat? | string | d3 number or date format of x values in hover labels. Default: the axis format. |
y? | DataColumn | y coordinates: one per row of z, or a 2D array like z. Default: the row indices. |
yhoverformat? | string | d3 number or date format of y values in hover labels. Default: the axis format. |
z? | DataColumn | Heights: a 2D array, z[row][column] (rows along y, columns along x). Non-numeric entries are gaps (see connectgaps). |
zhoverformat? | string | d3 number or date format of z values in hover labels. Default: the axis format. |