Closed duytnguyendtn closed 1 day ago
Didn't you say it was working at one point? Is it just a bug in initialization? I mean, does it sync after you call viewer.reset_limits()
and such?
The concept of zoom center is something we added on top of glue stuff here: https://github.com/spacetelescope/jdaviz/blob/main/jdaviz/core/freezable_state.py
Didn't you say it was working at one point? Is it just a bug in initialization?
Yes, this is just a case where I found it didn't update; it still generally works. #2872 relies on observing zoom_center_x/y
to detect when the coordinates are "off center" and that works as expected. My guess is that it's a bug in initialization, or at least when data is first loaded into the viewer without panning
Note that this does not happen when imviz is shown before accessing the state 🤔
Jdaviz component
Imviz
Description
Discovered a bug when adopting @kecnry's https://github.com/spacetelescope/jdaviz/pull/2872#discussion_r1778994906 suggestion on my Virtual Observatory PR: One of my test cases exposed a scenario where the
zoom_center_x
andzoom_center_y
state attributes aren't updating correctly, while thex_min
/x_max
, andy_min
/y_max
have updated properly. To visualize this, I use the "older" strategy to calculate the viewer's center position using the min/max attributes,https://github.com/spacetelescope/jdaviz/blob/99baa91efc0f61ec317a2baeb36ccb2879a40938/jdaviz/configs/imviz/plugins/viewers.py#L363-L365
compared to the new way suggested by Kyle to use the
zoom_center
state attributes:Based on this example, it looks like the
zoom_center_x
is not initializing properlyHow to Reproduce
Returned result:
Expected behavior
Old and new center value techniques should be identical
Browser
Chrome 129.0.6668.100
Jupyter
(See below)
Software versions