Function: diffFigures()
ts
function diffFigures(prev, next, registry): FigureDiff;Experimental
Diff two figure inputs (plan E1.8). Never mutates its arguments and never reads the contents of data arrays, so its cost is proportional to the size of the spec, not of the data.
Parameters
| Parameter | Type | Description |
|---|---|---|
prev | AnyFigure | The figure currently shown (as input, i.e. before defaults). |
next | AnyFigure | The figure passed to react. |
registry | Registry | Supplies trace and layout schemas, which decide which values are data arrays. |
Returns
Example
ts
const d = diffFigures(prev, next, registry);
if (!d.empty) {
const stages = planDiff(d, { registry, fullData, fullLayout });
// reuse scene objects for d.traces.matched, build d.traces.added, dispose d.traces.removed
}