react-use-echarts 0.0.11 → 1.0.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.
- package/README.md +533 -21
- package/dist/__tests__/hooks/theme-change.test.d.ts +1 -0
- package/dist/__tests__/hooks/use-echarts.test.d.ts +1 -0
- package/dist/__tests__/hooks/use-lazy-init.test.d.ts +1 -0
- package/dist/__tests__/themes/index.test.d.ts +1 -0
- package/dist/__tests__/utils/connect.test.d.ts +1 -0
- package/dist/__tests__/utils/instance-cache.test.d.ts +1 -0
- package/dist/hooks/use-echarts.d.ts +10 -0
- package/dist/hooks/use-lazy-init.d.ts +8 -0
- package/dist/index.d.ts +32 -131
- package/dist/index.es.js +1096 -83
- package/dist/index.umd.js +5 -1
- package/dist/themes/index.d.ts +42 -0
- package/dist/themes/presets/dark.json.d.ts +398 -0
- package/dist/themes/presets/light.json.d.ts +398 -0
- package/dist/themes/presets/macarons.json.d.ts +419 -0
- package/dist/types/index.d.ts +118 -0
- package/dist/utils/connect.d.ts +49 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/instance-cache.d.ts +42 -0
- package/package.json +23 -18
package/dist/index.d.ts
CHANGED
|
@@ -1,131 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
query?: string | object;
|
|
35
|
-
/**
|
|
36
|
-
* Context for the event handler
|
|
37
|
-
* 事件处理函数的上下文
|
|
38
|
-
*/
|
|
39
|
-
context?: object;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Theme type for ECharts
|
|
45
|
-
* ECharts 的主题类型
|
|
46
|
-
*/
|
|
47
|
-
export declare type Theme = string | object | null;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* React hook for Apache ECharts integration
|
|
51
|
-
* @param options Configuration object
|
|
52
|
-
* @param options.option Chart configuration
|
|
53
|
-
* @param options.theme Chart theme name
|
|
54
|
-
* @param options.notMerge Skip merging with previous options
|
|
55
|
-
* @param options.lazyUpdate Enable lazy update mode
|
|
56
|
-
* @param options.showLoading Display loading animation
|
|
57
|
-
* @param options.loadingOption Loading animation config
|
|
58
|
-
* @param options.onEvents Event handlers map
|
|
59
|
-
* @returns Chart control methods and ref
|
|
60
|
-
*/
|
|
61
|
-
export declare const useEcharts: ({ option, theme, notMerge, lazyUpdate, showLoading, loadingOption, onEvents, }: UseEchartsOptions) => UseEchartsReturn;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Configuration options for useEcharts hook
|
|
65
|
-
* useEcharts hook 的配置选项
|
|
66
|
-
*/
|
|
67
|
-
export declare interface UseEchartsOptions {
|
|
68
|
-
/**
|
|
69
|
-
* ECharts configuration options
|
|
70
|
-
* ECharts 的配置项
|
|
71
|
-
*/
|
|
72
|
-
option: EChartsOption;
|
|
73
|
-
/**
|
|
74
|
-
* Theme to be applied
|
|
75
|
-
* 要应用的主题
|
|
76
|
-
*/
|
|
77
|
-
theme?: Theme;
|
|
78
|
-
/**
|
|
79
|
-
* Whether to not merge with previous options
|
|
80
|
-
* 是否不合并之前的配置项
|
|
81
|
-
* @default false
|
|
82
|
-
*/
|
|
83
|
-
notMerge?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Whether to update chart in lazy mode
|
|
86
|
-
* 是否在懒加载模式下更新图表
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
lazyUpdate?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Whether to show loading state
|
|
92
|
-
* 是否显示加载状态
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
showLoading?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Loading options
|
|
98
|
-
* 加载配置项
|
|
99
|
-
*/
|
|
100
|
-
loadingOption?: object;
|
|
101
|
-
/**
|
|
102
|
-
* Event configurations
|
|
103
|
-
* 事件配置
|
|
104
|
-
*/
|
|
105
|
-
onEvents?: EChartsEvents;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Return type for useEcharts hook
|
|
110
|
-
* useEcharts hook 的返回类型
|
|
111
|
-
*/
|
|
112
|
-
export declare interface UseEchartsReturn {
|
|
113
|
-
/**
|
|
114
|
-
* Reference to the chart container element
|
|
115
|
-
* 图表容器元素的引用
|
|
116
|
-
*/
|
|
117
|
-
chartRef: React.RefObject<HTMLDivElement | null>;
|
|
118
|
-
/**
|
|
119
|
-
* Function to update chart options
|
|
120
|
-
* 更新图表配置的函数
|
|
121
|
-
*/
|
|
122
|
-
setOption: (option: EChartsOption, opts?: SetOptionOpts) => void;
|
|
123
|
-
/**
|
|
124
|
-
* Function to get the ECharts instance
|
|
125
|
-
* 获取 ECharts 实例的函数
|
|
126
|
-
* @returns Returns the current ECharts instance, or undefined if not initialized
|
|
127
|
-
*/
|
|
128
|
-
getInstance: () => ECharts | undefined;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export { }
|
|
1
|
+
/**
|
|
2
|
+
* react-use-echarts
|
|
3
|
+
* A React hook library for Apache ECharts with TypeScript support
|
|
4
|
+
* 基于 TypeScript 的 Apache ECharts React Hook 库
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Main hook for using ECharts in React components
|
|
10
|
+
* 在 React 组件中使用 ECharts 的主要 Hook
|
|
11
|
+
*/
|
|
12
|
+
export { default as useEcharts } from './hooks/use-echarts';
|
|
13
|
+
/**
|
|
14
|
+
* Lazy initialization hook
|
|
15
|
+
* 懒加载初始化 Hook
|
|
16
|
+
*/
|
|
17
|
+
export { useLazyInit } from './hooks/use-lazy-init';
|
|
18
|
+
/**
|
|
19
|
+
* Type definitions for the library
|
|
20
|
+
* 库的类型定义
|
|
21
|
+
*/
|
|
22
|
+
export type { UseEchartsOptions, UseEchartsReturn, EChartsEvents, BuiltinTheme, } from './types';
|
|
23
|
+
/**
|
|
24
|
+
* Theme utilities
|
|
25
|
+
* 主题工具函数
|
|
26
|
+
*/
|
|
27
|
+
export { registerBuiltinThemes, getBuiltinTheme, isBuiltinTheme, registerCustomTheme, getAvailableThemes, } from './themes';
|
|
28
|
+
/**
|
|
29
|
+
* Utility functions for ECharts
|
|
30
|
+
* ECharts 工具函数
|
|
31
|
+
*/
|
|
32
|
+
export * from './utils';
|