Ensure that Stream triggering state is handled correctly on bokeh server
@@ -62,6 +62,7 @@ class Plot(param.Parameterized):
self._document = None
self._root = None
self._pane = None
+ self._triggering = []
self.set_root(root)
@@ -191,9 +192,16 @@ class Plot(param.Parameterized):
if (curdoc() is not self.document or (state._thread_id is not None and
thread_id != state._thread_id)):
# If we do not have the Document lock, schedule refresh as callback
+ self._triggering += [s for p in self.traverse(lambda x: x, [Plot])
+ for s in p.streams if s._triggering]
self.document.add_next_tick_callback(self.refresh)
return
+ # Ensure that server based tick callbacks maintain stream triggering state
+ for s in self._triggering:
+ s._triggering = True
+ try:
+
traverse_setter(self, '_force', True)
key = self.current_key if self.current_key else self.keys[0]
dim_streams = [stream for stream in self.streams
@@ -206,6 +214,13 @@ class Plot(param.Parameterized):
self._trigger_refresh(stream_key)
if self.top_level:
self.push()
+ except Exception as e:
+ raise e
+ finally:
+ # Reset triggering state
+ for s in self._triggering:
+ s._triggering = False
+ self._triggering = []
def _trigger_refresh(self, key):
