plotly/plotly.js · warning
unrecognized GUI edit: ${key} in trace uid ${uid}
Error message
unrecognized GUI edit: ${key} in trace uid ${uid} What it means
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.
Source
Thrown at src/plot_api/plot_api.js:2534
} else {
oldRev = fullTrace.uirevision;
// inheritance for trace.uirevision is simple, just layout.uirevision
newRev = newTrace.uirevision;
if (newRev === undefined) newRev = layout.uirevision;
}
if (newRev && newRev === oldRev) {
preGUIVal = tracePreGUI[key];
if (preGUIVal === null) preGUIVal = undefined;
newNP = nestedProperty(newTrace, key);
newVal = newNP.get();
if (valsMatch(newVal, preGUIVal)) {
newNP.set(undefinedToNull(nestedProperty(fullTrace, key).get()));
continue;
}
}
} else {
Lib.warn('unrecognized GUI edit: ' + key + ' in trace uid ' + uid);
}
delete tracePreGUI[key];
}
}
}
/**
* Plotly.react:
* A plot/update method that takes the full plot state (same API as plot/newPlot)
* and diffs to determine the minimal update pathway
*
* @param {string id or DOM element} gd
* the id or DOM element of the graph container div
* @param {array of objects} data
* array of traces, containing the data and display information for each trace
* @param {object} layout
* object describing the overall display of the plot,
* all the stuff that doesn't pertain to any individual traceView on GitHub (pinned to 1d090e0b5f)
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.
Example fix
// before
Plotly.restyle(gd, {'marker.colorr': 'red'}, [0]);
// after
Plotly.restyle(gd, {'marker.color': 'red'}, [0]); Defensive patterns
Strategy: validation
Validate before calling
function traceKeyExists(gd, traceIndex, key) {
const trace = gd._fullData && gd._fullData[traceIndex];
if (!trace) return false;
let node = trace;
const parts = key.split('.');
for (const p of parts) {
if (node == null || typeof node !== 'object' || !(p in node)) return false;
node = node[p];
}
return true;
}
// usage: if (traceKeyExists(gd, 0, 'marker.color')) Plotly.restyle(gd, obj, [0]); Type guard
function hasStableUid(trace) {
return trace != null && typeof trace.uid === 'string' && trace.uid.length > 0;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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'.
Related errors
- unrecognized GUI edit: ${key}
- API call to Plotly.${method} rejected.
- Restyle fail.
- animate failure: frame not found: "${frameName}"
- addFrames: overwriting frame "${name}" with a frame whose na
AI-assisted analysis of plotly/plotly.js@1d090e0b5f (2026-09-02).
Data as JSON: /api/errors/e278f759df0cb794.
Report an issue: GitHub.