WFP-VAM / prism-app

PRISM is an interactive map-based dashboard that simplifies the integration of geospatial data on hazards, along with information on socioeconomic vulnerability
MIT License
45 stars 33 forks source link

Decide how to handle overlapping dates #1266

Open ericboucher opened 1 month ago

ericboucher commented 1 month ago

Provide a clear and concise description of what you want to happen.

With the new date range vizualiation implemented in #1263, we are facing a few UX issues on how to handle overlapping date ranges for the same layer

Is there anything else you can add about the proposal? You might want to link to related issues here, if you haven't already.

No response

wadhwamatic commented 1 month ago

@ericboucher - can you remind me, when do we have overlapping dates for the same layer?

wadhwamatic commented 3 weeks ago

@ericboucher - here's how I think this should work for WFP HDC layers:

When a user selects a date, we can safely assume they have selected the last dekad in the date range. This means that if the HDC layer is for 1-month (3 dekads long), the date selected is the 3rd dekad, which is closest available date noted in the HDC layer's available dates. Then, in this case, we visualize the layer as active for the two previous dekads, and the last one.

A concrete example:

  1. Use PR https://github.com/WFP-VAM/prism-app/pull/1271
  2. Load Rainfall > Global rainfall products > Rainfall aggregate > 1-month
  3. By default, we see the right behavior - the latest available date is activated and the timeline visualizes dekad 3 and forward as valid, and dekads 1 and 2 backwards as valid.
  4. Choose another date - 2024-April-12
  5. This should assume that the closest dekad starting point is the 3rd dekad in the 1-month product, which in this case should be 11-April (the 2nd dekad of the month)
  6. We should see 11-20 April as valid as the 3rd dekad of this 1-month product. We should also see 21-31 March (1st dekad) and 1-10 April (2nd dekad)
  7. In total, the active layer / date should cover the period starting 21-March and until 20-April

The same logic applies regardless of the length of the product. I.e., if it's a 3-month product (which is a total of 9 dekads long), we still assume the user's date selection matches the 9th dekad.

Hope this is clear!