feat: historical pollution explorer(#892) - #893
Open
PrathamReddy888 wants to merge 6 commits into
Hidden character warning
The head ref may contain hidden characters: "FEATURE]-\ud83d\udcca-Historical-Pollution-Explorer-#892"
Open
Conversation
|
@PrathamReddy888 is attempting to deploy a commit to the Aditya Mahajan's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thank You for Your Contribution! 🎉Hi @PrathamReddy888, Thank you for opening this Pull Request and contributing to our project. We truly appreciate your efforts.
The maintainer @Aditya8369 will review your PR shortly! Happy Contributing! 🚀 |
Owner
|
@PrathamReddy888 change the branch name and push again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Closes #892.
Adds an interactive Historical Pollution Explorer that lets users investigate pollution across years, cities, and pollutants in a single view. Example use case — "compare Pune's PM2.5 between January and August" — is now a one-click preset ("Jan – Aug (this year)").
This builds on the existing
historicalDataService.js(Open-Meteo fetch + IndexedDB cache) andhistoricalAggregate.js(hourly → daily rollup) by adding a higher-level aggregation layer (weekly / monthly / yearly resampling), moving-average computation, period-over-period percentage change, and a multi-location comparison overlay.Related Issue
Closes #892
Type of Change
Changes Made
historicalExplorer.jswith pure helpers (resampling, moving average, % change, half-range change, highest periods, CSV generation).historicalExplorerService.jswith single-city and multi-city fetch (parallel viaPromise.allSettled).HistoricalPollutionExplorer.jsxwith city multi-select, pollutant selector, view toggle, chart-type toggle, date presets, stats strip, charts with moving-average overlay + safe-limit reference line, multi-city comparison chart, highest-periods list, and CSV export.App.jsxupdated with import, nav entry, and render branch.Testing
Test Coverage:
historicalExplorer.test.js: 34 cases covering resampling, moving average, % change, half-range change, highest-periods ranking, CSV generation.HistoricalPollutionExplorer.test.jsx: 8 cases covering loading, success render, error state, multi-city comparison, CSV export, pollutant switching, view switching, highest-periods list.Screenshots
not applicable
Checklist
Additional Notes
Architecture decisions:
Promise.allSettledensures multi-city fetch resilience.Out of scope / follow-ups: