fix: slide graphe noire + nombre slides adaptatif
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user