Slider callback throttle not working (bokeh 12.3)

Hi,

The callback throttling of the slider element doesn’t seem to work. Creating a slider element with the attributes “callback_throttle=15000000” and callback_policy=“throttle” doens’t affect the behaviour of the slider.

The documentation isn’t clear what kind of unt is used to measure the pause between each callback:

** “Number of microseconds to pause between callback calls as the slider is moved.”**

** “throttle”: the callback will be executed at most every callback_throttle milliseconds. **

It doesn’t seem to work either way though.

Best regards

Hi,

Are you trying to use throttling in conjunction with Bokeh server (e.g. with .on_change) python callbacks? The throttling properties were added early on to support CustomJS callbacks, and continue to only apply to CustomJS callbacks, not to Bokeh server callbacks (which were added much later).

It is a human oversight that the help string for the property was not updated when server callbacks became available. It would be good if a note was added to reflect that the properties only apply to CustomJS callbacks. If you would like to submit a Pull Request to improve the help strings, it would be very appreciated. Here is the location:

  https://github.com/bokeh/bokeh/blob/master/bokeh/models/widgets/inputs.py#L128-L144

In the mean time, this Stack Overflow has a workaround to enable some throttling in conjunction with Bokeh Server apps and python callbacks:

  http://stackoverflow.com/a/38379136/3406693

If I have assumed incorrectly, and you are reporting problems with CustomJS callbacks, then that is potentially a bug. In that case please provide a complete, minimal, runnable test case that reproduces the problem you are seeing so that it can be investigated.

Thanks,

Bryan

···

On Dec 4, 2016, at 4:35 PM, Rudelwolf <[email protected]> wrote:

Hi,

The callback throttling of the slider element doesn't seem to work. Creating a slider element with the attributes "callback_throttle=15000000" and callback_policy="throttle" doens't affect the behaviour of the slider.
The documentation isn't clear what kind of unt is used to measure the pause between each callback:
"Number of microseconds to pause between callback calls as the slider is moved."
“throttle”: the callback will be executed at most every callback_throttle milliseconds.

It doesn't seem to work either way though.

Best regards

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/0f199914-d82e-404c-839a-53ba99016dac%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi

Thanks for the quick response.

Yes im using the bokeh server. Thanks for pointing me to a solution, ill check it out.