plotly/plotly.js · warning

Full array edits are incompatible with other edits

Error message

Full array edits are incompatible with other edits

What it means

In applyFullArray Edits (src/plot_api/manage_arrays.js), an edit object with the empty-string key '' means a full-array replacement (a 'full array edit'). Plotly forbids mixing that with per-object/per-index edits in one relayout/React call and warns when other keys are present alongside ''.

Source

Thrown at src/plot_api/manage_arrays.js:78

 *  a (possibly modified for gui edits) nestedProperty constructor
 *  The modified version takes a 3rd argument, for a prefix to the attribute
 *  string necessary for storing GUI edits
 *
 * @returns {bool} `true` if it managed to complete drawing of the changes
 *  `false` would mean the parent should replot.
 */
exports.applyContainerArrayChanges = function applyContainerArrayChanges(gd, np, edits, flags, _nestedProperty) {
    var componentType = np.astr;
    var supplyComponentDefaults = Registry.getComponentMethod(componentType, 'supplyLayoutDefaults');
    var draw = Registry.getComponentMethod(componentType, 'draw');
    var drawOne = Registry.getComponentMethod(componentType, 'drawOne');
    var replotLater = flags.replot || flags.recalc || (supplyComponentDefaults === noop) || (draw === noop);
    var layout = gd.layout;
    var fullLayout = gd._fullLayout;

    if(edits['']) {
        if(Object.keys(edits).length > 1) {
            Loggers.warn('Full array edits are incompatible with other edits',
                componentType);
        }

        var fullVal = edits[''][''];

        if(isRemoveVal(fullVal)) np.set(null);
        else if(Array.isArray(fullVal)) np.set(fullVal);
        else {
            Loggers.warn('Unrecognized full array edit value', componentType, fullVal);
            return true;
        }

        if(replotLater) return false;

        supplyComponentDefaults(layout, fullLayout);
        draw(gd);
        return true;
    }

View on GitHub (pinned to 1d090e0b5f)

Solutions

  1. Split the edits into two calls: first apply the full-array edit ('' key), then apply per-index/object edits.
  2. Drop the '' full-array edit if you only need targeted changes.
  3. Drop the per-index edits if you intend to replace the whole array.
  4. Audit edit-building code so full replacements and incremental edits are never merged into one payload.

Example fix

// before
applyEdits({ '': newArr, 0: { x: 1 } }); // mixed
// after
applyEdits({ '': newArr });
applyEdits({ 0: { x: 1 } });
Defensive patterns

Strategy: validation

Validate before calling

function assertNotMixed(edits) {
  const keys = Object.keys(edits);
  if (edits[''] !== undefined && keys.length > 1) {
    throw new Error('Full array edits must not be combined with per-index edits');
  }
}

Type guard

function isFullArrayOnly(edits) { return Object.keys(edits).length === 1 && '' in edits; }

Prevention

When it happens

Trigger: A single Plotly.update/relayout style edit object containing both {'': newFullArray} and other keys like {'0': {...}} or named attribute edits for the same componentType (e.g. combining a whole new annotations array with edits to individual annotations).

Common situations: Programmatic edit builders that merge a full array reset with targeted per-index updates, or generic 'apply all pending edits' code that flattens different edit granularities into one object.

Related errors


AI-assisted analysis of plotly/plotly.js@1d090e0b5f (2026-09-02). Data as JSON: /api/errors/5cff07642459a3dd. Report an issue: GitHub.