Interface: TraceDefaultsContext
Experimental
Helpers passed to a trace module's supplyDefaults.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
defaultColor | readonly | string | Experimental This trace's colorway color (colorway[index % colorway.length]). |
fullLayout | readonly | FullLayout | Experimental The layout as far as it has been defaulted (base layout attributes are ready). |
index | readonly | number | Experimental Index of the trace in data. |
template | readonly | Record<string, unknown> | undefined | Experimental 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 Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
path | string |
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
| Parameter | Type |
|---|---|
path | string |
overrides? | Readonly<Record<string, unknown>> |
Returns
void