From d33bf8d47687adfd9033d322857e538976dcc880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Mon, 28 Dec 2015 17:37:17 -0500 Subject: [PATCH 1/2] Fixed promise return (Promise.resolve is not a constructor) --- src/plot_api/plot_api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index adb521b09b3..8230fa733ef 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -1647,11 +1647,11 @@ Plotly.restyle = function restyle(gd, astr, val, traces) { if(typeof astr === 'string') aobj[astr] = val; else if(Plotly.Lib.isPlainObject(astr)) { aobj = astr; - if(traces===undefined) traces = val; // the 3-arg form + if(traces === undefined) traces = val; // the 3-arg form } else { console.log('restyle fail',astr,val,traces); - return new Promise.reject(); + return Promise.reject(); } if(Object.keys(aobj).length) gd.changed = true; @@ -2173,7 +2173,7 @@ Plotly.relayout = function relayout(gd, astr, val) { gd = getGraphDiv(gd); if(gd.framework && gd.framework.isPolar) { - return new Promise.resolve(gd); + return Promise.resolve(gd); } var layout = gd.layout, From 445e80aa054d8179f15b6ee8383e33824bbd1204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Tusz?= Date: Mon, 28 Dec 2015 17:57:07 -0500 Subject: [PATCH 2/2] Re-set autobins after supplying defaulys if initially set --- src/plots/plots.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plots/plots.js b/src/plots/plots.js index 4b66557e5d8..aa6f3f1a9f6 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -426,6 +426,15 @@ plots.supplyDefaults = function(gd) { trace = newData[i]; fullTrace = plots.supplyDataDefaults(trace, i, newFullLayout); + + // If autobinned before, autobin again. supplyDataDefaults sees + // the generated bin object and assumes it has been set manually + // so we need to override that behaviour. + if (oldFullData[i]){ + fullTrace.autobinx = oldFullData[i].autobinx || fullTrace.autobinx; + fullTrace.autobiny = oldFullData[i].autobiny || fullTrace.autobiny; + } + newFullData.push(fullTrace); // DETECT 3D, Cartesian, and Polar