I’m not sure if this is a bug or it was added by design, but when I try to serialize a DateRangeSlider
on the JavaScript side, I encounter an error about value_throttled
property. It looks like this property (which is read-only) is initially unset when the widget is created, but after I interact with the widget, the property gets assigned the same value as value
. This doesn’t normally cause a problem, but I’m trying to serialize the document containing this widget on the JS side using to_json_string()
method and if there has been no interactions with the slider, I get the following error:
Uncaught (in promise) Error: DateRangeSlider(p1002).value_throttled is unset
I have done this in Bokeh 2.4.3 in the past and had no issues, but it doesn’t work in Bokeh 3.2.2. If I’m not mistaken, the changes causing this behavior were introduced in this PR.
Here is a simple code to reproduce in a Jupyter notebook:
from bokeh.models import DateRangeSlider, CustomJS
date_range_slider = DateRangeSlider(
value=('2023-08-01', '2023-09-01'), start='2023-08-01', end='2023-09-01',
name='date_range'
)
show(date_range_slider)
And then in the browser console try:
Bokeh.documents[Bokeh.documents.length-1].get_model_by_name('date_range').value_throttled
Or try:
Bokeh.documents[Bokeh.documents.length-1].to_json_string()
Any help is appreciated. If this is a bug, I can create a Github issue for it. If not, I would like to know if there are any workarounds. Thanks!