Skip to content

Commit 5a83c84

Browse files
committed
add fallback for fullLayout_plots :
- so that Plots.getSubplots('gl2d' or 'cartesian') does not fail on a blank (i.e. Plotly.plot(gd, [])) plot - I am beginning to doubt that storing both 'cartesian' and 'gl2d' subplot objects in fullLayout._plots is the way to go.
1 parent 8128622 commit 5a83c84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ plots.getSubplotIds = function getSubplotIds(layout, type) {
193193
if(type === 'cartesian' && (!layout._has || !layout._has('cartesian'))) return [];
194194
if(type === 'gl2d' && (!layout._has || !layout._has('gl2d'))) return [];
195195
if(type === 'cartesian' || type === 'gl2d') {
196-
return Object.keys(layout._plots);
196+
return Object.keys(layout._plots || {});
197197
}
198198

199199
var idRegex = _module.idRegex,

0 commit comments

Comments
 (0)