Variable: commonTraceAttributes
ts
const commonTraceAttributes: object;Experimental
Attributes every trace has.
Type Declaration
| Name | Type |
|---|---|
customdata | AttrSpec<DataArray, DataArray | undefined> |
dataset | Attr<string, { description: "Name of a figure-level dataset (`figure.datasets`). Data arrays, and per-point attributes whose values cannot start with `@` (such as colors and sizes), may then reference its columns as `'@column'`; on string attributes such as `text`, `'@…'` stays literal text."; editType: "calc"; noBlank: true; strict: true; }> |
hoverinfo | Attr< | "none" | "x" | "y" | "all" | "z" | "text" | "name" | `x+${string}` | `y+${string}` | `z+${string}` | `text+${string}` | `name+${string}` | "skip" | readonly ( | "none" | "x" | "y" | "all" | "z" | "text" | "name" | `x+${string}` | `y+${string}` | `z+${string}` | `text+${string}` | `name+${string}` | "skip")[], { arrayOk: true; description: "Which fields hover labels show; `'skip'` also turns hover events off for this trace. Default `'all'`."; editType: "none"; extras: readonly ["all", "none", "skip"]; flags: readonly ["x", "y", "z", "text", "name"]; }> |
hoverlabel | ObjectNode<{ align: Attr< | "auto" | "left" | "right" | readonly ("auto" | "left" | "right")[], { arrayOk: true; description: "Text alignment inside labels."; editType: "none"; values: readonly ["left", "right", "auto"]; }>; bgcolor: Attr<string | readonly string[], { arrayOk: true; description: "Label background. Default: the point color."; editType: "none"; }>; bordercolor: Attr<string | readonly string[], { arrayOk: true; description: "Label border. Default: contrasting with the background."; editType: "none"; }>; font: ObjectNode<{ color: Attr<string | readonly string[], { arrayOk: true; description: "Font color."; editType: "none"; }>; family: Attr<string | readonly string[], { arrayOk: true; description: "Font family."; editType: "none"; }>; size: Attr< | number | readonly number[] | TypedArray, { arrayOk: true; description: "Font size in px."; editType: "none"; min: 1; }>; }>; namelength: Attr< | number | readonly number[] | TypedArray, { arrayOk: true; description: "Characters of the trace name shown (`-1`: all, `0`: none)."; editType: "none"; min: -1; }>; }> |
hovertemplate | Attr<string | readonly string[], { arrayOk: true; description: "Template for hover labels, e.g. `'%{x}: %{y:.2f}<extra></extra>'` (d3-format / d3-time-format after `:` / `|`). Overrides `hoverinfo`."; editType: "none"; }> |
hovertext | Attr<string | readonly string[], { arrayOk: true; description: "Hover text per point; defaults to `text`."; dflt: ""; editType: "style"; }> |
ids | AttrSpec<DataArray, DataArray | undefined> |
legend | Attr<"legend" | `legend${number}`, { description: "The legend this trace's item is shown in: `'legend'` (`layout.legend`), `'legend2'` (`layout.legend2`), …."; dflt: "legend"; editType: readonly ["legend", "layout"]; }> |
legendgroup | Attr<string, { description: "Traces in the same legend group toggle together."; dflt: ""; editType: "legend"; }> |
legendgrouptitle | ObjectNode<{ font: ObjectNode<{ color: Attr<string, { description: "Font color."; editType: "legend"; }>; family: Attr<string, { description: "Font family."; editType: "legend"; }>; size: Attr<number, { description: "Font size in px."; editType: "legend"; min: 1; }>; style: Attr<"normal" | "italic", { description: "Font style."; editType: "legend"; values: readonly ["normal", "italic"]; }>; weight: Attr<number | "normal" | "bold", { description: "Font weight: a CSS numeric weight (1–1000), `normal` or `bold`."; editType: "legend"; extras: readonly ["normal", "bold"]; max: 1000; min: 1; }>; }>; text: Attr<string, { description: "Title heading this trace's legend group."; dflt: ""; editType: "legend"; }>; }> |
legendrank | Attr<number, { description: "Sort key for legend entries: lower ranks come first (top, or left). Ties keep trace order; traces default to 1000."; dflt: 1000; editType: "legend"; }> |
legendwidth | Attr<number, { description: "Width of this trace's item in horizontal legends, overriding `legend.entrywidth` (same units). Default: its text's."; editType: "legend"; min: 0; }> |
meta | AttrSpec<unknown, unknown> |
name | Attr<string, { description: "Trace name shown in the legend and hover labels. Defaults to `trace N`."; editType: readonly ["legend", "plot"]; }> |
opacity | Attr<number, { animatable: true; description: "Opacity of the whole trace."; dflt: 1; editType: "style"; max: 1; min: 0; }> |
selectedpoints | AttrSpec<unknown, unknown> |
showlegend | Attr<boolean, { description: "Whether this trace has a legend entry."; dflt: true; editType: readonly ["legend", "layout"]; }> |
styleRules | AttrSpec<readonly StyleRule[], readonly StyleRule[] | undefined> |
type | Attr<string, { description: "Trace type, e.g. `'scatter'`. Defaults to `'scatter'`."; editType: "calc"; noBlank: true; strict: true; }> |
uid | Attr<string, { description: "Stable identity used to match traces across updates, so reordered traces are moved instead of rebuilt."; editType: "plot"; }> |
uirevision | AttrSpec<unknown, unknown> |
visible | Attr<boolean | "legendonly", { description: "Whether the trace is drawn. `legendonly` hides it but keeps its (toggleable) legend entry."; dflt: true; editType: "calc"; values: readonly [true, false, "legendonly"]; }> |