diff --git a/components/journeys/SankeyJourney.tsx b/components/journeys/SankeyJourney.tsx index d1958cd..b084b66 100644 --- a/components/journeys/SankeyJourney.tsx +++ b/components/journeys/SankeyJourney.tsx @@ -1,7 +1,7 @@ 'use client' import { useCallback, useEffect, useMemo, useState } from 'react' -import { ResponsiveSankey } from '@nivo/sankey' +import { Sankey } from '@nivo/sankey' import { TreeStructure, X } from '@phosphor-icons/react' import type { PathTransition } from '@/lib/api/journeys' @@ -36,7 +36,7 @@ const COLUMN_COLORS = [ '#EC4899', '#06B6D4', '#EF4444', '#84CC16', '#F97316', '#6366F1', ] -const MAX_NODES_PER_STEP = 15 +const MAX_NODES_PER_STEP = 25 // ─── Helpers ──────────────────────────────────────────────────────── @@ -257,9 +257,11 @@ export default function SankeyJourney({ } const labelColor = isDark ? '#a3a3a3' : '#525252' - const steps = data.nodes.map((n) => n.stepIndex) - const minStep = Math.min(...steps) - const maxStep = Math.max(...steps) + + // Calculate dimensions: give each step ~250px of horizontal space + const numSteps = new Set(data.nodes.map((n) => n.stepIndex)).size + const chartWidth = Math.max(800, numSteps * 250) + const chartHeight = 500 return (