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

Adding debounce to self.param.update #984

Open
ahuang11 opened this issue Dec 3, 2024 · 1 comment
Open

Adding debounce to self.param.update #984

ahuang11 opened this issue Dec 3, 2024 · 1 comment

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Dec 3, 2024

I would like a built-in mechanism in the self.param.update method (or similar) that supports debouncing. https://www.geeksforgeeks.org/debouncing-in-javascript/

Example:

  1. The code waits for 2 seconds before showing the loading icon.
  2. If the process completes or the event resolves within those 2 seconds, the icon is never shown.
  3. If the process doesn't complete, the icon appears after the delay, signaling that something is still loading.

This feature could be particularly useful for applications with frequent, rapid user interactions that trigger parameter updates (e.g., sliders or live data streams). It would improve the UX by removing flicker.

Use case would be linking widgets with self.state.param.busy, but at the current moment it could cause flickering:
holoviz/lumen#783 (comment)

I think it would be implemented here https://github.com/holoviz/param/blob/main/param/parameterized.py#L2297-L2357

@hoxbro
Copy link
Member

hoxbro commented Dec 4, 2024

I don't think this functionality should live in Param. I do think we should have some way to make the busy toggle not flicker on/off with a debounce, though I think this functionality should live in Panel.

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

No branches or pull requests

2 participants