For Bokeh 2.0 or newer, simply use a callback on "value_throttled"
:
slider.on_change('value_throttled', ...)
slider.js_on_change('value_throttled', ...)
OLD answer for for Bokeh 1.x
As of Bokeh 1.2, a callback policy applies to both JS callbacks as well as Python callbacks on the server. The value
property always updates unconditionally on every move, but a new value_throttled
property can be watched for changes according to the policy:
slider.callback_policy = "mouseup"
# both of these will respect the callback policy now
slider.js_on_change('value_throttled', ...)
slider.on_change('value_throttled', ...)
Note that the old callback
property is deprecated and will be removed in Bokeh 2.0. All new code should use the general on_change
and js_on_change
mechanisms.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…