developmentseed / bioacoustics-frontend

Frontend code for the Google Bioacoustics project that's used by A2O Search
https://search.acousticobservatory.org/
MIT License
1 stars 0 forks source link

Resize spectrogram when window is resized #55

Open willemarcel opened 1 year ago

willemarcel commented 1 year ago

When we resize the browser and its width gets smaller than the spectrogram image width, part of the spectrogram gets hidden. I think it needs to resize to be entirely visible in the screen.

LanesGood commented 1 year ago

I would push back on this and argue that this is not necessary, and perhaps unexpected when the user is zoomed in.

As a comparison, in any image viewing/editing platform I would expect that if I change the viewport of my viewing window, it makes sense for the image to "grow/shrink to fit" when I am fully zoomed out. Once I zoom in, however, I would want my zoom level to be retained. Even if I change the viewport I expect that the screen resolution of my image will persist, and the image will not zoom out (which could cause me to lose my place in an editing or zoomed-in viewing workflow.)

The same is likely true and expected for audio; if it is feasible, we could enable a "grow/shrink to fit" if the audio file is at the "fully zoomed out" resolution (minimum pixels/second). If the user has engaged the zoom and is at anything other than this base resolution, the clip should follow the same behavior it does currently, where the spectrogram viewport window acts to mask out anything that goes beyond the boundaries.

If this proposed change is overly complex or not feasible, then I think we would not want to change this behavior and instead have the spectrogram persist its size when the window is resized.

geohacker commented 1 year ago

I agree with @LanesGood that this is not an essential fix. A resize of the window is an intentional operation by the user and with the MVP we are not bound to building responsiveness.

LanesGood commented 1 year ago

Removing bug label, moving to icebox