-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugsomething brokensomething broken
Description
Hi team,
collectableSubplotTypes gets cached and this leads to inaccurate subplot lists if new traces are registered dynamically:
Lines 582 to 614 in 51b5c25
var collectableSubplotTypes; | |
function emptySubplotLists() { | |
var out = {}; | |
var i, j; | |
if(!collectableSubplotTypes) { | |
collectableSubplotTypes = []; | |
var subplotsRegistry = Registry.subplotsRegistry; | |
for(var subplotType in subplotsRegistry) { | |
var subplotModule = subplotsRegistry[subplotType]; | |
var subplotAttr = subplotModule.attr; | |
if(subplotAttr) { | |
collectableSubplotTypes.push(subplotType); | |
// special case, currently just for cartesian: | |
// we need to enumerate axes, not just subplots | |
if(Array.isArray(subplotAttr)) { | |
for(j = 0; j < subplotAttr.length; j++) { | |
Lib.pushUnique(collectableSubplotTypes, subplotAttr[j]); | |
} | |
} | |
} | |
} | |
} | |
for(i = 0; i < collectableSubplotTypes.length; i++) { | |
out[collectableSubplotTypes[i]] = []; | |
} | |
return out; | |
} |
For example if we load Plotly, plot a graph and later dynamically register mapbox and plot a mapbox it will error since coorect subplotTypes are not passed to handleSubplotDefaults.
Could we simply not cache subplotTypes or reset when we register new traces?
Regards
Metadata
Metadata
Assignees
Labels
bugsomething brokensomething broken