{"record":{"id":"e278f759df0cb794","repo":"plotly/plotly.js","slug":"unrecognized-gui-edit-key-in-trace-uid-uid","errorCode":null,"errorMessage":"unrecognized GUI edit: ${key} in trace uid ${uid}","messagePattern":"unrecognized GUI edit: (.+?) in trace uid (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/plot_api/plot_api.js","lineNumber":2534,"sourceCode":"                } else {\n                    oldRev = fullTrace.uirevision;\n                    // inheritance for trace.uirevision is simple, just layout.uirevision\n                    newRev = newTrace.uirevision;\n                    if (newRev === undefined) newRev = layout.uirevision;\n                }\n\n                if (newRev && newRev === oldRev) {\n                    preGUIVal = tracePreGUI[key];\n                    if (preGUIVal === null) preGUIVal = undefined;\n                    newNP = nestedProperty(newTrace, key);\n                    newVal = newNP.get();\n                    if (valsMatch(newVal, preGUIVal)) {\n                        newNP.set(undefinedToNull(nestedProperty(fullTrace, key).get()));\n                        continue;\n                    }\n                }\n            } else {\n                Lib.warn('unrecognized GUI edit: ' + key + ' in trace uid ' + uid);\n            }\n            delete tracePreGUI[key];\n        }\n    }\n}\n\n/**\n * Plotly.react:\n * A plot/update method that takes the full plot state (same API as plot/newPlot)\n * and diffs to determine the minimal update pathway\n *\n * @param {string id or DOM element} gd\n *      the id or DOM element of the graph container div\n * @param {array of objects} data\n *      array of traces, containing the data and display information for each trace\n * @param {object} layout\n *      object describing the overall display of the plot,\n *      all the stuff that doesn't pertain to any individual trace","sourceCodeStart":2516,"sourceCodeEnd":2552,"githubUrl":"https://github.com/plotly/plotly.js/blob/1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314/src/plot_api/plot_api.js#L2516-L2552","documentation":"This is the trace-level counterpart of the unrecognized GUI edit warning: while restoring pre-GUI state for traces, Plotly finds a key in the trace's _preGUI record that it cannot apply to the trace identified by uid. The key is skipped, so that trace edit is not restored. It signals an unknown or invalid trace attribute path in the per-trace pre-GUI bookkeeping.","triggerScenarios":"A GUI/restyle-driven edit flow where a stored trace pre-GUI key does not resolve to a known trace attribute for the trace with the given uid; malformed trace-scoped keys; uid mismatch after traces are regenerated so stored keys no longer map to valid paths.","commonSituations":"Custom interaction or annotation code mutating trace pre-GUI records; traces rebuilt with new uids while old _preGUI entries persist; typos in trace attribute keys like 'marker.colorr'.","solutions":["Verify the trace-scoped key is a valid attribute path for that trace type via Plotly.PlotSchema.","Re-render with Plotly.react or Plotly.newPlot to rebuild traces and reset stale _preGUI/uid bookkeeping.","Keep uid values stable across updates if your code depends on per-trace pre-GUI state."],"exampleFix":"// before\nPlotly.restyle(gd, {'marker.colorr': 'red'}, [0]);\n// after\nPlotly.restyle(gd, {'marker.color': 'red'}, [0]);","handlingStrategy":"validation","validationCode":"function traceKeyExists(gd, traceIndex, key) {\n  const trace = gd._fullData && gd._fullData[traceIndex];\n  if (!trace) return false;\n  let node = trace;\n  const parts = key.split('.');\n  for (const p of parts) {\n    if (node == null || typeof node !== 'object' || !(p in node)) return false;\n    node = node[p];\n  }\n  return true;\n}\n// usage: if (traceKeyExists(gd, 0, 'marker.color')) Plotly.restyle(gd, obj, [0]);","typeGuard":"function hasStableUid(trace) {\n  return trace != null && typeof trace.uid === 'string' && trace.uid.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Check trace attribute paths against Plotly.PlotSchema before restyle.","Keep uid values stable across updates so per-trace pre-GUI state stays coherent.","Do not manually mutate trace _preGUI records.","Rebuild plots with Plotly.react when traces are regenerated."],"tags":["plotly","restyle","trace-uid","invalid-key"],"backgroundTag":"unrecognized-attribute-key","analyzedSha":"1d090e0b5ffb8d0fdf6e0e4ff51d3f3cf67f1314","analyzedAt":"2026-09-02T22:03:39.906Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}