/claim #1162
This PR implements a historical date picker feature that allows users to view map and site data from past dates, enabling exploration of historical coral bleaching events and temperature patterns.
Backend Changes:
at parameter to FilterSiteDto for ISO 8601 date queriesgetCollectionData() to query daily_data table for historical dates (not latest_data)daily_data table contains pre-aggregated weeklyAlertLevel and dailyAlertLevel which determine marker colorsSitesService.find() to parse and pass the date parameterFrontend Changes:
HistoricalDatePicker component with Material-UI dialogsitesRequest()GET /sites?at=2024-03-01The previous PR #1177 attempted to use latest_data or time_series tables, but these don’t contain the aggregated alert levels needed for marker coloring. This implementation correctly uses the daily_data table which has:
weeklyAlertLevel - determines marker color (0-5 scale)dailyAlertLevel - daily alert statussatelliteTemperature - historical temperature datadegreeHeatingDays - DHW accumulationGET /api/sites?at=2024-03-01I will provide a demo video showing:
(Demo video to be added once I can test with a working database)
The date picker appears as a floating calendar icon button:
Note: This implementation addresses all feedback from PR #1177:
✅ Uses daily_data table (not latest_data)
✅ Better UI with modal calendar icon
✅ Actually works - changing dates changes marker colors
✅ Ready to extend to site detail pages
buildingvibes
@buildingvibes
Aqualink.org
@aqualinkorg