Skip to content

Fix a wrong frame at the end of zero-duration axis transitions - #8201

Open
bodison wants to merge 2 commits into
plotly:mainfrom
bodison:fix-zero-duration-axis-transition
Open

bodison wants to merge 2 commits into
plotly:mainfrom
bodison:fix-zero-duration-axis-transition

Conversation

@bodison

@bodison bodison commented Nov 25, 2026

Copy link
Copy Markdown

Fixes #8200

Bug

With ordering: 'traces first', the axis step runs with a duration of 0 after the traces. Its frame function computes Math.min(1, (t2 - t1) / transitionOpts.duration). When the first frame runs in the same millisecond the step was requested, that is 0 / 0: the frame is drawn from NaN, the axis range falls back to its default, and a second frame is needed to finish.

Fix

With a duration of 0 the progress is 1, and the step completes as soon as the progress reaches 1.

The new test in transition_test.js freezes the clock so the first frame runs in the same millisecond. It fails on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: The axis flashes its default range for one frame after a 'traces first' transition

1 participant