-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ resize image window #116
Conversation
Staging application has been deployed and is available at: https://dash5-services.plotly.host/ml-exchange-staging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well when the image has not been zoomed in yet ✨ ! However it does not seem to work after the image has been zoomed in. By this, I mean that the zoom level of the image is not persisted after the window is resized.
@cleaaum that is an intended behaviour. What could happen is that when the window is resized the image itself could go out of bounds and would "disappear", hence I made it also re-center in the middle can change it back to keeping the zoom but it can cause wonky behaviour my thinking: the user is not going to be changing their window size often, and when they do, it's better so that they can see the entire image relative to their new window size, rather than for it to disappear out of the window, and even if it didn't disappear |
) | ||
def resize_window_event(screen_width, screen_height, annotation_store): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to switch this to a clientside callback for better performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why not
That's what I did the first time I did this, but @hannahker mentioned that the zoom level should be maintained. I personally don't love the fact that it recenters (especially because there is a recenter button now). I don't see how it would cause wonky behaviour (at least I didn't notice it when I implemented it!) Also, getting the browser dimensions to fit the screen resizing without preserving the zoom level worked before I think, but I could be wrong, it was a while ago. Anyways just my ideas! Hannah can decide which behaviour is ideal:) |
I'd agree with @cleaaum on this one. In testing this out I found it surprising that the image would reset to the zoomed out view, and I'd imagine that this could be frustrating to users who would now have to zoom in again and find their "place" in the image. I'm not sure if it's a lag or a bug, but I'm also finding that the resizing isn't working as I'd expect in all cases. See demo below where I end up with some white space on the top and bottom of the image, when I'd expect it to take up the full available height. Screen.Recording.2023-09-21.at.1.45.38.PM.mov |
will adjust it to keep the zoom and relative position tomorrow re: "lag" part, I am not sure about that, never happened on my end. |
@danton267 I'm getting that issue on Firefox when checking the deployed staging link. Can you reproduce the issue there? |
I pushed all my WIP. Current issues:
|
Closing for now. See comment here: #89 (comment) |
When the app starts, we get initial width and height, which is then used to create the initial figure.
When a resize event happens for whatever reason (full screen, zoom, manual sizing, etc...)
resize_window_event
will trigger, which will then update the figure and viewfinder, and metadata for future callbacks.The figure is updated in such a way that it will always fit into the screen size.
This takes over #93, which can be deleted. Thanks, @cleaaum, for the nice start 🔥