Skip to content

Commit f169ce2

Browse files
committed
supplyDataDefaults instead of supplyDefaults for transitions
1 parent 04de1e4 commit f169ce2

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

src/plot_api/plot_api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2592,7 +2592,7 @@ Plotly.transition = function(gd, data, layout, traceIndices, transitionConfig) {
25922592
Lib.extendDeepNoArrays(gd.data[traceIndices[i]], update);
25932593
}
25942594

2595-
Plots.supplyDefaults(gd);
2595+
Plots.supplyDataDefaults(gd.data, gd._fullData, gd._fullLayout);
25962596

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

src/plots/cartesian/dragbox.js

Lines changed: 0 additions & 1 deletion
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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,20 +401,6 @@ plots.supplyDefaults = function(gd) {
401401
// relink functions and _ attributes to promote consistency between plots
402402
relinkPrivateKeys(newFullLayout, oldFullLayout);
403403

404-
// XXX: This is a hack that should be refactored by more generally removing the
405-
// need for relinkPrivateKeys
406-
var subplots = plots.getSubplotIds(newFullLayout, 'cartesian');
407-
for(i = 0; i < subplots.length; i++) {
408-
var subplot = newFullLayout._plots[subplots[i]];
409-
if(subplot.xaxis) {
410-
subplot.xaxis = newFullLayout[subplot.xaxis._name];
411-
}
412-
if(subplot.yaxis) {
413-
subplot.yaxis = newFullLayout[subplot.yaxis._name];
414-
}
415-
}
416-
417-
418404
plots.doAutoMargin(gd);
419405

420406
// can't quite figure out how to get rid of this... each axis needs
@@ -571,6 +557,9 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout) {
571557
basePlotModules = layout._basePlotModules = [],
572558
cnt = 0;
573559

560+
// Make this idempotent by emptying the existing array:
561+
dataOut.length = 0;
562+
574563
function pushModule(fullTrace) {
575564
dataOut.push(fullTrace);
576565

0 commit comments

Comments
 (0)