Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try and improve responsiveness when debounced isn't really needed #472

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Oct 29, 2024

The main motivation for @debounced is to avoid many repeated updates when e.g. panning/zooming or doing other front-end changes. However, currently, there are cases where relying on debounced is not desirable, e.g.:

image.state.reset_limits()
time.sleep(3)

In this case, if this code is in a cell, the figure won't be updated until after the sleep because the callback for the debounced update is not in a separate thread. The long-term fix would be to try and make sure glue and glue-jupyter are thread-safe and use a thread in this case, but for now, a simple fix is to simply treat updates in limits similarly to e.g. updates in percentile, cmap and so on, and make sure those changes result in an immediate update in the figure.

This PR also adds a check to avoid unnecessary repeated updates in .update()

@bmorris3
Copy link
Contributor

Thanks @astrofrog, this is helpful 🙌🏻

@astrofrog astrofrog merged commit 44e7df6 into glue-viz:main Oct 31, 2024
23 of 24 checks passed
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.

2 participants