diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index 7b725fce72..61d02c598d 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -1450,7 +1450,7 @@ def _reset_ranges(self): norm = self.lookup_options(el, 'norm').options if norm.get('framewise'): for s in callback.streams: - if isinstance(s, RangeXY): + if isinstance(s, RangeXY) and not s._triggering: s.reset() def update_frame(self, key, ranges=None, plot=None, element=None): diff --git a/holoviews/tests/plotting/bokeh/testcallbacks.py b/holoviews/tests/plotting/bokeh/testcallbacks.py index 9a9338cf74..b94064d439 100644 --- a/holoviews/tests/plotting/bokeh/testcallbacks.py +++ b/holoviews/tests/plotting/bokeh/testcallbacks.py @@ -482,6 +482,16 @@ def test_rangexy_framewise_reset(self): plot.update((1,)) self.assertEqual(stream.y_range, None) + def test_rangexy_framewise_not_reset_if_triggering(self): + stream = RangeXY(x_range=(0, 2), y_range=(0, 1)) + curve = DynamicMap(lambda z, x_range, y_range: Curve([1, 2, z]), + kdims=['z'], streams=[stream]).redim.range(z=(0, 3)) + bokeh_server_renderer.get_plot(curve.opts(framewise=True + )) + stream.event(x_range=(0, 3)) + self.assertEqual(stream.x_range, (0, 3)) + + class TestBokehCustomJSCallbacks(CallbackTestCase): @@ -522,7 +532,6 @@ def test_callback_on_ndoverlay_is_attached(self): self.assertIsInstance(plot.callbacks[0], Selection1DCallback) self.assertIn(selection, plot.callbacks[0].streams) - def test_callback_on_table_is_attached(self): table = Table([1, 2, 3], 'x') selection = Selection1D(source=table)