@@ -121,28 +121,15 @@ Plotly.plot = function(gd, data, layout, config) {
121
121
// so we don't try to re-call Plotly.plot from inside
122
122
// legend and colorbar, if margins changed
123
123
gd . _replotting = true ;
124
- var hasData = gd . _fullData . length > 0 ;
125
124
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 ) ;
129
127
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 ) {
142
130
gd . framework = makePlotFramework ;
143
131
makePlotFramework ( gd ) ;
144
132
}
145
- else if ( graphWasEmpty ) makePlotFramework ( gd ) ;
146
133
147
134
// save initial axis range once per graph
148
135
if ( graphWasEmpty ) Plotly . Axes . saveRangeInitial ( gd ) ;
0 commit comments