Skip to content

Commit 70bc238

Browse files
authored
Bokeh 2.4 compatibility for BokehModel ipywidget (#140)
* Fix compatibility with bokeh 2.4 * Bump version requirement * Cleanup debugging * Fix whitespace
1 parent ad4d04b commit 70bc238

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

jupyter_bokeh/widgets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def __init__(self, model, **kwargs):
7272
self.on_msg(self._sync_model)
7373

7474
def close(self):
75+
super().close()
7576
if self._document is not None:
7677
self._document.remove_on_change(self)
7778

@@ -126,13 +127,13 @@ def _sync_model(self, _, content, _buffers):
126127
submodel = self._model.select_one({"id": content["id"]})
127128
descriptor = submodel.lookup(content['attr'])
128129
try:
129-
descriptor._real_set(submodel, old, new, hint=hint, setter=self)
130+
descriptor._set(submodel, old, new, hint=hint, setter=self)
130131
except Exception:
131132
return
132133
for cb in submodel._callbacks.get(attr, []):
133134
cb(attr, old, new)
134135
elif kind == 'MessageSent':
135-
self._document.apply_json_event(content["msg_data"])
136+
self._document.callbacks.trigger_json_event(content["msg_data"])
136137

137138
#-----------------------------------------------------------------------------
138139
# Dev API

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
cmdclass=cmdclass,
7575
packages=setuptools.find_packages(),
7676
install_requires=[
77-
"bokeh >=2.0.0",
77+
"bokeh >=2.4.0",
7878
"ipywidgets >=7.6.0"
7979
],
8080
zip_safe=False,

0 commit comments

Comments
 (0)