Skip to content

Visualization suite: commune pages, explorer, drill-down maps, UX overhaul - #39

Merged
glopez-dev merged 8 commits into
mainfrom
feat/viz-suite
Jul 8, 2026
Merged

Visualization suite: commune pages, explorer, drill-down maps, UX overhaul#39
glopez-dev merged 8 commits into
mainfrom
feat/viz-suite

Conversation

@glopez-dev

Copy link
Copy Markdown
Contributor

Quoi

Neuf commits qui livrent le catalogue de visualisations et la passe UX/navigation :

Nouvelles vues

  • /commune/:code : fiche complète — stat tiles, radar des 9 dimensions pondérées du score (Recharts), évolution des prix 2021-2025 avec référence nationale, histogramme de position (département/France), section avis NLP (nuage de mots d3-cloud filtrable par thème, sentiment par thème, verbatims), grille d'indicateurs.
  • /comparer?a=&b= : deux communes côte à côte (radars et évolutions superposés, tableau), URL = source de vérité.
  • /explorer : distribution nationale des prix par type, scatter prix × qualité de vie (~4k points échantillonnés, couleur = écart), palmarès des régions (barres + tableau).
  • Recherche globale Ctrl+K (34 933 communes, tolérante accents/tirets, Radix Dialog).

Cartes

  • /carte : drill-down 3 niveaux (régions → départements → communes) avec fil d'Ariane, modes bulles et heatmap/isolignes (100k mutations réelles, points individuels au-delà du zoom 11), LOD fin par département visible, première légende chiffrée de la carte.
  • /map : maille adaptative selon le zoom (fini les 34 928 polygones au zoom 5 — le national charge ~30 Ko de régions), métriques prix ajoutées au sélecteur et au bivarié, migration hors du score.geojson déprécié vers la choroplèthe versionnée par meta.base, sidebar groupée, drawer mobile.
  • Barre de navigation commune aux deux cartes (nav, Ctrl+K, thème, lien croisé conservant la zone), état complet dans l'URL.

Cohérence

  • lib/palettes.ts : source unique des couleurs — prix YlOrRd partout, écart qualité/prix PRGn violet/vert partout (4 codages contradictoires avant).
  • Légendes chiffrées sur toutes les cartes, états loading/erreur standardisés, variant accent du Button, dark-mode toggle visible, classement sous PageShell, landing reliée aux 6 routes.
  • Popup nuage de mots branché sur les artefacts avis/ du CDN : -19 000 lignes de données committées supprimées (public/data/*, parseAvis.ts).

Données

Consomme le run 2026-07-07 du bucket (publié) : agrégats régions/départements avec médianes du score et des 12 dimensions, avis/{dept}.json + avis/index.json, points/transactions-sample.json, charts/* intégrés à publish-web. PR pipeline associée : T-DAT-902-Homepedia/pipelines feat/viz-data.

Tests

typecheck, test (33), build verts ; parcours navigateur complet vérifié (drill-down, deep-links, recherche clavier, mailles adaptatives contrôlées au réseau).

🤖 Generated with Claude Code

…ection

- /commune/:code: header stat tiles, weighted 9-dim score radar (Recharts),
  price evolution with national reference, dept/national price histogram,
  indicator grid, resident reviews section (word cloud via d3-cloud,
  per-theme sentiment bars, filterable verbatims) gated on nb_communes_avis
- /comparer?a=&b=: URL-driven two-commune comparison (overlaid radars and
  evolutions, side-by-side indicator table, fixed slot colors)
- /explorer: national price distribution, price x score scatter colored by
  quality/price gap (stratified sampling), regions leaderboard and table
- global Ctrl+K search palette over the 34 933-commune index (accent-free
  prefix ranking, INSEE/department code queries)
- map click opens the commune page; meta schema tolerates additive fields
- pure helpers (histogram, sampling, search ranking) covered by Vitest
…on /map

- /carte: 3-level mesh (regions > departements > communes) with click-to-zoom
  drill-down, representation switcher (choropleth / bubbles / heatmap with
  density isolines from the published transaction sample), 'Tous' type filter,
  fine communes-high LOD loaded per visible departement above zoom 10
- /map: migrated off the deprecated v1/score.geojson to the versioned
  choropleth (meta.base), adds prix / prix maisons / prix appartements to the
  metric selector and the bivariate mode; commune panel links to the full page
- /classement: fiche and compare shortcuts; landing stats fed by meta.json
- shared NAV (lib/nav.ts) with explicit labels (Carte des prix / Qualite
  de vie); /classement moves under PageShell; landing links every route
  (footer included) and its main CTA now opens the price map
- PageShell: burger menu below md, visible theme toggle (the 'd' shortcut
  stays and is advertised in the tooltip)
- /map default basemap: satellite -> light (choropleth-friendly first paint)
- standardized loading/error wording (status-hint) and NA placeholder
  (kills the scattered 'n/d'); accent Button variant replaces 6 hardcoded
  copies; /carte isolines checkbox switches to Radix like /map
- price histogram reference label no longer clips
…, accessible dialogs

- lib/palettes.ts becomes the single color source: prices read YlOrRd on
  every page (/map included), the quality/price gap reads PRGn purple/green
  everywhere (map, explorer scatter, rankings, comparer, fiche tiles,
  review sentiment) instead of four conflicting encodings
- numeric legends: /carte gains its first legend (quantile bins with real
  thresholds, bubble calibration, heat gradient + isoline thresholds);
  /map legends now show real bounds (quantile bins, -q95/0/+q95 diverging,
  tercile thresholds on the 3x3 bivariate matrix)
- /map metric selector grouped (Synthese / Prix / Qualite de vie)
- search palette and word-cloud popup move to Radix Dialog (focus trap,
  role, Escape); the popup now renders the shared d3-cloud component fed
  by the CDN avis artifacts — public/data/wordcloud.json (15.7k lines),
  avis_top80.csv and lib/parseAvis.ts are deleted
- MapTopBar overlay on both full-screen maps: shared nav, Ctrl+K search,
  theme toggle and a cross-link keeping the current viewport ('Voir en
  qualite de vie' / 'Voir en prix' via the shared v= param)
- URL state: /carte persists view, representation, property type and heat
  options; /map persists metric, bivariate pair, basemap and view through
  merging patchParams (the previous setSearchParams({commune}) wiped
  everything else)
- adaptive representations on /carte: bubble radius now scales continuously
  with zoom, heatmap radius tightens as you zoom, and beyond zoom 11 the
  heatmap hands over to individually priced sale points (YlOrRd quantiles,
  hover tooltip, dedicated legend)
- drill-down breadcrumb (France > region > departement) with click-to-return,
  truncated automatically on manual dezoom
- useScoreMesh: /map now renders regions below zoom 5.5, departements up
  to 8, then communes — no more 34 928 polygons (3.4 MB) at national zoom.
  Published median aggregates (score, gap, 12 dimensions under the same n_*
  names) make every metric and the bivariate mode work at every mesh;
  clicking a region or departement zooms into it, communes still open the
  side panel. Deep links ?commune= resolve through the commune mesh
  regardless of the displayed one
- mobile: sidebar becomes a left drawer behind a floating Reglages button
  below md, the commune panel docks as a bottom sheet, hover tooltips are
  hidden for coarse pointers
@glopez-dev
glopez-dev merged commit a2dac6b into main Jul 8, 2026
1 check passed
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 0791df4):

https://homepedia-webapp-cceb1--pr39-feat-viz-suite-s8gspw8t.web.app

(expires Wed, 15 Jul 2026 13:51:41 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: d658a29abdbf114e447bbe4bc722d35620c3ead7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant