Skip to content

Variable: commonTraceAttributes ​

ts
const commonTraceAttributes: object;

Experimental

Attributes every trace has.

Type Declaration ​

NameType
customdataAttrSpec<DataArray, DataArray | undefined>
datasetAttr<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; }>
hoverinfoAttr< | "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"]; }>
hoverlabelObjectNode<{ 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; }>; }>
hovertemplateAttr<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"; }>
hovertextAttr<string | readonly string[], { arrayOk: true; description: "Hover text per point; defaults to `text`."; dflt: ""; editType: "style"; }>
idsAttrSpec<DataArray, DataArray | undefined>
legendAttr<"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"]; }>
legendgroupAttr<string, { description: "Traces in the same legend group toggle together."; dflt: ""; editType: "legend"; }>
legendgrouptitleObjectNode<{ 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"; }>; }>
legendrankAttr<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"; }>
legendwidthAttr<number, { description: "Width of this trace's item in horizontal legends, overriding `legend.entrywidth` (same units). Default: its text's."; editType: "legend"; min: 0; }>
metaAttrSpec<unknown, unknown>
nameAttr<string, { description: "Trace name shown in the legend and hover labels. Defaults to `trace N`."; editType: readonly ["legend", "plot"]; }>
opacityAttr<number, { animatable: true; description: "Opacity of the whole trace."; dflt: 1; editType: "style"; max: 1; min: 0; }>
selectedpointsAttrSpec<unknown, unknown>
showlegendAttr<boolean, { description: "Whether this trace has a legend entry."; dflt: true; editType: readonly ["legend", "layout"]; }>
styleRulesAttrSpec<readonly StyleRule[], readonly StyleRule[] | undefined>
typeAttr<string, { description: "Trace type, e.g. `'scatter'`. Defaults to `'scatter'`."; editType: "calc"; noBlank: true; strict: true; }>
uidAttr<string, { description: "Stable identity used to match traces across updates, so reordered traces are moved instead of rebuilt."; editType: "plot"; }>
uirevisionAttrSpec<unknown, unknown>
visibleAttr<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"]; }>

Released under the MIT License.