Skip to content

Conversation

@burbschat
Copy link
Contributor

@burbschat burbschat commented Sep 19, 2025

Redraw on new x and y does not work as expected for new data arriving at rates higher than the redraw rate as needs_new_x and needs_new_y are reset only once the redraw actually happens (which may be well after the next data point arrives).
Fix by resetting needs_new_x and needs_new_y directly in update_buffer. Allows to receive all points, adding to the buffer according to the set mode (x only, y only, either, both).

Test cases have been adjusted to reflect the expected behaviour.

Reset needs_new_x/y in update_buffer rather than redrawCurve

Otherwise REDRAW_ON_BOTH will not function properly if redraw frequency
is lower than data frequency. In that case it will behave (mostly) like
REDRAW_ON_EITHER.
Keep the code explicit to avoid confusion.
@burbschat burbschat marked this pull request as ready for review October 8, 2025 12:32
@jbellister-slac jbellister-slac linked an issue Oct 8, 2025 that may be closed by this pull request
Copy link
Collaborator

@jbellister-slac jbellister-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works as expected now, thanks for the fix!

@jbellister-slac jbellister-slac merged commit dd8a8b2 into slaclab:master Oct 8, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scatter plot redraw on both broken

2 participants