Skip to content

Commit

Permalink
fix #4251 - add delay before transitionTraces()
Browse files Browse the repository at this point in the history
... to remove "jump" caused by transitionTraces()
  • Loading branch information
etpinard committed Oct 8, 2019
1 parent 49140d0 commit f35e215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -2611,14 +2611,14 @@ plots.transitionFromReact = function(gd, restyleFlags, relayoutFlags, oldFullLay
axisTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});
transitionedTraces = allTraceIndices;
traceTransitionOpts = transitionOpts;
transitionTraces();
setTimeout(transitionAxes, transitionOpts.duration);
transitionTraces();
} else {
axisTransitionOpts = transitionOpts;
transitionedTraces = null;
traceTransitionOpts = Lib.extendFlat({}, transitionOpts, {duration: 0});
setTimeout(transitionTraces, axisTransitionOpts.duration);
transitionAxes();
transitionTraces();
}
} else if(axEdits.length) {
axisTransitionOpts = transitionOpts;
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/transition_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,10 @@ describe('Plotly.react transitions:', function() {
assertSpies('both trace and layout transitions', [
[Plots, 'transitionFromReact', 1],
[gd._fullLayout._basePlotModules[0], 'transitionAxes', 1],
// one instantaneous transition options to halt other trace transitions (if any)
[gd._fullLayout._basePlotModules[0], 'plot', [gd, null, {duration: 0, easing: 'cubic-in-out', ordering: 'layout first'}, 'function']],
[Axes, 'drawOne', 1],
[Axes, 'drawOne', 1],
// one instantaneous transition options to halt other trace transitions (if any)
[gd._fullLayout._basePlotModules[0], 'plot', [gd, null, {duration: 0, easing: 'cubic-in-out', ordering: 'layout first'}, 'function']],
[Axes, 'drawOne', 1],
[Axes, 'drawOne', 1],
// one _module.plot call from the relayout at end of axis transition
Expand Down

0 comments on commit f35e215

Please sign in to comment.