{"record":{"id":"707d8bcd7c298a37","repo":"plotly/plotly.js","slug":"unrecognized-full-object-edit-value","errorCode":null,"errorMessage":"Unrecognized full object edit value","messagePattern":"Unrecognized full object edit value","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/plot_api/manage_arrays.js","lineNumber":146,"sourceCode":"            Loggers.warn('index out of range', componentType, componentNum);\n            continue;\n        }\n\n        if(objVal !== undefined) {\n            if(objKeys.length > 1) {\n                Loggers.warn(\n                    'Insertion & removal are incompatible with edits to the same index.',\n                    componentType, componentNum);\n            }\n\n            if(isRemoveVal(objVal)) {\n                deletes.push(componentNum);\n            } else if(adding) {\n                if(objVal === 'add') objVal = {};\n                componentArray.splice(componentNum, 0, objVal);\n                if(componentArrayFull) componentArrayFull.splice(componentNum, 0, {});\n            } else {\n                Loggers.warn('Unrecognized full object edit value',\n                    componentType, componentNum, objVal);\n            }\n\n            if(firstIndexChange === -1) firstIndexChange = componentNum;\n        } else {\n            for(j = 0; j < objKeys.length; j++) {\n                prefix = componentType + '[' + componentNum + '].';\n                _nestedProperty(componentArray[componentNum], objKeys[j], prefix)\n                    .set(objEdits[objKeys[j]]);\n            }\n        }\n    }\n\n    // now do deletes\n    for(i = deletes.length - 1; i >= 0; i--) {\n        componentArray.splice(deletes[i], 1);\n        // TODO: this drops private keys that had been stored in componentArrayFull\n        // does this have any ill effects?","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plot_api/manage_arrays.js#L128-L164","documentation":"manage_arrays.applyContainerArrayChanges edits container arrays (annotations, shapes, etc.) driven by relayout-style update objects. When an entry at a component index sets the whole object (key ''), that value must be an add value ('add' string or a plain object) or a remove value (null / [0]); anything else is unrecognized, so the edit is skipped and this warning is logged.","triggerScenarios":"Calling Plotly.relayout/Plotly.update with a whole-object assignment whose value is not 'add', not a plain object, and not a removal value, e.g. Plotly.relayout(gd, 'annotations[0]', 'mystery') or Plotly.relayout(gd, 'shapes[1]', 42).","commonSituations":"Typos like 'removed' instead of null; passing a number/string where an annotation object was intended; serializing updates through a backend that turned null into the string 'null'; older code using legacy removal values that newer plotly.js no longer accepts.","solutions":["Use a plain object to set/replace the item: Plotly.relayout(gd, 'annotations[0]', {x: 1, y: 2})","Use the literal string 'add' or {} to insert a new item at the index","Use null (or [0]) to remove the item: Plotly.relayout(gd, 'annotations[0]', null)","Validate the value's type before calling relayout; only strings === 'add', plain objects, and null are valid","For bulk edits pass the aobj form Plotly.relayout(gd, {'annotations[0]': {...}}) with correctly typed values"],"exampleFix":"// before\nPlotly.relayout(gd, 'annotations[0]', 'add annotation');\n// after\nPlotly.relayout(gd, 'annotations[0]', {text: 'add annotation', x: 0.5, y: 0.5});","handlingStrategy":"validation","validationCode":"function isValidWholeObjectEdit(v) {\n  return v === 'add' || v === null || (v && typeof v === 'object' && !Array.isArray(v));\n}\n// check each value before relayout with key '' semantics\nif (!isValidWholeObjectEdit(value)) throw new Error('Use an object, \\'add\\', or null for ' + attr);","typeGuard":"function isPlainObj(v) { return v !== null && typeof v === 'object' && !Array.isArray(v); }\nconst isAdd = v => v === 'add' || isPlainObj(v);\nconst isRemove = v => v === null;","tryCatchPattern":null,"preventionTips":["Only use 'add', a plain object, or null for whole-container-index relayout values","Never invent removal keywords; plotly.js removal is null or [0]","Type-check dynamically built update objects before calling relayout","Prefer the {attr: value} aobj form so you can validate all values at once"],"tags":["api-misuse","relayout","validation"],"backgroundTag":"invalid-update-value","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}