Skip to content

Commit 68df357

Browse files
committed
supplyDataDefaults instead of supplyDefaults for transitions
1 parent dd9b6fc commit 68df357

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

src/plot_api/plot_api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,7 @@ Plotly.transition = function(gd, data, layout, traceIndices, transitionConfig) {
25842584
Lib.extendDeepNoArrays(gd.data[traceIndices[i]], update);
25852585
}
25862586

2587-
Plots.supplyDefaults(gd);
2587+
Plots.supplyDataDefaults(gd.data, gd._fullData, gd._fullLayout);
25882588

25892589
// TODO: Add logic that computes transitionedTraces to avoid unnecessary work while
25902590
// still handling things like box plots that are interrelated.

src/plots/cartesian/dragbox.js

-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
613613
editX = ew && xa.indexOf(xa2) !== -1 && !xa2.fixedrange,
614614
editY = ns && ya.indexOf(ya2) !== -1 && !ya2.fixedrange;
615615

616-
617616
var xScaleFactor = editX ? xa2._length / viewBox[2] : 1,
618617
yScaleFactor = editY ? ya2._length / viewBox[3] : 1;
619618

src/plots/plots.js

+3-14
Original file line numberDiff line numberDiff line change
@@ -508,20 +508,6 @@ plots.supplyDefaults = function(gd) {
508508
// relink functions and _ attributes to promote consistency between plots
509509
relinkPrivateKeys(newFullLayout, oldFullLayout);
510510

511-
// XXX: This is a hack that should be refactored by more generally removing the
512-
// need for relinkPrivateKeys
513-
var subplots = plots.getSubplotIds(newFullLayout, 'cartesian');
514-
for(i = 0; i < subplots.length; i++) {
515-
var subplot = newFullLayout._plots[subplots[i]];
516-
if(subplot.xaxis) {
517-
subplot.xaxis = newFullLayout[subplot.xaxis._name];
518-
}
519-
if(subplot.yaxis) {
520-
subplot.yaxis = newFullLayout[subplot.yaxis._name];
521-
}
522-
}
523-
524-
525511
plots.doAutoMargin(gd);
526512

527513
// can't quite figure out how to get rid of this... each axis needs
@@ -678,6 +664,9 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout) {
678664
basePlotModules = layout._basePlotModules = [],
679665
cnt = 0;
680666

667+
// Make this idempotent by emptying the existing array:
668+
dataOut.length = 0;
669+
681670
function pushModule(fullTrace) {
682671
dataOut.push(fullTrace);
683672

0 commit comments

Comments
 (0)