feat: charts data layer and price sparklines (#17, #34) - #38
Merged
Conversation
|
Visit the preview URL for this PR (updated for commit 81557a4): https://homepedia-webapp-cceb1--pr38-feat-charts-data-lay-rrfxwith.web.app (expires Sun, 12 Jul 2026 13:09:57 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: d658a29abdbf114e447bbe4bc722d35620c3ead7 |
5 tasks
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.
Couche data de #17 (côté webapp) + premier consommateur : les sparklines de prix dans
/classement(finit #34).Ce qui change
src/lib/charts.ts: fetchers typés des artefacts{base}/charts/…publiés parpipelines/webapp_export/export_charts.py—fetchCommuneStats(valeurs brutes par commune : chômage, revenu médian, climat, résidences secondaires, distance métropole, transport),fetchPrixDistribution(histogrammes €/m² précalculés),fetchPrixSeries(médianes annuelles 2021–2025 par commune + série nationale). Zod complet pour les petits payloads, enveloppe seule pour les gros (précédentscore.ts). Helper de jointurebyCommune.src/hooks/usePrixSeries.ts: même motif queuseChoropleth(meta.baseen clé,staleTime: Infinity).src/components/sparkline.tsx: mini-courbe SVG faite main — tendance colorée (accent = hausse, rouge = baisse), coupures sur les années sans donnée, valeurs au survol.src/pages/undervalued.tsx: colonne « Prix 2021–25 » ; « — » si < 5 ventes/an ; la table reste fonctionnelle si le fetch des séries échoue.charts.test.ts(jointure, schéma distribution).Données
Générées par
export_charts.py(PR jumelle côté pipelines). Séries limitées à 2021–2025 : geo-dvf ne conserve que les 5 derniers millésimes (2019–2020 → 404). Alsace-Moselle et Mayotte absentes (hors périmètre DVF — Livre foncier).export_charts.py --publish(sinon la colonne sparklines restera vide en prod — la table dégrade proprement, mais autant publier d'abord).Vérifié
tsc, 18 tests, build OK.VITE_DATA_URL=/local-data) : sparklines rendues dans/classement, valeurs recoupées avec la carte (Paris 6ᵉ 14 183 €/m² 2024, Île-Tudy 3 524), tri/filtre/lien carte intacts.