import { CSSProperties, ReactElement, ReactNode } from 'react'; import { SankeyGraph, SankeyLink, SankeyNode } from '../engine/sankey'; import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types'; import { CardRange } from './cartesian-card'; import { NumericKey, TextKey } from './keys'; import { AnimatedNumberVariant } from '../motion/animated-number'; export interface SankeyChartCardProps> { /** Optional visible title. Use aria-label to name an embedded chart. */ title?: string; /** Show the header, including headline and period controls. Defaults to true. */ header?: boolean; /** Accessible name, independent of the visible title. */ 'aria-label'?: string; /** One row per flow between two steps. Omit when `ranges` supplies the data. */ data?: readonly Row[]; /** Text field naming the step a flow leaves. */ source: TextKey; /** Text field naming the step a flow reaches. */ target: TextKey; /** How much moves along the flow. `null` means it wasn't measured and isn't drawn. */ value: Key; /** * `loss` (default) lets a step pass on less than it receives, as when visitors leave; * `strict` requires every middle step to pass on exactly what it receives. */ conservation?: 'loss' | 'strict'; /** Plot height in pixels. Defaults to 280. */ /** * Gives the diagram depth: flows become lit pipes and nodes small blocks. Flow widths and node * heights stay exact. */ depth?: boolean; height?: number; /** Resting headline. Defaults to everything entering the first steps. */ headline?: number; /** Fractional change shown as a chip, e.g. 0.052 → +5.2%. */ delta?: number; deltaTone?: 'default' | 'inverse' | 'neutral'; /** Static period label, e.g. "Last 7 days". */ range?: string; /** Period select. Each range replaces data, delta, and headline; flows redraw left to right. */ ranges?: readonly CardRange[]; defaultRange?: string; valueFormat?: Intl.NumberFormatOptions; locale?: string; formatValue?: (value: number) => string; surface?: ChartSurface; /** A glass tab tucked behind the card's top edge, e.g. a caption, a command, or actions. */ badge?: ReactNode; /** Headline motion: `count` (default), `pop`, `slide`, `roll`, `flow`, or `scramble`. */ numberStyle?: AnimatedNumberVariant; palette?: ChartPalette; loading?: boolean; loadingStyle?: ChartLoadingStyle; /** * What the card shows when the period has no data: `dots` (default), the chart's own `shape`, * your own element such as `No visits yet`, or `null` for nothing. */ empty?: ChartEmptyState; /** `none` turns off decorative motion; reduced-motion users get this automatically. */ motion?: ChartMotion; className?: string; style?: CSSProperties | ChartStyle; } interface FlowGraph { graph: SankeyGraph | null; error: string | null; } /** Turn rows of flows into a validated graph; steps take their names from the rows. */ export declare function sankeyGraph({ data, source, target, value, conservation, }: { data: readonly Row[]; source: string; target: string; value: string; conservation: 'loss' | 'strict'; }): FlowGraph; /** * A Sankey card: steps as columns of nodes, flows between them as ribbons whose thickness is the * amount that moved. Hovering or stepping through flows with the arrow keys reads each in the * headline with its share of the step it left. */ export declare function SankeyChartCard>({ title, header, 'aria-label': ariaLabel, data: suppliedData, source, target, value, conservation, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: SankeyChartCardProps): ReactElement; export {};