feat: Vigilance API officielle + tab 1 an + logo SVG + map à 5xl
Some checks are pending
Deploy info-canicule / deploy (push) Waiting to run

1. lib/vigilance.ts : provider Météo France officielle via DPVigilance/v1
   /cartevigilance/encours. Map vers VigilanceAlert (1 par dept × phen × J/J1)
   en prenant phenomenon_max_color_id (pire de la journée). Filtre les domains
   non-dept (FRA national, sub-côtes XX10, etc).
   - Auto-pick : MF si key dispo, sinon opendatasoft. Override VIGILANCE_PROVIDER.
   - Fallback opendatasoft si MF échoue (cache key différent pour pas polluer).
   - Devrait fixer le lag de plusieurs heures observé sur Opendatasoft.

2. lib/climato.ts : fetch latest + previous (~4 MB compressé), garder 365j max
   en cache 24h. Permet l'onglet "1 an" sur la page dept.

3. TemperatureChartInteractive : onglet "1 an" (apparaît si > 30j dispos),
   série days365 + normales365 sérialisés au SSR.

4. Base.astro : logo header et footer utilisent <img src="/favicon.svg">
   au lieu d'un emoji 🌡️.

5. index.astro : wrapper map repassé à container-tight (max-w-5xl) — la version
   1400px était trop grande, on revient à la largeur du reste du site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Florian 2026-05-26 01:57:35 +02:00
parent cb8d111a12
commit 5f8b765d79
7 changed files with 189 additions and 63 deletions

View file

@ -57,13 +57,16 @@ if (!drom) {
const last7 = climato?.days?.slice(-7) ?? [];
const last30 = climato?.days?.slice(-30) ?? [];
const last365 = climato?.days?.slice(-365) ?? [];
let normales365: Array<{ tx: number | null; tn: number | null }> = [];
if (!drom) {
const series7 = await normalesForRange(dept.code, last7.map((d) => d.date));
normales7 = series7.map((n) => ({ tx: n?.tx ?? null, tn: n?.tn ?? null }));
const series30 = await normalesForRange(dept.code, last30.map((d) => d.date));
normales30 = series30.map((n) => ({ tx: n?.tx ?? null, tn: n?.tn ?? null }));
// Normale "du jour courant" (pour overlay du graphe 24h, ligne horizontale)
const series365 = await normalesForRange(dept.code, last365.map((d) => d.date));
normales365 = series365.map((n) => ({ tx: n?.tx ?? null, tn: n?.tn ?? null }));
normaleHourly = await normaleForDate(dept.code, new Date());
if (normaleHourly) normaleHourly = { tx: normaleHourly.tx, tn: normaleHourly.tn };
}
@ -187,8 +190,10 @@ const adviceFor = highest && ADVICE[highest.phenomenonId];
hourly={hourly}
days7={last7}
days30={last30}
days365={last365}
normales7={normales7}
normales30={normales30}
normales365={normales365}
normaleHourly={normaleHourly}
stationLabel={stationLabel}
/>

View file

@ -110,7 +110,7 @@ const productDate = snapshot?.productDatetime
Survolez un département pour voir le détail des alertes, cliquez pour la page complète.
</p>
</section>
<div class="mx-auto w-full max-w-[1400px] px-4 pb-4 sm:px-6">
<div class="container-tight pb-4">
<FranceMap colorsByDept={colorsByDept} alertsByDept={alertsByDept} />
</div>
<section class="container-tight pb-8">