Skip to content

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 ​

NameTypeDescription
autocolorscale?booleanPick 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?booleanCompute the color domain from the numeric z or surfacecolor values. Defaults to false when both cmin and cmax are given.
cmax?numberValue mapped to the last colorscale color (with cmin; turns cauto off).
cmid?numberWith cauto, widen the automatic domain so it is symmetric around this value (diverging data).
cmin?numberValue 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?ColorbarThe 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?booleanFill the gaps in z by interpolating their neighbours (Plotly's Laplace fill) instead of leaving holes.
contours?SurfaceTraceContoursContour lines of constant x, y and z.
hidesurface?booleanHide the surface itself, keeping its contour lines and wireframe.
hovertext?DataColumnHover text per point (a 2D array like z, or one string); takes precedence over text.
lighting?SurfaceTraceLightingPlotly's lighting model: coefficients of the ambient, diffuse and specular light. With scene.lighting, they scale the scene's lights.
lightposition?SurfaceTraceLightpositionPosition of the light (Plotly's model, without scene.lighting), in clip space: it moves with the view.
material?Bar3dTraceMaterialThe material of the surface (Holochart extension). Plotly figures keep the default, plotly.
opacityscale?unknownOpacity 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?booleanReverse 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?booleanShow a colorbar for this colorscale (drawn by the colorbar component, plan E5.3).
surfacecolor?DataColumnValues the colorscale colors the surface by, a 2D array like z. Default: z itself.
text?DataColumnText per point (a 2D array like z, or one string): shown in hover labels and as %{text}.
type"surface"Trace type.
wireframe?SurfaceTraceWireframeA wireframe over the surface: its grid lines, drawn in the shader (Holochart extension, not in Plotly).
x?DataColumnx 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?stringd3 number or date format of x values in hover labels. Default: the axis format.
y?DataColumny coordinates: one per row of z, or a 2D array like z. Default: the row indices.
yhoverformat?stringd3 number or date format of y values in hover labels. Default: the axis format.
z?DataColumnHeights: a 2D array, z[row][column] (rows along y, columns along x). Non-numeric entries are gaps (see connectgaps).
zhoverformat?stringd3 number or date format of z values in hover labels. Default: the axis format.

Released under the MIT License.