export interface SankeyInputNode { id: string; } export interface SankeyInputLink { source: string; target: string; value: number; } export interface SankeyLaidOutNode { id: string; meta?: TNodeMeta; /** Layer index (0 = leftmost). */ layer: number; /** Left pixel coordinate (X0). */ x0: number; /** Right pixel coordinate (X1 = X0 + nodeWidth). */ x1: number; /** Top pixel coordinate. */ y0: number; /** Bottom pixel coordinate. */ y1: number; /** Effective node value (max(Σ incoming, Σ outgoing)). */ value: number; sourceLinks: SankeyLaidOutLink[]; targetLinks: SankeyLaidOutLink[]; } export interface SankeyLaidOutLink { source: SankeyLaidOutNode; target: SankeyLaidOutNode; value: number; meta?: TLinkMeta; /** Y coordinate at the source node (midpoint of the link height). */ y0: number; /** Y coordinate at the target node. */ y1: number; /** Pixel width of the link (proportional to value). */ width: number; /** Index (for stable ordering / iteration). */ index: number; } export interface SankeyLayoutOptions { /** Total width of the layout area in pixels. */ width: number; /** Total height of the layout area in pixels. */ height: number; /** Width of a node. @default 24 */ nodeWidth?: number; /** Vertical spacing between nodes within a layer. @default 8 */ nodePadding?: number; /** Number of relaxation iterations. @default 6 */ iterations?: number; /** Layer alignment. @default 'justify' */ nodeAlign?: 'left' | 'right' | 'center' | 'justify'; } export interface SankeyLayoutResult { nodes: SankeyLaidOutNode[]; links: SankeyLaidOutLink[]; } export declare function computeSankeyLayout(inputNodes: ReadonlyArray, inputLinks: ReadonlyArray, options: SankeyLayoutOptions): SankeyLayoutResult; /** * Generate a cubic Bézier path between the source and target endpoints of a * Sankey link. The control points sit at half the X distance, producing the * characteristic S-curve. */ export declare function sankeyLinkPath(link: SankeyLaidOutLink): string;