Type Alias: ImageTrace
ts
type ImageTrace = Omit<CommonTraceAttributes, 'hovertext' | 'hoverinfo' | 'hovertemplate'> &
CartesianTraceAttributes &
object;Image: pixel colors (RGB, RGBA or HSL components, or an encoded picture) drawn as one texture on the axes, with pixel hover.
Type Declaration
| Name | Type | Description |
|---|---|---|
colormodel? | "rgb" | "rgba" | "rgba256" | "hsl" | "hsla" | How z components are read: 'rgb' (default), 'rgba' (alpha 0–1), 'rgba256' (alpha 0–255; always used for source), 'hsl' or 'hsla'. |
dx? | number | Pixel width in x units. |
dy? | number | Pixel height in y units. |
hoverinfo? | PerPoint< | "x" | "y" | "z" | "color" | "name" | "text" | `${"x" | "y" | "z" | "color" | "name" | "text"}+${string}` | "all" | "none" | "skip"> | Which fields hover labels show: z is the pixel's components as given, color the color they make in the color model (RGB: [r, g, b]). |
hovertemplate? | PerPoint<string | number> | Template for hover labels: %{x}, %{y}, %{z} (the pixel, %{z[0]} … its components), %{color} (scaled color, %{color[0]} …), %{colormodel}. |
hovertext? | DataColumn | Hover text per pixel (2D like z); takes precedence over text. |
source? | string | The picture as a base64 data URI ('data:image/png;base64,…'; PNG, JPEG, GIF, WebP or BMP), used when z is not given. Other URLs are ignored, as in Plotly. |
text? | DataColumn | Text per pixel (2D like z), shown in hover labels. |
type | "image" | Trace type. |
x0? | unknown | X coordinate of the center of the first pixel column. |
y0? | unknown | Y coordinate of the center of the first pixel row. |
z? | DataColumn | Pixel colors: z[row][column] is an array of color components in colormodel (e.g. [r, g, b]). Row 0 is drawn at y0, at the top by default. |
zmax? | readonly number[] | Per component, the z value mapped to the last value of the color model's range (0–255 for r, g, b; 0–1 for alpha, or 0–255 with rgba256; 0–360 for hue; 0–100 for saturation and lightness). Default: that range, so values are used as they are. |
zmin? | readonly number[] | Per component, the z value mapped to the first value of the color model's range (0–255 for r, g, b; 0–1 for alpha, or 0–255 with rgba256; 0–360 for hue; 0–100 for saturation and lightness). Default: that range, so values are used as they are. |
zorder? | number | Stacking order among the traces of a subplot: higher is drawn on top. At equal zorder, images draw below every other trace type (Plotly’s layer order). |
zsmooth? | "fast" | false | Pixel smoothing: none (false, square pixels) or 'fast' (bilinear, the GPU's linear filtering). |