Skip to content

Graph grid and axes jittering when panning on one axis #875

Closed Answered by nkalupahana
nkalupahana asked this question in Q&A
Discussion options

You must be logged in to vote

We found that this is actually a symptom of the real problem: the x-axis ticks don't actually move, and constantly change on pan. Instead of the x-axis values staying constant and moving across the screen like you might expect, they instead change whenever you pan, leaving the vertical lines in roughly the same place. You can see this in the original video -- it looks like you're panning the x axis, not the graph. To fix this, we manually calculated the ticks for the graph, and only changed the supplied ticks when the zoom was changed. Now, the graph pans as expected, and the jitter also goes away. https://github.com/nkalupahana/baseline/blob/main/src/components/graphs/helpers.tsx#L111

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nkalupahana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #802 on November 17, 2024 18:50.