From 8cd3b89fa313883e347e4bd643791f1c2ce0f429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Tue, 25 Nov 2025 22:33:58 +0100 Subject: [PATCH] funnel --- .../components/report-chart/funnel/chart.tsx | 55 +++++++++++++------ apps/start/src/modals/view-chart-users.tsx | 1 - 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/apps/start/src/components/report-chart/funnel/chart.tsx b/apps/start/src/components/report-chart/funnel/chart.tsx index 5c7aa4d4..e48fce13 100644 --- a/apps/start/src/components/report-chart/funnel/chart.tsx +++ b/apps/start/src/components/report-chart/funnel/chart.tsx @@ -363,6 +363,7 @@ export function Chart({ data }: { data: RouterOutputs['chart']['funnel'] }) { const rechartData = useRechartData(data); const xAxisProps = useXAxisProps(); const yAxisProps = useYAxisProps(); + const hasBreakdowns = data.current.length > 1; return ( @@ -391,19 +392,37 @@ export function Chart({ data }: { data: RouterOutputs['chart']['funnel'] }) { } /> - } - > - {rechartData.map((item, index) => ( - - ))} - + {hasBreakdowns ? ( + data.current.map((item, breakdownIndex) => ( + } + > + {rechartData.map((item, stepIndex) => ( + + ))} + + )) + ) : ( + } + > + {rechartData.map((item, index) => ( + + ))} + + )} @@ -412,8 +431,6 @@ export function Chart({ data }: { data: RouterOutputs['chart']['funnel'] }) { ); } -type Hej = RouterOutputs['chart']['funnel']['current']; - const { Tooltip, TooltipProvider } = createChartTooltip< RechartData, { @@ -435,7 +452,7 @@ const { Tooltip, TooltipProvider } = createChartTooltip<
{data.name}
- {variants.map((key) => { + {variants.map((key, breakdownIndex) => { const variant = data[key]; const prevVariant = data[`prev_${key}`]; if (!variant?.step) { @@ -445,7 +462,11 @@ const { Tooltip, TooltipProvider } = createChartTooltip<
1 ? breakdownIndex : index, + ), + }} />
diff --git a/apps/start/src/modals/view-chart-users.tsx b/apps/start/src/modals/view-chart-users.tsx index 2c591c89..31c7f760 100644 --- a/apps/start/src/modals/view-chart-users.tsx +++ b/apps/start/src/modals/view-chart-users.tsx @@ -22,7 +22,6 @@ import { ModalHeader } from './Modal/Container'; import { ScrollableModal, useScrollableModal } from './Modal/scrollable-modal'; const ProfileItem = ({ profile }: { profile: any }) => { - console.log('ProfileItem', profile.id); return (