export interface SankeyNode { id: string; label: string; } export interface SankeyLink { id: string; source: string; target: string; value: number | null; } export type ConservationPolicy = 'strict' | 'allow-loss'; export interface SankeyGraph { nodes: readonly Node[]; links: readonly Link[]; depth: Readonly>; losses: Readonly>; } export interface PositionedSankeyNode extends SankeyNode { depth: number; x: number; y: number; width: number; height: number; total: number; } export interface PositionedSankeyLink extends SankeyLink { path: string; width: number; sourceY: number; targetY: number; } export declare function normalizeSankey(nodes: readonly Node[], links: readonly Link[], conservation: ConservationPolicy): SankeyGraph; export declare function layoutSankey(graph: SankeyGraph, width: number, height: number, compact?: boolean): { nodes: PositionedSankeyNode[]; links: PositionedSankeyLink[]; }; /** * A frame between two layouts of the same flows, at `t` from 0 to 1 (a spring may pass 1). * Nodes move and resize, links keep their ends attached as they thicken or thin, and nodes or * links new to `to` grow from nothing. Matched by id, so a period change reads as the same * flows changing rather than a redraw. */ export declare function mixSankeyLayout(from: { nodes: readonly PositionedSankeyNode[]; links: readonly PositionedSankeyLink[]; }, to: { nodes: readonly PositionedSankeyNode[]; links: readonly PositionedSankeyLink[]; }, t: number): { nodes: PositionedSankeyNode[]; links: PositionedSankeyLink[]; };