From 3acfadb18b1e97f5f6403a210283d5d8a0c2c316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 12 Nov 2024 17:19:32 +0100 Subject: [PATCH] fix: Propagate default_tools (#6451) --- holoviews/plotting/bokeh/element.py | 2 +- holoviews/tests/plotting/bokeh/test_elementplot.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index 567cf1799a..7b8216bd38 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -3068,7 +3068,7 @@ class OverlayPlot(GenericOverlayPlot, LegendPlot): 'min_height', 'max_height', 'min_width', 'min_height', 'margin', 'aspect', 'data_aspect', 'frame_width', 'frame_height', 'responsive', 'fontscale', 'subcoordinate_y', - 'subcoordinate_scale', 'autorange'] + 'subcoordinate_scale', 'autorange', 'default_tools'] def __init__(self, overlay, **kwargs): self._multi_y_propagation = self.lookup_options(overlay, 'plot').options.get('multi_y', False) diff --git a/holoviews/tests/plotting/bokeh/test_elementplot.py b/holoviews/tests/plotting/bokeh/test_elementplot.py index a2687442a9..6e92f743d5 100644 --- a/holoviews/tests/plotting/bokeh/test_elementplot.py +++ b/holoviews/tests/plotting/bokeh/test_elementplot.py @@ -1157,6 +1157,12 @@ def test_clim_percentile(self): assert low > 0 assert high < 1 + def test_propagate_tools(self): + scatter = lambda: Scatter([]).opts(default_tools=[]) + overlay = scatter() * scatter() + plot = bokeh_renderer.get_plot(overlay) + assert plot.default_tools == [] + class TestApplyHardBounds(TestBokehPlot): def test_apply_hard_bounds(self): """Test `apply_hard_bounds` with a single element."""