Function: validate()
ts
function validate(data, layout, registry, options?): Issue[];Validate a figure and return every issue found (empty when valid).
Parameters
| Parameter | Type | Description |
|---|---|---|
data | unknown | The data array (anything; non-arrays are reported). |
layout | unknown | The layout object. |
registry | Registry | Supplies trace schemas, the merged layout schema and template names. |
options | ValidateOptions | Optional config (validated against the config schema) and datasets (so '@column' references are resolved before checking, plan E1.6). |
Returns
Issue[]
Example
ts
validate([{ type: 'scatter', mode: 'line' }], {}, registry);
// [{ path: 'data[0].mode', message: "invalid value 'line'; expected any combination of …" }]