Skip to content

Interface: TraceDefaultsContext ​

Experimental

Helpers passed to a trace module's supplyDefaults.

Properties ​

PropertyModifierTypeDescription
defaultColorreadonlystringExperimental This trace's colorway color (colorway[index % colorway.length]).
fullLayoutreadonlyFullLayoutExperimental The layout as far as it has been defaulted (base layout attributes are ready).
indexreadonlynumberExperimental Index of the trace in data.
templatereadonlyRecord<string, unknown> | undefinedExperimental The template trace for this trace (already cycled), if any.

Methods ​

coerce() ​

ts
coerce<T>(path, dflt?): T;

Experimental

Coerce the attribute at path into the full trace and return its value. Precedence: user input > template > dflt argument > schema dflt. Invalid values fall through to the next source.

Type Parameters ​

Type ParameterDefault type
Tunknown

Parameters ​

ParameterType
pathstring
dflt?unknown

Returns ​

T


coerceContainer() ​

ts
coerceContainer(path, overrides?): void;

Experimental

Coerce every attribute of the container at path (e.g. 'marker.line'). overrides replaces schema defaults by relative path (e.g. { family: fullLayout.font.family }).

Parameters ​

ParameterType
pathstring
overrides?Readonly<Record<string, unknown>>

Returns ​

void

Released under the MIT License.