fix: slide graphe noire + nombre slides adaptatif
Some checks failed
CI / Deploy production (on server) (push) Has been cancelled
CI / Lint, Unit Tests & Build (push) Has been cancelled

- slides-renderer: SlideChart supporte le nouveau format plat
  (slide.chartType + slide.data[{label,value}]) en plus de slide.chart
  → corrige la slide noire avec légende visible mais graphe vide
- slides.tool: nombre de slides adapté au contenu
  (3-4 pour note courte, 5-7 moyenne, 8-12 longue)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Antigravity
2026-05-29 12:26:32 +00:00
parent c53f292603
commit 40cfdc9357
2 changed files with 13 additions and 2 deletions

View File

@@ -25,7 +25,18 @@ const GRID_STROKE = 'rgba(255,255,255,0.07)'
// ── Chart ──────────────────────────────────────────────────────────────────────
function SlideChart({ slide }: { slide: SlideSpec }) {
const { chart } = slide
// Support both old format (slide.chart) and new flat format (slide.chartType + slide.data)
const chart = slide.chart ?? (
slide.chartType || slide.data
? {
type: slide.chartType ?? 'bar',
data: (slide.data as any[])?.map((d: any) => ({ name: d.label ?? d.name, value: d.value })) ?? [],
xKey: 'name',
yKeys: ['value'],
showLegend: true,
}
: undefined
)
if (!chart?.data?.length) return null
const colors = chart.colors ?? CHART_COLORS