cmu-delphi / www-epivis

An interactive tool for visualizing epidemiological time-series data.
http://delphi.cmu.edu/epivis/
MIT License
1 stars 3 forks source link

Make "autofit" a proper mode #44

Closed melange396 closed 3 weeks ago

melange396 commented 1 month ago

With #36, "Automatically fit data" is a toggleable option. Unfortunately, it comes with some surprising behavior: for instance, if a user has autofit turned on and they are looking at a number of signals, and they turn some signals off and zoom in for a better look, and then turn one of those other signals back on to compare it up close, they will lose the specific view they had.

Make this into its own proper "mode", joining the three existing modes already available in the top menu (Pan, Crop, Zoom). Its button should be moved adjacent to the other three as well.

One way to handle this would be that we could switch to "auto-fit mode" when adding a new signal to the canvas (but not when simply toggling an existing signal). While in "auto-fit mode", clicking the mouse inside the view canvas to pan or using the scroll wheel to zoom should switch to "pan mode". It might be nice to be able to opt out of "auto-fit mode" when adding new signals, which could be done with a checkbox in the signal load dialog.

This was originally mentioned in https://github.com/cmu-delphi/www-epivis/pull/36#pullrequestreview-1945159659