From 66857cdebc1d92019252340a4152a0c070c5feef Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Tue, 14 Sep 2021 16:22:48 +0100 Subject: [PATCH 1/2] Change default external padding for image in imviz --- jdaviz/configs/imviz/plugins/viewers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jdaviz/configs/imviz/plugins/viewers.py b/jdaviz/configs/imviz/plugins/viewers.py index cd8e2edba8..1b5dc46557 100644 --- a/jdaviz/configs/imviz/plugins/viewers.py +++ b/jdaviz/configs/imviz/plugins/viewers.py @@ -34,6 +34,17 @@ def __init__(self, *args, **kwargs): self.state.show_axes = False self.figure.fig_margin = {'left': 0, 'bottom': 0, 'top': 0, 'right': 0} + # By default, glue computes a fixed resolution buffer that matches the + # axes - but this means that when panning, one sees white outside of + # the original buffer until the buffer updates again, thus there is a + # lag in the image display. By increasing the external padding to 0.5 + # the image is made larger by 50% along all four sides, helping create + # the illusion of smooth panning. We can increase this further to + # improve the panning experience, but this can cause a larger delay + # when the image does need to update as it will be more computationally + # intensive. + self.state.image_external_padding = 0.5 + def on_mouse_or_key_event(self, data): # Find visible layers From 6349029a65d81dd321b8e725b91ca578d6154822 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Tue, 14 Sep 2021 16:26:35 +0100 Subject: [PATCH 2/2] Bump minimum version of glue-jupyter to have access to controls for image external padding --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 83dc49431a..c1a91e11b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ install_requires = bqplot>=0.12.29 bqplot-image-gl>=1.4.1 glue-core>=1.2.1 - glue-jupyter>=0.8.1 + glue-jupyter>=0.9 echo>=0.5.0 ipyvue>=1.4.1 ipyvuetify>=1.7.0