Skip to content

Conversation

@melange396
Copy link
Contributor

Epivis direct links (with dataset information encoded in an epivis url) can include a "viewport" parameter that represents the graph axis extents at time of link generation. The recently added "autofit" mode functionality broke this, by automatically zooming to see the entirety of all the current signals on load. This PR should now restore the saved viewport when it is present, or default to autofit behavior when viewport is not provided in the URL.

@melange396
Copy link
Contributor Author

zoomed view with saved viewport:
https://deploy-preview-114--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6WzczNzMyOC43NTkxOTIzNjk1LDAuNzI0NDEzNzYxOTQxOTc5Nyw3MzgzMzkuNDI5OTA2ODE1NCwxLjcyODk3ODk3MzUwNzUzMV0sInNob3dQb2ludHMiOmZhbHNlfSwiZGF0YXNldHMiOlt7ImNvbG9yIjoiIzhiYjNiMSIsInRpdGxlIjoiJXdJTEkiLCJwYXJhbXMiOnsiX2VuZHBvaW50IjoiZmx1dmlldyIsInJlZ2lvbnMiOiJuYXQifX1dfQ==
(url encodes:

{"chart":{"viewport":[737328.7591923695,0.7244137619419797,738339.4299068154,1.728978973507531],"showPoints":false},"datasets":[{"color":"#8bb3b1","title":"%wILI","params":{"_endpoint":"fluview","regions":"nat"}}]}

)

same but with viewport NULL:
https://deploy-preview-114--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6bnVsbCwic2hvd1BvaW50cyI6ZmFsc2V9LCJkYXRhc2V0cyI6W3siY29sb3IiOiIjOGJiM2IxIiwidGl0bGUiOiIld0lMSSIsInBhcmFtcyI6eyJfZW5kcG9pbnQiOiJmbHV2aWV3IiwicmVnaW9ucyI6Im5hdCJ9fV19
(url encodes:

{"chart":{"viewport":null,"showPoints":false},"datasets":[{"color":"#8bb3b1","title":"%wILI","params":{"_endpoint":"fluview","regions":"nat"}}]}

)

same but with no viewport:
https://deploy-preview-114--cmu-delphi-epivis.netlify.app/#eyJjaGFydCI6eyJzaG93UG9pbnRzIjpmYWxzZX0sImRhdGFzZXRzIjpbeyJjb2xvciI6IiM4YmIzYjEiLCJ0aXRsZSI6IiV3SUxJIiwicGFyYW1zIjp7Il9lbmRwb2ludCI6ImZsdXZpZXciLCJyZWdpb25zIjoibmF0In19XX0=
(url encodes:

{"chart":{"showPoints":false},"datasets":[{"color":"#8bb3b1","title":"%wILI","params":{"_endpoint":"fluview","regions":"nat"}}]}

)

live epivis site with saved viewport (same url hash and encoded payload as the top link ^ but this does the autofit and does not preserve the viewport):
https://delphi.cmu.edu/epivis/#eyJjaGFydCI6eyJ2aWV3cG9ydCI6WzczNzMyOC43NTkxOTIzNjk1LDAuNzI0NDEzNzYxOTQxOTc5Nyw3MzgzMzkuNDI5OTA2ODE1NCwxLjcyODk3ODk3MzUwNzUzMV0sInNob3dQb2ludHMiOmZhbHNlfSwiZGF0YXNldHMiOlt7ImNvbG9yIjoiIzhiYjNiMSIsInRpdGxlIjoiJXdJTEkiLCJwYXJhbXMiOnsiX2VuZHBvaW50IjoiZmx1dmlldyIsInJlZ2lvbnMiOiJuYXQifX1dfQ==

@melange396 melange396 merged commit 03715c7 into dev Mar 25, 2025
6 checks passed
@melange396 melange396 deleted the dont_autofit_directlinks branch March 25, 2025 17:37
@melange396 melange396 mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve saved "viewport" graph extents in URL-encoded links

3 participants