Skip to content

Commit f35e215

Browse files
committed
fix #4251 - add delay before transitionTraces()
... to remove "jump" caused by transitionTraces()
1 parent 49140d0 commit f35e215

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/plots/plots.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2611,14 +2611,14 @@ plots.transitionFromReact = function(gd, restyleFlags, relayoutFlags, oldFullLay
26112611
axisTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});
26122612
transitionedTraces = allTraceIndices;
26132613
traceTransitionOpts = transitionOpts;
2614-
transitionTraces();
26152614
setTimeout(transitionAxes, transitionOpts.duration);
2615+
transitionTraces();
26162616
} else {
26172617
axisTransitionOpts = transitionOpts;
26182618
transitionedTraces = null;
26192619
traceTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});
2620+
setTimeout(transitionTraces, axisTransitionOpts.duration);
26202621
transitionAxes();
2621-
transitionTraces();
26222622
}
26232623
} else if(axEdits.length) {
26242624
axisTransitionOpts = transitionOpts;

test/jasmine/tests/transition_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,10 +694,10 @@ describe('Plotly.react transitions:', function() {
694694
assertSpies('both trace and layout transitions', [
695695
[Plots, 'transitionFromReact', 1],
696696
[gd._fullLayout._basePlotModules[0], 'transitionAxes', 1],
697-
// one instantaneous transition options to halt other trace transitions (if any)
698-
[gd._fullLayout._basePlotModules[0], 'plot', [gd, null, {duration: 0, easing: 'cubic-in-out', ordering: 'layout first'}, 'function']],
699697
[Axes, 'drawOne', 1],
700698
[Axes, 'drawOne', 1],
699+
// one instantaneous transition options to halt other trace transitions (if any)
700+
[gd._fullLayout._basePlotModules[0], 'plot', [gd, null, {duration: 0, easing: 'cubic-in-out', ordering: 'layout first'}, 'function']],
701701
[Axes, 'drawOne', 1],
702702
[Axes, 'drawOne', 1],
703703
// one _module.plot call from the relayout at end of axis transition

0 commit comments

Comments
 (0)