Skip to content

Commit 512679e

Browse files
n-riescoetpinard
authored andcommitted
autosize: Fix Plots.resize backwards-compatibility
1 parent 63ddd94 commit 512679e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/plots/plots.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,16 @@ plots.resize = function(gd) {
293293
return;
294294
}
295295

296-
delete gd._fullLayout._initialAutoSizeIsDone;
297-
if(!gd.layout.width) delete (gd._fullLayout || {}).width;
298-
if(!gd.layout.height) delete (gd._fullLayout || {}).height;
296+
delete gd.layout.width;
297+
delete gd.layout.height;
299298

300299
// autosizing doesn't count as a change that needs saving
301300
var oldchanged = gd.changed;
302301

303302
// nor should it be included in the undo queue
304303
gd.autoplay = true;
305304

306-
Plotly.plot(gd).then(function() {
305+
Plotly.relayout(gd, { autosize: true }).then(function() {
307306
gd.changed = oldchanged;
308307
resolve(gd);
309308
});

0 commit comments

Comments
 (0)