Closed stijnvanhoey closed 1 year ago
I think this would be a very useful feature.
@peterdesmet / @stijnvanhoey: do you need help for this? How would you like the error to be shown? Red message below the intro text?
Thanks @niconoe, help would be appreciated. I would would show a message in the top chart, as that's where people's eyes will be drawn to:
Note: the implementation at #193 will show No data found
if no data is pushed to the chart (for whatever reason). It has the advantage that it is simple to implement.
It isn't great for debugging (causes might be 404, data not being processed correctly like for NL radars a while ago, etc.), but it at least informs the user. The most common use case is that there is no source data.
Note: in addition to this, we can easily add another message (displayed globally above all charts - that's a global issue that affect all charts, after all) when a 404 error is encountered, that might help for debugging. In most cases the two messages would appear at the same time, but not always (example: when a chart is partially filled, but one day of data is missing).
From a UI point of view, I would prefer to include this in the main message in the chart.
No data
And in case of 404:
No data found (404)
Let me rephrase, I think the following would make sense. I don't know what is easy to implement though.
Chart is empty be default when it's loading (current behaviour)
In case one of the requested files returns a 404 and no data is pushed to the chart, show No data found (404)
on chart.
No message is shown here, because other dates (with data) push data to chart:
Cannot process data
.I'm open to alternative approaches, but I would prefer to show information in a single place only, preferably on the chart. @CeciliaNilsson709 @baptischmi any preference/suggestions?
@peterdesmet: I initially tried something like that, but that lead to circumvented code and ambiguous messages for a series of reason (multiple components with different concerns, and edge cases, I can elaborate if necessary).
If your request for 404 errors is solely for debugging purposes, would that work to not show them directly to the end-users (keeping it like it is in the PR now), but log the 404 in the JS console?
but log the 404 in the JS console?
Yes, an informative message in the JS for every file that returns a 404 would be good.
I think for the end user an important distinction would be between no data (for whatever reason) and data but no birds. Is that possible, for example in Peters second case above?
no data (for whatever reason) and data but no birds
The difference would be a message saying No data found
(for whatever reason) and an empty chart.
So not like in your second example then?
but log the 404 in the JS console?
Yes, an informative message in the JS for every file that returns a 404 would be good.
Hmmm I wanted to implement that, but realize that if it is only for debugging purposes, it's already provided by the browser 🥇
@CeciliaNilsson709 you are right, for charts that have some data (April 24), it would not be possible for users to know whether April 25 and 26 have no bird data or if there was no data found:
@niconoe do you think it possible to show the No data found
message per day (pinned at noon) in the chart? Or a grayed out area?
Well everything is possible but I think we should take care of keeping the complexity manageable given the nasty edge cases (for example, the 1:1 correlation between days and files only works only in UTC mode)
Yeah, thinking about it a bit more, then only way I see to correctly differentiate between no bird data and no data found is by graying out the area, like so (this is actual data):
@niconoe I'm not sure how complex that is? And in the absence of that approach, #193 is already an improvement!
The pull request is now deployed, also on aloft (navigate to the next day). I will close this issue now:
When files are not available server-side there is a 404 in the app, but this information is not passed to the frontend/user. Also a 'future'-file request should return the same error.