@agions/taroviz 1.6.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +30 -21
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/esm/index.js +49471 -2199
  4. package/package.json +2 -1
  5. package/src/adapters/__tests__/index.test.ts +4 -2
  6. package/src/adapters/h5/index.ts +16 -0
  7. package/src/adapters/types.ts +28 -120
  8. package/src/charts/common/BaseChartWrapper.tsx +193 -32
  9. package/src/charts/index.ts +5 -1
  10. package/src/charts/liquid/index.tsx +227 -0
  11. package/src/charts/liquid/types.ts +130 -0
  12. package/src/charts/tree/index.tsx +117 -0
  13. package/src/charts/tree/types.ts +174 -0
  14. package/src/charts/types.ts +1 -1
  15. package/src/components/DataFilter/index.tsx +587 -0
  16. package/src/core/animation/AnimationManager.ts +69 -42
  17. package/src/core/components/BaseChart.tsx +72 -9
  18. package/src/core/types/common.ts +21 -110
  19. package/src/core/types/index.ts +4 -135
  20. package/src/core/types/platform.ts +38 -230
  21. package/src/core/utils/drillDown.ts +643 -0
  22. package/src/core/utils/export/ExportUtils.ts +10 -1
  23. package/src/core/utils/performance/PerformanceAnalyzer.ts +21 -1
  24. package/src/core/utils/performance/types.ts +5 -0
  25. package/src/hooks/__tests__/index.test.tsx +7 -5
  26. package/src/hooks/index.ts +41 -2
  27. package/src/hooks/useAnimation.ts +427 -0
  28. package/src/hooks/useChartConnect.ts +362 -0
  29. package/src/hooks/useChartDownload.ts +692 -0
  30. package/src/hooks/useDataZoom.ts +323 -0
  31. package/src/hooks/usePerformance.ts +291 -0
  32. package/src/index.ts +25 -2
  33. package/src/themes/__tests__/index.test.ts +7 -13
  34. package/src/themes/index.ts +3 -0
  35. package/src/themes/useAutoTheme.ts +66 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * 水球图组件
