Files
lokiloto/components/number-frequency-chart.tsx
Nazim KriandClaude Sonnet 5 c36b621d39 Add per-lottery stats page: number frequency, draw timeline, Loki's performance over time
New /loterie/[id] page, linked from each lottery's name in the results
panel. Three visualizations, all derived client-side from LokiLab's
extended army-feed (recentDraws + pickHistory) with no new math on
LokiLab's side:
- NumberFrequencyChart: bar chart of each number's appearances across
  the last ~30 draws
- PerformanceChart: Loki's cumulative win rate over time, line chart
- DrawTimeline: scannable list of recent draws with Loki's pick and
  hit highlighting where available

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-30 09:10:26 -04:00

28 lines
1.1 KiB
TypeScript

"use client"
import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"
import type { FrequencyPoint } from "@/lib/chart-data"
export function NumberFrequencyChart({ data }: { data: FrequencyPoint[] }) {
return (
<ResponsiveContainer width="100%" height={220}>
<BarChart data={data} margin={{ left: 0, right: 8, top: 8, bottom: 0 }}>
<CartesianGrid strokeDasharray="3 3" stroke="var(--border)" vertical={false} />
<XAxis dataKey="number" tick={{ fill: "var(--muted-foreground)", fontSize: 11 }} />
<YAxis tick={{ fill: "var(--muted-foreground)", fontSize: 11 }} allowDecimals={false} />
<Tooltip
contentStyle={{
background: "var(--panel)",
border: "1px solid var(--border)",
borderRadius: 6,
fontSize: 12,
}}
cursor={{ fill: "var(--panel-hover)" }}
labelFormatter={(v) => `Numéro ${v}`}
/>
<Bar dataKey="count" name="Apparitions" fill="var(--accent)" radius={[3, 3, 0, 0]} />
</BarChart>
</ResponsiveContainer>
)
}