From eeefa112d474d32f8c9aebc3485d4f53b3ef7357 Mon Sep 17 00:00:00 2001 From: Nicolas Riesco Date: Sun, 12 Jun 2016 19:37:23 +0100 Subject: [PATCH] autosize: Fix Plots.resize backwards-compatibility --- src/plots/plots.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plots/plots.js b/src/plots/plots.js index 29025dd999b..42badb0fdbc 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -293,9 +293,8 @@ plots.resize = function(gd) { return; } - delete gd._fullLayout._initialAutoSizeIsDone; - if(!gd.layout.width) delete (gd._fullLayout || {}).width; - if(!gd.layout.height) delete (gd._fullLayout || {}).height; + delete gd.layout.width; + delete gd.layout.height; // autosizing doesn't count as a change that needs saving var oldchanged = gd.changed; @@ -303,7 +302,7 @@ plots.resize = function(gd) { // nor should it be included in the undo queue gd.autoplay = true; - Plotly.plot(gd).then(function() { + Plotly.relayout(gd, { autosize: true }).then(function() { gd.changed = oldchanged; resolve(gd); });