Skip to content

Commit ff26691

Browse files
committed
rm some early-Plotly.plot logic regarding makePlotFramwork
1 parent c877c27 commit ff26691

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,28 +121,15 @@ Plotly.plot = function(gd, data, layout, config) {
121121
// so we don't try to re-call Plotly.plot from inside
122122
// legend and colorbar, if margins changed
123123
gd._replotting = true;
124-
var hasData = gd._fullData.length > 0;
125124

126-
var subplots = Plotly.Axes.getSubplots(gd).join(''),
127-
oldSubplots = Object.keys(gd._fullLayout._plots || {}).join(''),
128-
hasSameSubplots = (oldSubplots === subplots);
125+
// make or remake the framework if we need to
126+
if(graphWasEmpty) makePlotFramework(gd);
129127

130-
// Make or remake the framework (ie container and axes) if we need to
131-
// note: if they container already exists and has data,
132-
// the new layout gets ignored (as it should)
133-
// but if there's no data there yet, it's just a placeholder...
134-
// then it should destroy and remake the plot
135-
if(hasData) {
136-
if(gd.framework !== makePlotFramework || graphWasEmpty || !hasSameSubplots) {
137-
gd.framework = makePlotFramework;
138-
makePlotFramework(gd);
139-
}
140-
}
141-
else if(!hasSameSubplots) {
128+
// polar need a different framework
129+
if(gd.framework !== makePlotFramework) {
142130
gd.framework = makePlotFramework;
143131
makePlotFramework(gd);
144132
}
145-
else if(graphWasEmpty) makePlotFramework(gd);
146133

147134
// save initial axis range once per graph
148135
if(graphWasEmpty) Plotly.Axes.saveRangeInitial(gd);

0 commit comments

Comments
 (0)