diff --git a/CHANGES.rst b/CHANGES.rst index e41a5cc129..7bfa8480c7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -68,6 +68,8 @@ Bug Fixes occured when certain flux-to flux-conversions occured, as well as certain conversions between flux and surface brightness. This PR also fixed an issue with unit string formatting in the aperture photometry plugin. [#3228] +- Fixed broken histogram pan/zoom in Plot Options plugin. [#3361] + Cubeviz ^^^^^^^ - Removed the deprecated ``save as fits`` option from the Collapse, Moment Maps, and Spectral Extraction plugins; use the Export plugin instead. [#3256] diff --git a/jdaviz/configs/default/plugins/plot_options/tests/test_plot_options.py b/jdaviz/configs/default/plugins/plot_options/tests/test_plot_options.py index a72b31c30b..0d0781ae57 100644 --- a/jdaviz/configs/default/plugins/plot_options/tests/test_plot_options.py +++ b/jdaviz/configs/default/plugins/plot_options/tests/test_plot_options.py @@ -137,6 +137,15 @@ def test_stretch_histogram(cubeviz_helper, spectrum1d_cube_with_uncerts): assert po.stretch_histogram.marks['vmin'].x[0] == po.stretch_vmin.value assert po.stretch_histogram.marks['vmax'].x[0] == po.stretch_vmax.value + # Make sure some tools work + + po_panzoom = po.stretch_histogram.toolbar.tools["jdaviz:panzoom"] + po_panzoom.activate() + po_panzoom.deactivate() + + po_prevzoom = po.stretch_histogram.toolbar.tools["jdaviz:prevzoom"] + po_prevzoom.activate() + @pytest.mark.filterwarnings('ignore') def test_user_api(cubeviz_helper, spectrum1d_cube): diff --git a/jdaviz/core/tools.py b/jdaviz/core/tools.py index 71e0b9f53e..7a6f68542e 100644 --- a/jdaviz/core/tools.py +++ b/jdaviz/core/tools.py @@ -40,7 +40,10 @@ class _BaseZoomHistory: # Mixin for custom zoom tools to be able to save their previous zoom state # which is then used by the PrevZoom tool def save_prev_zoom(self): - self.viewer._prev_limits = self.viewer.get_limits() + # Cannot use viewer.get_limits() here because viewers from + # glue-jupyter does not have that method. + self.viewer._prev_limits = (self.viewer.state.x_min, self.viewer.state.x_max, + self.viewer.state.y_min, self.viewer.state.y_max) class _MatchedZoomMixin: