Skip to content

Commit

Permalink
Merge 3732c66 into e8f3496
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 23, 2020
2 parents e8f3496 + 3732c66 commit 80e02b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/element.py
Expand Up @@ -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):
Expand Down
11 changes: 10 additions & 1 deletion holoviews/tests/plotting/bokeh/testcallbacks.py
Expand Up @@ -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):

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 80e02b5

Please sign in to comment.