plotly/plotly.js · warning

Unrecognized full array edit value

Error message

Unrecognized full array edit value

What it means

When a full-array edit ('' key) is applied, the replacement value must be null/removal (isRemoveVal) or an array. Any other value type (object, string, number, undefined) cannot be assigned to a component array, so Plotly warns, aborts this edit, and returns true (failed).

Source

Thrown at src/plot_api/manage_arrays.js:87

    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;
    }

    var componentNums = Object.keys(edits).map(Number).sort(sorterAsc);
    var componentArrayIn = np.get();
    var componentArray = componentArrayIn || [];
    // componentArrayFull is used just to keep splices in line between
    // full and input arrays, so private keys can be copied over after
    // redoing supplyDefaults
    // TODO: this assumes componentArray is in gd.layout - which will not be
    // true after we extend this to restyle

View on GitHub (pinned to 1d090e0b5f)

Solutions

  1. Wrap the value in an array: pass [{...}] instead of {...}.
  2. Use null (or the remove value) if the intent is to delete the component array.
  3. Check the attribute schema to confirm the target is arrayOk/array-typed before assigning.
  4. Validate the edit value type before building the edit payload.

Example fix

// before
Plotly.relayout(gd, 'annotations', {text: 'hi'});
// after
Plotly.relayout(gd, 'annotations', [{text: 'hi'}]);
Defensive patterns

Strategy: type-guard

Validate before calling

function assertFullArrayValue(v) {
  if (!(v === null || Array.isArray(v))) {
    throw new TypeError('Full array edit value must be null or an array');
  }
}

Type guard

function isFullArrayValue(v) { return v === null || Array.isArray(v); }

Prevention

When it happens

Trigger: Passing a non-array value where a full component array is expected, e.g. edits[''] = {x: 1} or edits[''] = 'annotations' instead of an array of annotation objects, via relayout/React-style edit machinery on an array-valued component.

Common situations: Confusing a single component object with the array that contains it (setting annotations to one object instead of [obj]), JSON transformations that unwrap arrays, or copying values from non-array attributes.

Related errors


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