From 05e7046de495ee3b88590476f05b37752f4e3e97 Mon Sep 17 00:00:00 2001 From: caty21 Date: Mon, 29 Jun 2026 12:45:15 +0200 Subject: [PATCH] fix(OIS): restaure graphique probabilites original (LineChart probMovePct par reunion + pic + bps fin an + delta IL) --- components/CurrencyCard.tsx | 99 ++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/components/CurrencyCard.tsx b/components/CurrencyCard.tsx index 8473426..1ba3c62 100644 --- a/components/CurrencyCard.tsx +++ b/components/CurrencyCard.tsx @@ -739,55 +739,66 @@ function OISEnhancedBlock({ ratePath, syncChartTab, onChartTabChange }: { )} - {/* Chart 3 — Probabilités : barre de probabilité par réunion + bps cumulés */} + {/* Chart 3 — Probabilités : ligne de probMovePct par réunion (style original) */} {chartTab === "scenarios" && (
-
- Probabilités par réunion -
- Baisse - Hold - Hausse -
-
-
- {scenariosData.map(d => { - const hasProb = d.prob > 0; - const mlIsMove = d.prob >= 50; - const displayProb = hasProb ? (mlIsMove ? d.prob : 100 - d.prob) : 0; - const barColor = !hasProb - ? "#334155" - : mlIsMove ? (d.isCut ? "#38bdf8" : "#f87171") : "#f59e0b"; - const dirArrow = !hasProb ? "?" : mlIsMove ? (d.isCut ? "▼" : "▲") : "—"; - const arrowCls = !hasProb ? "text-slate-700" : mlIsMove ? (d.isCut ? "text-sky-400" : "text-red-400") : "text-amber-400"; - const isPeak = ratePath.peakMeeting?.dateIso === d.dateIso; - const cum = d.cumulBps; - const cumLabel = cum === 0 ? "0bps" : `${cum > 0 ? "+" : ""}${cum}bps`; - const cumCls = cum < 0 ? "text-sky-400" : cum > 0 ? "text-red-400" : "text-slate-600"; - return ( -
- - {d.label} + + ({ label: m.label, prob: m.probMovePct, isCut: m.probIsCut, impliedRate: m.impliedRate }))} + margin={{ top: 5, right: 5, left: -20, bottom: 0 }} + > + + `${v}%`} /> + + + { + if (!payload?.length) return null; + const v = payload[0]?.value as number; + const m = chartMeetings.find(m => m.label === label); + return ( +
+

{label}

+

+ {v.toFixed(0)}% {m?.probIsCut ? "Cut" : "Hike"} +

+

+ Implicite : {m?.impliedRate.toFixed(2)}% +

+
+ ); + }} + /> +
+
+ {/* Résumé : pic + bps fin an + flèches vs sem. préc. */} + {ratePath.peakMeeting && ( + <> +
+ + Pic : {ratePath.peakMeeting.label} + + + {ratePath.peakMeeting.probMovePct.toFixed(0)}% {ratePath.peakMeeting.probIsCut ? "Cut" : "Hike"} + + {bpsYE !== null && ( + + {bpsYE > 0 ? "+" : ""}{bpsYE}bps fin an -
-
-
- {hasProb ? ( - - {Math.round(displayProb)}% - - ) : ( - n/a + )} +
+ {ilDelta && (Math.abs(ilDelta.probDelta) >= 3 || Math.abs(ilDelta.bpsDelta) >= 5) && ( +
+ vs sem. préc. : + + {ilDelta.bpsDelta !== 0 && ( + )} - {dirArrow} - {cumLabel}
- ); - })} -
+ )} + + )}
)}