plotly/plotly.js · warning
unrecognized GUI edit: ${key}
Error message
unrecognized GUI edit: ${key} What it means
This warning is emitted by Plotly.relayout when a GUI-edit key stored in layout._preGUI cannot be matched to a recognized relayout edit handler. The edit is skipped: the pre-GUI value is not restored/applied and the key is discarded. It almost always indicates a malformed attribute path or stale internal pre-GUI bookkeeping.
Source
Thrown at src/plot_api/plot_api.js:2458
// Only read the input layout once and stash the result,
// so we get it before we start modifying it
if (!(head in newAutorangeIn)) {
var newContainer = nestedProperty(layout, head).get();
newAutorangeIn[head] =
newContainer &&
(newContainer.autorange ||
(newContainer.autorange !== false &&
(!newContainer.range || newContainer.range.length !== 2)));
}
if (newAutorangeIn[head]) {
newNP.set(undefinedToNull(nestedProperty(oldFullLayout, key).get()));
continue;
}
}
}
}
} else {
Lib.warn('unrecognized GUI edit: ' + key);
}
// if we got this far, the new value was accepted as the new starting
// point (either because it changed or revision changed)
// so remove it from _preGUI for next time.
delete layoutPreGUI[key];
if (match && match.tail.slice(0, 6) === 'range[') {
newRangeAccepted[match.head] = 1;
}
}
// More special logic for `autorange`, since it interacts with `range`:
// If the new figure's matching `range` was kept, and `autorange`
// wasn't supplied explicitly in either the original or the new figure,
// we shouldn't alter that - but we may just have done that, so fix it.
for (var i = 0; i < bothInheritAutorange.length; i++) {
var axAttr = bothInheritAutorange[i];
if (newRangeAccepted[axAttr]) {View on GitHub (pinned to 1d090e0b5f)
Solutions
- Check the key passed to Plotly.relayout for typos and verify it is a valid layout attribute path via Plotly.PlotSchema.
- Re-render the figure with Plotly.react or Plotly.newPlot to clear stale _preGUI state instead of reusing the long-lived graph div.
- If you extend interaction code, only write keys to pre-GUI state that the relayout dispatcher recognizes, or remove them before calling relayout.
Example fix
// before Plotly.relayout(gd, 'xaxis.rang', [0, 10]); // after Plotly.relayout(gd, 'xaxis.range', [0, 10]);
Defensive patterns
Strategy: validation
Validate before calling
function isValidLayoutKey(gd, key) {
const parts = key.split(/[\[\].]/).filter(Boolean);
let node = gd._fullLayout || {};
for (const p of parts) {
if (node == null || typeof node !== 'object' || !(p in node)) return false;
node = node[p];
}
return true;
}
// usage: if (isValidLayoutKey(gd, 'xaxis.range')) Plotly.relayout(gd, key, val); Type guard
function isStringKey(v) {
return typeof v === 'string' && v.length > 0 && !v.startsWith('_');
} Prevention
- Validate attribute paths against Plotly.PlotSchema before relayout.
- Do not write custom keys into layout._preGUI.
- Re-render with Plotly.react instead of reusing graph divs with accumulated GUI state.
- Centralize relayout key constants to avoid typos.
When it happens
Trigger: Calling Plotly.relayout(gd, key, val) with a key that is not a recognized layout attribute path or known GUI edit (typo'd path, unrecognized nested/arrayed key, or an internal _preGUI key the dispatcher cannot classify).
Common situations: Typos in programmatic relayout calls (e.g. 'xaxis.rang'); custom interaction code writing unexpected keys into layout._preGUI; modebar/custom drag handlers interacting with relayout after traces or layout were regenerated.
Related errors
- unrecognized GUI edit: ${key} in trace uid ${uid}
- API call to Plotly.${method} rejected.
- Full array edits are incompatible with other edits
- Unrecognized full array edit value
- index out of range
AI-assisted analysis of plotly/plotly.js@1d090e0b5f (2026-09-02).
Data as JSON: /api/errors/9848f04f0ec34483.
Report an issue: GitHub.