Repository: holoviz/holoviews
Pull request #6451 (2024-11-12 11:32:25)

fix: Propagate default_tools
Fixes https://github.com/holoviz/holoviews/issues/6450

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/holoviz/holoviews/pull/6451?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=holoviz) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 88.50%. Comparing base [(`1f534a1`)](https://app.codecov.io/gh/holoviz/holoviews/commit/1f534a1b777bd87a8dc3ddbf299a7cae44159540?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=holoviz) to head [(`c79cc6e`)](https://app.codecov.io/gh/holoviz/holoviews/commit/c79cc6e74fb92f269bf4f615e25dc47b55928838?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=holoviz).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #6451      +/-   ##
==========================================
- Coverage   88.50%   88.50%   -0.01%     
==========================================
  Files         323      323              
  Lines       68626    68631       +5     
==========================================
+ Hits        60736    60739       +3     
- Misses       7890     7892       +2     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/holoviz/holoviews/pull/6451?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=holoviz).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=holoviz).


Patch:
diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py
index 567cf1799..7b8216bd3 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)


Test patch:
diff --git a/holoviews/tests/plotting/bokeh/test_elementplot.py b/holoviews/tests/plotting/bokeh/test_elementplot.py
index a2687442a..6e92f743d 100644
--- a/holoviews/tests/plotting/bokeh/test_elementplot.py
+++ b/holoviews/tests/plotting/bokeh/test_elementplot.py
@@ -1157,6 +1157,12 @@ class TestOverlayPlot(TestBokehPlot):
         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."""