Search code examples
eventsbokehrangeslider

Mouse up event for RangeSlider of Bokeh?


Would it be possible to catch mouse up event for RangeSlider, a Bokeh widget? I believe being able to catch it should be very useful because there are cases when computation being done inside on_change() callback for RangeSlider may take quite some time. During the time you move the slider handle, the callback gets called so many times and the required computation may not be able to catch up the high frequency of the updates. The mouse up event should be good time for, then, the computation can only take place at the moment.


Solution

  • As of Bokeh 0.12.10 there is no such event. You could potentially add one by writing a Bokeh Custom Extension. However, given the description of your use-case, what you actually want is this open issue: #4540 Slider callback_policy should work for apps . Until that feature is implemented, there is a reasonable workaround in this SO answer: Throttling in Bokeh application