import type { VisualizationOptions } from '../../types'; /** * SankeyDataItem is the type for each data item in the sankey chart. */ export type SankeyDataItem = { source: string; target: string; value: number; }; /** * SankeyConfig defines the configuration for rendering the sankey chart. */ export interface SankeyConfig { type?: 'sankey'; data: SankeyDataItem[]; nodeAlign?: 'left' | 'center' | 'right' | 'justify'; theme?: 'default' | 'academy' | 'dark'; title?: string; style?: { backgroundColor?: string; palette?: string[]; }; } /** * SankeyInstance represents a sankey chart instance with render and destroy methods. */ export interface SankeyInstance { render: (config: SankeyConfig) => void; destroy: () => void; } /** * Sankey chart component using G2 5.0. * * @example * ```ts * const sankey = Sankey({ * container: '#container', * width: 600, * height: 400, * }); * * sankey.render({ * type: 'sankey', * data: [ * { source: '煤炭', target: '发电厂', value: 120 }, * { source: '天然气', target: '发电厂', value: 80 }, * { source: '发电厂', target: '工业', value: 100 }, * ], * nodeAlign: 'justify', * theme: 'academy' * }); * * sankey.destroy(); * ``` */ export declare const Sankey: (options: VisualizationOptions) => SankeyInstance;