import type { VisualizationOptions } from '../../types'; /** * WaterfallDataItem is the type for each data item in the waterfall chart. */ export type WaterfallDataItem = { category: string; value?: number; isIntermediateTotal?: boolean; isTotal?: boolean; }; /** * WaterfallConfig defines the configuration for rendering the waterfall chart. */ export interface WaterfallConfig { type?: 'waterfall'; data: WaterfallDataItem[]; theme?: 'default' | 'academy' | 'dark'; title?: string; axisXTitle?: string; axisYTitle?: string; style?: { backgroundColor?: string; /** * Custom color palette for waterfall bars. * Array order: [0] positive color, [1] negative color, [2] total/intermediate-total color. * Defaults: ['#FF4D4F', '#2EBB59', '#1783FF'] */ palette?: string[]; }; } /** * WaterfallInstance represents a waterfall chart instance with render/destroy. */ export interface WaterfallInstance { render: (config: WaterfallConfig) => void; destroy: () => void; } /** * Waterfall chart component using G2 5.0. * * @example * ```ts * const waterfall = Waterfall({ * container: '#container', * width: 600, * height: 400, * }); * * waterfall.render({ * type: 'waterfall', * data: [ * { category: '期初利润', value: 100 }, * { category: '销售收入', value: 80 }, * { category: '运营成本', value: -50 }, * { category: '税费', value: -20 }, * { category: '总计', isTotal: true }, * ], * theme: 'academy' * }); * * waterfall.destroy(); * ``` */ export declare const Waterfall: (options: VisualizationOptions) => WaterfallInstance;