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, 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