3
+ * ECharts 没有内置水球图,使用 echarts-liquidfill 库实现
4
+ */
5
+ import React, { memo, useEffect, useRef, useMemo } from 'react';
6
+ import type { EChartsType, ECElementEvent } from 'echarts';
7
+ import { getAdapter } from '../../adapters';
8
+ import { uuid } from '../../core/utils';
9
+ import { processAdapterConfig } from '../utils';
10
+ import { LiquidChartProps } from './types';
11
+
12
+ /**
13
+ * 水球图组件
14
+ * 使用 echarts-liquidfill 实现
15
+ */
16
+ const LiquidChart: React.FC<LiquidChartProps> = memo((props) => {
17
+ const {
18
+ option,
19
+ width = '100%',
20
+ height = '300px',
21
+ theme,
22
+ style = {},
23
+ className = '',
24
+ autoResize = true,
25
+ loading = false,
26
+ loadingOption,
27
+ onChartInit,
28
+ onChartReady,
29
+ renderer = 'canvas',
30
+ onEvents = {},
31
+ waveData = [0.6],
32
+ shape = 'circle',
33
+ amplitude,
34
+ waveLength,
35
+ phase,
36
+ period,
37
+ backgroundColor = 'transparent',
38
+ color,
39
+ showLabel = true,
40
+ labelFormatter,
41
+ } = props;
42
+
43
+ const chartId = useRef<string>(`liquid-${uuid()}`);
44
+ const chartInstance = useRef<EChartsType | null>(null);
45
+ const containerRef = useRef<HTMLDivElement>(null);
46
+ const extensionRegistered = useRef<boolean>(false);
47
+
48
+ // 构建水球图配置
49
+ const liquidOption = useMemo(() => {
50
+ const baseOption = option || {};
51
+
52
+ // 如果用户提供了 option,直接返回
53
+ if (baseOption.series && baseOption.series.length > 0) {
54
+ return baseOption;
55
+ }
56
+
57
+ // 构建水球图 series
58
+ const seriesData = waveData.map((value) => {
59
+ const dataItem: Record<string, unknown> = { value };
60
+
61
+ if (showLabel && labelFormatter) {
62
+ dataItem.label = {
63
+ formatter: labelFormatter(value),
64
+ };
65
+ }
66
+
67
+ return dataItem;
68
+ });
69
+
70
+ const seriesConfig: Record<string, unknown> = {
71
+ type: 'liquidFill',
72
+ data: waveData,
73
+ shape,
74
+ backgroundColor,
75
+ color: color || ['#4cabce', '#4cabce'],
76
+ label: showLabel
77
+ ? {
78
+ show: true,
79
+ formatter: labelFormatter
80
+ ? (params: ECElementEvent) => labelFormatter(params.value as number)
81
+ : '{d}%',
82
+ textStyle: {
83
+ fontSize: 20,
84
+ fontWeight: 'bold',
85
+ },
86
+ }
87
+ : { show: false },
88
+ };
89
+
90
+ // 添加可选参数
91
+ if (amplitude !== undefined) {
92
+ seriesConfig.amplitude = amplitude;
93
+ }
94
+ if (waveLength !== undefined) {
95
+ seriesConfig.waveLength = waveLength;
96
+ }
97
+ if (phase !== undefined) {
98
+ seriesConfig.phase = phase;
99
+ }
100
+ if (period !== undefined) {
101
+ seriesConfig.period = period;
102
+ }
103
+
104
+ return {
105
+ ...baseOption,
106
+ series: [seriesConfig],
107
+ };
108
+ }, [option, waveData, shape, backgroundColor, color, showLabel, labelFormatter, amplitude, waveLength, phase, period]);
109
+
110
+ // 处理图表初始化
111
+ useEffect(() => {
112
+ let mounted = true;
113
+
114
+ const initChart = async (): Promise<(() => void) | undefined> => {
115
+ // 动态导入 echarts-liquidfill 并注册扩展
116
+ if (!extensionRegistered.current) {
117
+ try {
118
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
119
+ const liquidfill = require('echarts-liquidfill');
120
+ if (liquidfill && mounted) {
121
+ liquidfill.register && liquidfill.register();
122
+ extensionRegistered.current = true;
123
+ }
124
+ } catch (e) {
125
+ console.warn('[TaroViz] LiquidChart: Failed to load echarts-liquidfill extension', e);
126
+ return undefined;
127
+ }
128
+ }
129
+
130
+ if (!mounted || !containerRef.current) return undefined;
131
+
132
+ const initConfig = processAdapterConfig({
133
+ canvasId: chartId.current,
134
+ containerRef,
135
+ width,
136
+ height,
137
+ theme,
138
+ autoResize,
139
+ renderer,
140
+ option: liquidOption,
141
+ onInit: (instance: EChartsType) => {
142
+ chartInstance.current = instance;
143
+
144
+ // 绑定事件
145
+ if (onEvents) {
146
+ Object.entries(onEvents).forEach(([eventName, handler]) => {
147
+ (instance as unknown as { on: (e: string, h: unknown) => void }).on(eventName, handler);
148
+ });
149
+ }
150
+
151
+ if (onChartInit) {
152
+ onChartInit(instance);
153
+ }
154
+
155
+ if (onChartReady) {
156
+ onChartReady(instance);
157
+ }
158
+ },
159
+ });
160
+
161
+ const adapter = await getAdapter(initConfig);
162
+ adapter.init();
163
+
164
+ return () => {
165
+ if (chartInstance.current) {
166
+ if (onEvents) {
167
+ Object.keys(onEvents).forEach((eventName) => {
168
+ chartInstance.current?.off(eventName);
169
+ });
170
+ }
171
+ chartInstance.current.dispose();
172
+ chartInstance.current = null;
173
+ }
174
+ };
175
+ };
176
+
177
+ let cleanupFn: (() => void) | undefined;
178
+ initChart().then((cleanup) => {
179
+ cleanupFn = cleanup;
180
+ });
181
+
182
+ return () => {
183
+ mounted = false;
184
+ cleanupFn?.();
185
+ };
186
+ }, [liquidOption, width, height, theme, autoResize, renderer, onChartInit, onChartReady, onEvents]);
187
+
188
+ // 更新配置
189
+ useEffect(() => {
190
+ if (chartInstance.current && liquidOption) {
191
+ chartInstance.current.setOption(liquidOption, true);
192
+ }
193
+ }, [liquidOption]);
194
+
195
+ // 控制加载状态
196
+ useEffect(() => {
197
+ if (chartInstance.current) {
198
+ if (loading) {
199
+ chartInstance.current.showLoading(loadingOption);
200
+ } else {
201
+ chartInstance.current.hideLoading();
202
+ }
203
+ }
204
+ }, [loading, loadingOption]);
205
+
206
+ // 自定义样式
207
+ const mergedStyle = {
208
+ width: typeof width === 'number' ? `${width}px` : width,
209
+ height: typeof height === 'number' ? `${height}px` : height,
210
+ ...style,
211
+ };
212
+
213
+ return (
214
+ <div
215
+ className={`taroviz-liquid ${className}`}
216
+ style={mergedStyle}
217
+ ref={containerRef as React.RefObject<HTMLDivElement>}
218
+ />
219
+ );
220
+ });
221
+
222
+ LiquidChart.displayName = 'LiquidChart';
223
+
224
+ export default LiquidChart;
225
+
226
+ // 导出类型
227
+ export type { LiquidChartProps, LiquidOption, LiquidShape, LiquidSeries, LiquidSeriesDataItem } from './types';
@@ -0,0 +1,130 @@
1
+ /**
2
+ * 水球图类型定义
3
+ * ECharts 没有内置水球图,使用 echarts-liquidfill 库实现
4
+ */
5
+ import type React from 'react';
6
+ import type { EChartsOption, EChartsType, ECElementEvent } from 'echarts';
7
+
8
+ // ============================================================================
9
+ // 水球图配置类型
10
+ // ============================================================================
11
+
12
+ /** 水球图系列数据项 */
13
+ export interface LiquidSeriesDataItem {
14
+ /** 数据值,范围 [0, 1] */
15
+ value: number;
16
+ /** 数据项名称 */
17
+ name?: string;
18
+ /** 图形样式 */
19
+ itemStyle?: Record<string, unknown>;
20
+ /** 标签配置 */
21
+ label?: Record<string, unknown>;
22
+ /** 强调状态 */
23
+ emphasis?: Record<string, unknown>;
24
+ }
25
+
26
+ /** 水球图形状类型 */
27
+ export type LiquidShape = 'circle' | 'rect' | 'roundRect';
28
+
29
+ /** 水球图系列配置 */
30
+ export interface LiquidSeries {
31
+ /** 系列类型 */
32
+ type?: 'liquidFill';
33
+ /** 系列名称 */
34
+ name?: string;
35
+ /** 数据数组 */
36
+ data?: (number | LiquidSeriesDataItem)[];
37
+ /** 图形形状 */
38
+ shape?: LiquidShape;
39
+ /** 振幅 (相对于半径的比例) */
40
+ amplitude?: number;
41
+ /** 波长 (相对于画布宽度) */
42
+ waveLength?: number | string;
43
+ /** 相位偏移 */
44
+ phase?: number;
45
+ /** 周期时间 (ms) */
46
+ period?: number;
47
+ /** 波的个数 */
48
+ waveCount?: number;
49
+ /** 是否禁用动画 */
50
+ animationDisabled?: boolean;
51
+ /** 动画时长 */
52
+ animationDuration?: number;
53
+ /** 动画缓动函数 */
54
+ animationEasing?: string;
55
+ /** 动画延迟 */
56
+ animationDelay?: number | ((idx: number) => number);
57
+ /** 颜色数组 */
58
+ color?: string[];
59
+ /** 背景色 */
60
+ backgroundColor?: string;
61
+ /** 图形内标签 */
62
+ label?: Record<string, unknown>;
63
+ /** 图形样式 */
64
+ itemStyle?: Record<string, unknown>;
65
+ /** emphasis状态 */
66
+ emphasis?: Record<string, unknown>;
67
+ /** 浪的样式 */
68
+ waveStyle?: Record<string, unknown>;
69
+ }
70
+
71
+ /** 水球图选项配置 */
72
+ export interface LiquidOption extends Omit<EChartsOption, 'series'> {
73
+ series?: LiquidSeries[];
74
+ }
75
+
76
+ // ============================================================================
77
+ // 组件 Props
78
+ // ============================================================================
79
+
80
+ /**
81
+ * 水球图组件属性
82
+ */
83
+ export interface LiquidChartProps {
84
+ /** 图表配置项 (EChartsOption) */
85
+ option?: LiquidOption;
86
+ /** 宽度 */
87
+ width?: string | number;
88
+ /** 高度 */
89
+ height?: string | number;
90
+ /** 水球数据数组,每个值代表一个波纹,范围 [0, 1] */
91
+ waveData?: number[];
92
+ /** 图形形状 */
93
+ shape?: LiquidShape;
94
+ /** 振幅 (相对于半径的比例) */
95
+ amplitude?: number;
96
+ /** 波长 (相对于画布宽度) */
97
+ waveLength?: number | string;
98
+ /** 相位偏移 */
99
+ phase?: number;
100
+ /** 周期时间 (ms) */
101
+ period?: number;
102
+ /** 背景色 */
103
+ backgroundColor?: string;
104
+ /** 颜色数组 */
105
+ color?: string[];
106
+ /** 是否显示标签 */
107
+ showLabel?: boolean;
108
+ /** 标签格式化 */
109
+ labelFormatter?: (value: number) => string;
110
+ /** 主题 */
111
+ theme?: string | Record<string, unknown>;
112
+ /** 样式 */
113
+ style?: React.CSSProperties;
114
+ /** 类名 */
115
+ className?: string;
116
+ /** 是否自动调整大小 */
117
+ autoResize?: boolean;
118
+ /** 渲染器类型 */
119
+ renderer?: 'canvas' | 'svg';
120
+ /** 加载状态 */
121
+ loading?: boolean;
122
+ /** 加载配置 */
123
+ loadingOption?: Record<string, unknown>;
124
+ /** 图表初始化回调 */
125
+ onChartInit?: (chart: EChartsType) => void;
126
+ /** 图表就绪回调 */
127
+ onChartReady?: (chart: EChartsType) => void;
128
+ /** 事件回调 */
129
+ onEvents?: Record<string, (params: ECElementEvent) => void>;
130
+ }
@@ -0,0 +1,117 @@
1
+ /**
2
+ * 树图组件
3
+ * ECharts 内置 tree 类型
4
+ */
5
+ import React, { memo, useMemo } from 'react';
6
+ import BaseChartWrapper from '../common/BaseChartWrapper';
7
+ import { TreeChartProps, TreeSeries } from './types';
8
+
9
+ /**
10
+ * 树图组件
11
+ */
12
+ const TreeChart: React.FC<TreeChartProps> = memo((props) => {
13
+ const {
14
+ option,
15
+ treeData,
16
+ layout = 'orthogonal',
17
+ orient = 'horizontal',
18
+ nodeGap,
19
+ nodeWidth,
20
+ initialTreeDepth,
21
+ symbol,
22
+ symbolSize,
23
+ showLine = true,
24
+ lineCurveness,
25
+ label,
26
+ labelPosition,
27
+ labelAlign,
28
+ lineStyle,
29
+ itemStyle,
30
+ ...restProps
31
+ } = props;
32
+
33
+ // 构建树图配置
34
+ const mergedOption = useMemo(() => {
35
+ const baseOption = option || {};
36
+
37
+ // 如果用户提供了 series,直接返回
38
+ if (baseOption.series && baseOption.series.length > 0) {
39
+ return baseOption;
40
+ }
41
+
42
+ // 构建树图 series
43
+ const seriesConfig: TreeSeries = {
44
+ type: 'tree',
45
+ layout,
46
+ orient,
47
+ data: treeData,
48
+ showLine,
49
+ };
50
+
51
+ // 添加可选参数
52
+ if (nodeGap !== undefined) {
53
+ seriesConfig.nodeGap = nodeGap;
54
+ }
55
+ if (nodeWidth !== undefined) {
56
+ seriesConfig.nodeWidth = nodeWidth;
57
+ }
58
+ if (initialTreeDepth !== undefined) {
59
+ seriesConfig.initialTreeDepth = initialTreeDepth;
60
+ }
61
+ if (symbol !== undefined) {
62
+ seriesConfig.symbol = symbol;
63
+ }
64
+ if (symbolSize !== undefined) {
65
+ seriesConfig.symbolSize = symbolSize;
66
+ }
67
+ if (lineCurveness !== undefined) {
68
+ seriesConfig.lineCurveness = lineCurveness;
69
+ }
70
+ if (label !== undefined) {
71
+ seriesConfig.label = label;
72
+ }
73
+ if (labelPosition !== undefined) {
74
+ seriesConfig.labelPosition = labelPosition;
75
+ }
76
+ if (labelAlign !== undefined) {
77
+ seriesConfig.labelAlign = labelAlign;
78
+ }
79
+ if (lineStyle !== undefined) {
80
+ seriesConfig.lineStyle = lineStyle;
81
+ }
82
+ if (itemStyle !== undefined) {
83
+ seriesConfig.itemStyle = itemStyle;
84
+ }
85
+
86
+ return {
87
+ ...baseOption,
88
+ series: [seriesConfig],
89
+ };
90
+ }, [
91
+ option,
92
+ treeData,
93
+ layout,
94
+ orient,
95
+ nodeGap,
96
+ nodeWidth,
97
+ initialTreeDepth,
98
+ symbol,
99
+ symbolSize,
100
+ showLine,
101
+ lineCurveness,
102
+ label,
103
+ labelPosition,
104
+ labelAlign,
105
+ lineStyle,
106
+ itemStyle,
107
+ ]);
108
+
109
+ return <BaseChartWrapper {...restProps} option={mergedOption as any} chartType="tree" />;
110
+ });
111
+
112
+ TreeChart.displayName = 'TreeChart';
113
+
114
+ export default TreeChart;
115
+
116
+ // 导出类型
117
+ export type { TreeChartProps, TreeOption, TreeNode, TreeSeries } from './types';
@@ -0,0 +1,174 @@
1
+ /**
2
+ * 树图类型定义
3
+ * ECharts 内置 tree 类型
4
+ */
5
+ import type { EChartsOption } from 'echarts';
6
+
7
+ // ============================================================================
8
+ // 树图数据节点
9
+ // ============================================================================
10
+
11
+ /**
12
+ * 树图数据节点
13
+ */
14
+ export interface TreeNode {
15
+ /** 节点名称 */
16
+ name: string;
17
+ /** 节点值 */
18
+ value?: number;
19
+ /** 是否展开 */
20
+ collapsed?: boolean;
21
+ /** 图标 */
22
+ icon?: string;
23
+ /** 图形 */
24
+ symbol?: string;
25
+ /** 图形大小 */
26
+ symbolSize?: number | [number, number];
27
+ /** 标签配置 */
28
+ label?: Record<string, unknown>;
29
+ /** 元素样式 */
30
+ itemStyle?: Record<string, unknown>;
31
+ /** emphasis状态 */
32
+ emphasis?: Record<string, unknown>;
33
+ /** 线条样式 */
34
+ lineStyle?: Record<string, unknown>;
35
+ /** 子节点 */
36
+ children?: TreeNode[];
37
+ /** 其他自定义属性 */
38
+ [key: string]: any;
39
+ }
40
+
41
+ // ============================================================================
42
+ // 树图系列配置
43
+ // ============================================================================
44
+
45
+ /** 树图系列配置 */
46
+ export interface TreeSeries {
47
+ /** 系列类型 */
48
+ type?: 'tree';
49
+ /** 系列名称 */
50
+ name?: string;
51
+ /** 数据数组 (树的根节点) */
52
+ data?: TreeNode[];
53
+ /** 树的布局: 'orthogonal' | 'radial' */
54
+ layout?: string;
55
+ /** 树的方向: 'horizontal' | 'vertical' */
56
+ orient?: string;
57
+ /** 节点之间的间距 */
58
+ nodeGap?: number;
59
+ /** 节点的宽度 */
60
+ nodeWidth?: number;
61
+ /** 展开层级 */
62
+ initialTreeDepth?: number;
63
+ /** 标签配置 */
64
+ label?: Record<string, unknown>;
65
+ /** 标签位置 */
66
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
67
+ /** 标签对齐 */
68
+ labelAlign?: 'left' | 'right' | 'center';
69
+ /** 标签格式化 */
70
+ labelFormatter?: string | ((value: number, data: TreeNode) => string);
71
+ /** 线条样式 */
72
+ lineStyle?: Record<string, unknown>;
73
+ /** 是否显示连接线 */
74
+ showLine?: boolean;
75
+ /** 连接线的弯曲度 */
76
+ lineCurveness?: number;
77
+ /** 树节点图形 */
78
+ symbol?: string;
79
+ /** 树节点大小 */
80
+ symbolSize?: number | [number, number];
81
+ /** 图形内标签 */
82
+ innerLabel?: Record<string, unknown>;
83
+ /** 元素样式 */
84
+ itemStyle?: Record<string, unknown>;
85
+ /** emphasis状态 */
86
+ emphasis?: Record<string, unknown>;
87
+ /** 聚焦状态 */
88
+ focus?: Record<string, unknown>;
89
+ /** leaves配置 */
90
+ leaves?: Record<string, unknown>;
91
+ /** 动画配置 */
92
+ animation?: boolean;
93
+ /** 动画时长 */
94
+ animationDuration?: number;
95
+ /** 动画缓动函数 */
96
+ animationEasing?: string;
97
+ /** 动画延迟 */
98
+ animationDelay?: number | ((idx: number) => number);
99
+ /** 动画更新时长 */
100
+ animationDurationUpdate?: number;
101
+ /** 动画更新缓动函数 */
102
+ animationEasingUpdate?: string;
103
+ }
104
+
105
+ /** 树图选项配置 */
106
+ export interface TreeOption extends Omit<EChartsOption, 'series'> {
107
+ series?: TreeSeries[];
108
+ }
109
+
110
+ // ============================================================================
111
+ // 组件 Props
112
+ // ============================================================================
113
+
114
+ /**
115
+ * 树图组件属性
116
+ */
117
+ export interface TreeChartProps {
118
+ /** 图表配置项 (EChartsOption) */
119
+ option?: TreeOption;
120
+ /** 宽度 */
121
+ width?: string | number;
122
+ /** 高度 */
123
+ height?: string | number;
124
+ /** 树形数据 */
125
+ treeData?: TreeNode[];
126
+ /** 树的布局: 'orthogonal' (直角树) | 'radial' (辐射树) */
127
+ layout?: 'orthogonal' | 'radial';
128
+ /** 树的方向: 'horizontal' (水平) | 'vertical' (垂直) */
129
+ orient?: 'horizontal' | 'vertical';
130
+ /** 节点之间的间距 */
131
+ nodeGap?: number;
132
+ /** 节点的宽度 */
133
+ nodeWidth?: number;
134
+ /** 展开层级 */
135
+ initialTreeDepth?: number;
136
+ /** 节点图形 */
137
+ symbol?: string;
138
+ /** 节点大小 */
139
+ symbolSize?: number | [number, number];
140
+ /** 是否显示连接线 */
141
+ showLine?: boolean;
142
+ /** 连接线的弯曲度 */
143
+ lineCurveness?: number;
144
+ /** 标签配置 */
145
+ label?: Record<string, unknown>;
146
+ /** 标签位置 */
147
+ labelPosition?: 'left' | 'right' | 'top' | 'bottom';
148
+ /** 标签对齐 */
149
+ labelAlign?: 'left' | 'right' | 'center';
150
+ /** 线条样式 */
151
+ lineStyle?: Record<string, unknown>;
152
+ /** 元素样式 */
153
+ itemStyle?: Record<string, unknown>;
154
+ /** 主题 */
155
+ theme?: string | Record<string, unknown>;
156
+ /** 样式 */
157
+ style?: React.CSSProperties;
158
+ /** 类名 */
159
+ className?: string;
160
+ /** 是否自动调整大小 */
161
+ autoResize?: boolean;
162
+ /** 渲染器类型 */
163
+ renderer?: 'canvas' | 'svg';
164
+ /** 加载状态 */
165
+ loading?: boolean;
166
+ /** 加载配置 */
167
+ loadingOption?: Record<string, unknown>;
168
+ /** 图表初始化回调 */
169
+ onChartInit?: (chart: any) => void;
170
+ /** 图表就绪回调 */
171
+ onChartReady?: (chart: any) => void;
172
+ /** 事件回调 */
173
+ onEvents?: Record<string, (params: any) => void>;
174
+ }
@@ -681,7 +681,7 @@ export interface SankeyChartProps extends BaseChartProps {
681
681
  nodeWidth?: number;
682
682
 
683
683
  /** 节点排序方式 */
684
- nodeSort?: 'ascending' | 'descending' | 'none' | ((a: any, b: any) => number);
684
+ nodeSort?: 'ascending' | 'descending' | 'none' | ((a: unknown, b: unknown) => number);
685
685
 
686
686
  /** 边的曲度 */
687
687
  linkCurveness?: number;