{"record":{"id":"743985c3a189ba31","repo":"plotly/plotly.js","slug":"unrecognized-full-array-edit-value","errorCode":null,"errorMessage":"Unrecognized full array edit value","messagePattern":"Unrecognized full array edit value","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/plot_api/manage_arrays.js","lineNumber":87,"sourceCode":"    var supplyComponentDefaults = Registry.getComponentMethod(componentType, 'supplyLayoutDefaults');\n    var draw = Registry.getComponentMethod(componentType, 'draw');\n    var drawOne = Registry.getComponentMethod(componentType, 'drawOne');\n    var replotLater = flags.replot || flags.recalc || (supplyComponentDefaults === noop) || (draw === noop);\n    var layout = gd.layout;\n    var fullLayout = gd._fullLayout;\n\n    if(edits['']) {\n        if(Object.keys(edits).length > 1) {\n            Loggers.warn('Full array edits are incompatible with other edits',\n                componentType);\n        }\n\n        var fullVal = edits[''][''];\n\n        if(isRemoveVal(fullVal)) np.set(null);\n        else if(Array.isArray(fullVal)) np.set(fullVal);\n        else {\n            Loggers.warn('Unrecognized full array edit value', componentType, fullVal);\n            return true;\n        }\n\n        if(replotLater) return false;\n\n        supplyComponentDefaults(layout, fullLayout);\n        draw(gd);\n        return true;\n    }\n\n    var componentNums = Object.keys(edits).map(Number).sort(sorterAsc);\n    var componentArrayIn = np.get();\n    var componentArray = componentArrayIn || [];\n    // componentArrayFull is used just to keep splices in line between\n    // full and input arrays, so private keys can be copied over after\n    // redoing supplyDefaults\n    // TODO: this assumes componentArray is in gd.layout - which will not be\n    // true after we extend this to restyle","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plot_api/manage_arrays.js#L69-L105","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Wrap the value in an array: pass [{...}] instead of {...}.","Use null (or the remove value) if the intent is to delete the component array.","Check the attribute schema to confirm the target is arrayOk/array-typed before assigning.","Validate the edit value type before building the edit payload."],"exampleFix":"// before\nPlotly.relayout(gd, 'annotations', {text: 'hi'});\n// after\nPlotly.relayout(gd, 'annotations', [{text: 'hi'}]);","handlingStrategy":"type-guard","validationCode":"function assertFullArrayValue(v) {\n  if (!(v === null || Array.isArray(v))) {\n    throw new TypeError('Full array edit value must be null or an array');\n  }\n}","typeGuard":"function isFullArrayValue(v) { return v === null || Array.isArray(v); }","tryCatchPattern":null,"preventionTips":["Wrap single objects in an array before assigning to array-valued components.","Check plotly's schema to confirm the attribute is array-typed.","Guard deserialization paths that might unwrap arrays."],"tags":["relayout","type-mismatch","array-edits"],"backgroundTag":"invalid-edit-value-type","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}