Closed nickreich closed 8 months ago
Maybe something like the "quick query" feature (my term) that we added for forecasts: https://zoltardata.com/forecast/106743?unit=4725&target=3625#search . It's a kind of permalink, I suppose.
Yeah, exactly.
Question: Would you want to update the browser history with every click so that users can go forward and back? ( https://reichlab.io/flusight-eval/ does this). The possible problem with doing so is that the history could get pretty long - not a memory problem, but more of unnecessary work that would show up in the browser's back/forward dropdown menu. If we did not support history then the URL would still be updated with each click, but forward/back would not be possible.
I think we don't need to update browser history -- the main use case is probably sharing links to specific views, not necessary navigating with a back/forward button in the browser
Regarding url parameter names and encoding, I suggest the following:
as_of
, interval
, target_var
: straightforward single-value encoding, no quotesmodel
: encode each model in its own parameter with not quotes. this will result in duplicate "model" keys if more than one model is specified, but this is a valid use of params. there are two models in the example belowoptions
object. there are two task IDs in the example below - scenario_id
and location
-> Firefox parses these seven params as:
Adding comments about possibly fixing the y-axis as part of this...
Draft statement of desired behavior:
The updated functionality looks good to me. I'll note that I tried to manually change one of the dates and it ended up at a place with no data, and a very empty looking window. direct link
Maybe this is a separate issue, but we are maybe introducing the possibility of directly navigating to a place with no data to show, with editable urls?
Good catch, Nick. Looking at the browser console I see the problem:
Uncaught (in promise) initial_as_of not in available_as_ofs: 2022-01-30
What's going on is that the program reads parameters (if present) from the URL and then validates them, same as is done with the initial options
that are passed to predtimechart by clients like zoltar or Covid-19-Hub-Vizualization . I'm not sure how the offending as_of
got into the URL parameters without manual editing (there may be a bug - Nick, maybe you can clarify how you got that as_of=2022-01-30
?), but using the calendar and arrows, the closest valid as_ofs
are 2022-01-29 and 2022-02-05.
As a solution, maybe we can have a bailout where, if the offending parameter was loaded from the URL, then all of the URL parameters are dropped. This would put the program into an initial "good" state, assuming the above options
values were configured properly by the client.
Following up, we decided to go ahead with the bailout, but it needs to inform the user of its actions and why.
If I'd like to share a link to a specific plot, e.g. a specific set of drop-down and check-box selections, could those be encapsulated within a custom url? Say I want to send someone to the page with a specific set of models and a specific date chosen, I can't do that right now. There are a lot of knobs here (e.g. the axis limits?), so it might get too messy, but a way to specify an outcome, unit, interval, models, and date would be really nice so that the link could then be passed along to others to see and explore what you are looking at.