Skip to content

Commit 9612549

Browse files
committed
replace gd._replotting -> fullLayout._replotting
1 parent 6e25640 commit 9612549

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/plot_api/plot_api.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,14 @@ Plotly.plot = function(gd, data, layout, config) {
133133

134134
Plots.supplyDefaults(gd);
135135

136+
var fullLayout = gd._fullLayout;
137+
136138
// Polar plots
137139
if(data && data[0] && data[0].r) return plotPolar(gd, data, layout);
138140

139141
// so we don't try to re-call Plotly.plot from inside
140142
// legend and colorbar, if margins changed
141-
gd._replotting = true;
143+
fullLayout._replotting = true;
142144

143145
// make or remake the framework if we need to
144146
if(graphWasEmpty) makePlotFramework(gd);
@@ -152,7 +154,6 @@ Plotly.plot = function(gd, data, layout, config) {
152154
// save initial axis range once per graph
153155
if(graphWasEmpty) Plotly.Axes.saveRangeInitial(gd);
154156

155-
var fullLayout = gd._fullLayout;
156157

157158
// prepare the data and find the autorange
158159

@@ -321,13 +322,13 @@ Plotly.plot = function(gd, data, layout, config) {
321322
Plots.addLinks(gd);
322323

323324
// Mark the first render as complete
324-
gd._replotting = false;
325+
fullLayout._replotting = false;
325326

326327
return Plots.previousPromises(gd);
327328
}
328329

329330
// An initial paint must be completed before these components can be
330-
// correctly sized and the whole plot re-margined. gd._replotting must
331+
// correctly sized and the whole plot re-margined. fullLayout._replotting must
331332
// be set to false before these will work properly.
332333
function finalDraw() {
333334
Registry.getComponentMethod('shapes', 'draw')(gd);

src/plots/cartesian/set_convert.js

+1
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ module.exports = function setConvert(ax, fullLayout) {
361361
Lib.notifier(
362362
'Something went wrong with axis scaling',
363363
'long');
364+
fullLayout._replotting = false;
364365
throw new Error('axis scaling');
365366
}
366367
};

src/plots/plots.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@ plots.purge = function(gd) {
11251125
delete gd._testref;
11261126
delete gd._promises;
11271127
delete gd._redrawTimer;
1128-
delete gd._replotting;
11291128
delete gd.firstscatter;
11301129
delete gd.hmlumcount;
11311130
delete gd.hmpixcount;
@@ -1206,7 +1205,7 @@ plots.autoMargin = function(gd, id, o) {
12061205
};
12071206
}
12081207

1209-
if(!gd._replotting) plots.doAutoMargin(gd);
1208+
if(!fullLayout._replotting) plots.doAutoMargin(gd);
12101209
}
12111210
};
12121211

@@ -1299,7 +1298,7 @@ plots.doAutoMargin = function(gd) {
12991298
gs.h = Math.round(fullLayout.height) - gs.t - gs.b;
13001299

13011300
// if things changed and we're not already redrawing, trigger a redraw
1302-
if(!gd._replotting && oldmargins !== '{}' &&
1301+
if(!fullLayout._replotting && oldmargins !== '{}' &&
13031302
oldmargins !== JSON.stringify(fullLayout._size)) {
13041303
return Plotly.plot(gd);
13051304
}

test/jasmine/tests/plots_test.js

-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ describe('Test Plots', function() {
418418
expect(gd._testref).toBeUndefined();
419419
expect(gd._promises).toBeUndefined();
420420
expect(gd._redrawTimer).toBeUndefined();
421-
expect(gd._replotting).toBeUndefined();
422421
expect(gd.firstscatter).toBeUndefined();
423422
expect(gd.hmlumcount).toBeUndefined();
424423
expect(gd.hmpixcount).toBeUndefined();

0 commit comments

Comments
 (0)