Skip to content

Commit

Permalink
Set proper context before triggering streams (#6000)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoMathurin authored Nov 29, 2023
1 parent 2514f97 commit 0b84376
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
PolyEditTool,
Range1d,
)
from panel.io.state import state
from panel.io.state import set_curdoc, state

from ...core.options import CallbackError
from ...core.util import datetime_types, dimension_sanitizer, dt64_to_dt, isequal
@@ -209,7 +209,8 @@ def on_msg(self, msg):
streams.append(stream)

try:
Stream.trigger(streams)
with set_curdoc(self.plot.document):
Stream.trigger(streams)
except CallbackError as e:
if self.plot.root and self.plot.root.ref['id'] in state._handles:
handle, _ = state._handles[self.plot.root.ref['id']]

0 comments on commit 0b84376

Please sign in to comment.