@agions/taroviz 1.11.5 → 2.0.3
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/CHANGELOG.md +245 -0
- package/README.md +31 -46
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/vendors.js +1 -1
- package/dist/cjs/vendors~echarts.js +1 -1
- package/dist/esm/index.js +1 -14270
- package/dist/esm/vendors.js +1 -16770
- package/dist/esm/vendors~echarts.js +1 -59417
- package/package.json +10 -15
- package/src/adapters/h5/index.ts +38 -38
- package/src/adapters/index.ts +32 -34
- package/src/adapters/types.ts +23 -55
- package/src/charts/boxplot/types.ts +2 -2
- package/src/charts/common/BaseChartWrapper.tsx +9 -7
- package/src/charts/createChartComponent.tsx +9 -21
- package/src/charts/createOptionChartComponent.tsx +32 -0
- package/src/charts/funnel/__tests__/index.test.tsx +99 -0
- package/src/charts/funnel/index.tsx +64 -0
- package/src/charts/funnel/types.ts +6 -0
- package/src/charts/graph/__tests__/index.test.tsx +116 -0
- package/src/charts/graph/index.tsx +70 -0
- package/src/charts/graph/types.ts +6 -0
- package/src/charts/heatmap/__tests__/index.test.tsx +139 -0
- package/src/charts/heatmap/index.tsx +107 -0
- package/src/charts/heatmap/types.ts +6 -0
- package/src/charts/index.ts +47 -57
- package/src/charts/liquid/__tests__/index.test.tsx +52 -0
- package/src/charts/liquid/index.tsx +7 -133
- package/src/charts/liquid/types.ts +6 -6
- package/src/charts/parallel/types.ts +3 -3
- package/src/charts/radar/__tests__/index.test.tsx +210 -0
- package/src/charts/radar/index.tsx +147 -0
- package/src/charts/radar/types.ts +13 -0
- package/src/charts/sankey/__tests__/index.test.tsx +124 -0
- package/src/charts/sankey/index.tsx +70 -0
- package/src/charts/sankey/types.ts +6 -0
- package/src/charts/tree/__tests__/index.test.tsx +71 -0
- package/src/charts/tree/index.tsx +1 -1
- package/src/charts/tree/types.ts +8 -8
- package/src/charts/types.ts +208 -106
- package/src/charts/wordcloud/__tests__/index.test.tsx +106 -0
- package/src/charts/wordcloud/index.tsx +79 -0
- package/src/charts/wordcloud/types.ts +6 -0
- package/src/components/DataFilter/index.tsx +7 -6
- package/src/core/animation/types.ts +6 -6
- package/src/core/components/Annotation.tsx +6 -6
- package/src/core/components/BaseChart.tsx +97 -133
- package/src/core/components/LazyChart.tsx +3 -8
- package/src/core/components/hooks/index.ts +6 -2
- package/src/core/components/hooks/usePerformance.ts +8 -2
- package/src/core/components/hooks/useVirtualScroll.ts +2 -1
- package/src/core/types/common.ts +2 -1
- package/src/core/types/platform.ts +1 -0
- package/src/core/utils/__tests__/deepClone.test.ts +317 -0
- package/src/core/utils/__tests__/index.test.ts +2 -1
- package/src/core/utils/chartInstances.ts +13 -0
- package/src/core/utils/common.ts +20 -36
- package/src/core/utils/deepClone.ts +114 -0
- package/src/core/utils/download.ts +22 -28
- package/src/core/utils/drillDown.ts +1 -0
- package/src/core/utils/events.ts +12 -0
- package/src/core/utils/export/ExportUtils.ts +2 -1
- package/src/core/utils/format.ts +44 -0
- package/src/core/utils/index.ts +18 -159
- package/src/core/utils/merge.ts +25 -0
- package/src/core/utils/performance/PerformanceAnalyzer.ts +3 -1
- package/src/core/utils/performance/hooks.ts +7 -0
- package/src/core/utils/performance/index.ts +2 -0
- package/src/{hooks → core/utils/performance}/useAnimation.ts +6 -5
- package/src/{hooks → core/utils/performance}/useDataZoom.ts +7 -2
- package/src/{hooks → core/utils/performance}/usePerformance.ts +39 -39
- package/src/{hooks → core/utils/performance}/usePerformanceHooks.ts +39 -39
- package/src/core/utils/runtime.ts +190 -0
- package/src/editor/components/ThemeSelector.tsx +3 -3
- package/src/hooks/chartConnectHelpers.ts +6 -0
- package/src/hooks/index.ts +54 -626
- package/src/hooks/types.ts +27 -0
- package/src/hooks/useChartAutoResize.ts +73 -0
- package/src/hooks/useChartConnect.ts +5 -1
- package/src/hooks/useChartDownload.ts +1 -1
- package/src/hooks/useChartHistory.ts +1 -3
- package/src/hooks/useChartInit.ts +59 -0
- package/src/hooks/useChartOptions.ts +259 -0
- package/src/hooks/useChartPerformance.ts +109 -0
- package/src/hooks/useChartSelection.ts +23 -12
- package/src/hooks/useChartTheme.ts +51 -0
- package/src/hooks/useDataTransform.ts +19 -4
- package/src/index.ts +5 -10
- package/src/react-dom.d.ts +3 -3
- package/src/themes/index.ts +30 -855
- package/src/themes/palettes/blue-green.ts +13 -0
- package/src/themes/palettes/chalk.ts +13 -0
- package/src/themes/palettes/cyber.ts +44 -0
- package/src/themes/palettes/dark.ts +52 -0
- package/src/themes/palettes/default.ts +52 -0
- package/src/themes/palettes/elegant.ts +34 -0
- package/src/themes/palettes/forest.ts +13 -0
- package/src/themes/palettes/glass.ts +49 -0
- package/src/themes/palettes/golden.ts +13 -0
- package/src/themes/palettes/neon.ts +43 -0
- package/src/themes/palettes/ocean.ts +39 -0
- package/src/themes/palettes/pastel.ts +37 -0
- package/src/themes/palettes/purple-passion.ts +13 -0
- package/src/themes/palettes/retro.ts +33 -0
- package/src/themes/palettes/sunset.ts +40 -0
- package/src/themes/palettes/walden.ts +13 -0
- package/src/themes/registry.ts +184 -0
- package/src/themes/types.ts +213 -0
- package/src/core/utils/codeGenerator/CodeGenerator.ts +0 -669
- package/src/core/utils/codeGenerator/index.ts +0 -13
- package/src/core/utils/codeGenerator/types.ts +0 -198
- package/src/core/utils/configGenerator/ConfigGenerator.ts +0 -583
- package/src/core/utils/configGenerator/index.ts +0 -13
- package/src/core/utils/configGenerator/types.ts +0 -449
- package/src/core/utils/debug/DebugPanel.tsx +0 -640
- package/src/core/utils/debug/debugger.ts +0 -322
- package/src/core/utils/debug/index.ts +0 -21
- package/src/core/utils/debug/types.ts +0 -142
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TaroViz 代码示例生成器类型定义
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 代码示例框架类型
|
|
7
|
-
*/
|
|
8
|
-
export type FrameworkType = 'react' | 'vue' | 'vanilla' | 'angular';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 代码示例导入类型
|
|
12
|
-
*/
|
|
13
|
-
export type ImportType = 'esm' | 'cjs' | 'umd';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 代码示例主题类型
|
|
17
|
-
*/
|
|
18
|
-
export type ThemeType = 'light' | 'dark';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 代码示例选项
|
|
22
|
-
*/
|
|
23
|
-
export interface CodeGeneratorOptions {
|
|
24
|
-
/**
|
|
25
|
-
* 框架类型
|
|
26
|
-
*/
|
|
27
|
-
framework: FrameworkType;
|
|
28
|
-
/**
|
|
29
|
-
* 导入类型
|
|
30
|
-
*/
|
|
31
|
-
importType?: ImportType;
|
|
32
|
-
/**
|
|
33
|
-
* 主题类型
|
|
34
|
-
*/
|
|
35
|
-
theme?: ThemeType;
|
|
36
|
-
/**
|
|
37
|
-
* 是否包含样式
|
|
38
|
-
*/
|
|
39
|
-
includeStyles?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* 是否包含数据
|
|
42
|
-
*/
|
|
43
|
-
includeData?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 是否包含注释
|
|
46
|
-
*/
|
|
47
|
-
includeComments?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* 是否使用TypeScript
|
|
50
|
-
*/
|
|
51
|
-
useTypeScript?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* 图表ID
|
|
54
|
-
*/
|
|
55
|
-
chartId?: string;
|
|
56
|
-
/**
|
|
57
|
-
* 组件名称
|
|
58
|
-
*/
|
|
59
|
-
componentName?: string;
|
|
60
|
-
/**
|
|
61
|
-
* 其他自定义选项
|
|
62
|
-
*/
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 代码示例模板
|
|
68
|
-
*/
|
|
69
|
-
export interface CodeExampleTemplate {
|
|
70
|
-
/**
|
|
71
|
-
* 模板名称
|
|
72
|
-
*/
|
|
73
|
-
name: string;
|
|
74
|
-
/**
|
|
75
|
-
* 模板描述
|
|
76
|
-
*/
|
|
77
|
-
description: string;
|
|
78
|
-
/**
|
|
79
|
-
* 模板适用的框架
|
|
80
|
-
*/
|
|
81
|
-
frameworks: FrameworkType[];
|
|
82
|
-
/**
|
|
83
|
-
* 模板内容
|
|
84
|
-
*/
|
|
85
|
-
content: string;
|
|
86
|
-
/**
|
|
87
|
-
* 模板变量
|
|
88
|
-
*/
|
|
89
|
-
variables?: string[];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 代码示例生成结果
|
|
94
|
-
*/
|
|
95
|
-
export interface CodeGeneratorResult {
|
|
96
|
-
/**
|
|
97
|
-
* 生成的代码
|
|
98
|
-
*/
|
|
99
|
-
code: string;
|
|
100
|
-
/**
|
|
101
|
-
* 代码语言
|
|
102
|
-
*/
|
|
103
|
-
language: string;
|
|
104
|
-
/**
|
|
105
|
-
* 代码框架
|
|
106
|
-
*/
|
|
107
|
-
framework: FrameworkType;
|
|
108
|
-
/**
|
|
109
|
-
* 代码导入类型
|
|
110
|
-
*/
|
|
111
|
-
importType: ImportType;
|
|
112
|
-
/**
|
|
113
|
-
* 代码主题
|
|
114
|
-
*/
|
|
115
|
-
theme: ThemeType;
|
|
116
|
-
/**
|
|
117
|
-
* 生成时间
|
|
118
|
-
*/
|
|
119
|
-
generatedAt: number;
|
|
120
|
-
/**
|
|
121
|
-
* 代码文件扩展名
|
|
122
|
-
*/
|
|
123
|
-
extension: string;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* 代码示例生成器事件类型
|
|
128
|
-
*/
|
|
129
|
-
export enum CodeGeneratorEventType {
|
|
130
|
-
/**
|
|
131
|
-
* 代码生成开始事件
|
|
132
|
-
*/
|
|
133
|
-
GENERATE_START = 'codeGenerateStart',
|
|
134
|
-
/**
|
|
135
|
-
* 代码生成完成事件
|
|
136
|
-
*/
|
|
137
|
-
GENERATE_COMPLETE = 'codeGenerateComplete',
|
|
138
|
-
/**
|
|
139
|
-
* 代码生成失败事件
|
|
140
|
-
*/
|
|
141
|
-
GENERATE_ERROR = 'codeGenerateError',
|
|
142
|
-
/**
|
|
143
|
-
* 模板应用事件
|
|
144
|
-
*/
|
|
145
|
-
TEMPLATE_APPLY = 'templateApply',
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 代码示例生成器事件处理器
|
|
150
|
-
*/
|
|
151
|
-
export type CodeGeneratorEventHandler = (event: {
|
|
152
|
-
type: CodeGeneratorEventType;
|
|
153
|
-
data?: unknown;
|
|
154
|
-
}) => void;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* 代码示例片段
|
|
158
|
-
*/
|
|
159
|
-
export interface CodeSnippet {
|
|
160
|
-
/**
|
|
161
|
-
* 片段名称
|
|
162
|
-
*/
|
|
163
|
-
name: string;
|
|
164
|
-
/**
|
|
165
|
-
* 片段内容
|
|
166
|
-
*/
|
|
167
|
-
content: string;
|
|
168
|
-
/**
|
|
169
|
-
* 片段语言
|
|
170
|
-
*/
|
|
171
|
-
language: string;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* 完整代码示例
|
|
176
|
-
*/
|
|
177
|
-
export interface CompleteCodeExample {
|
|
178
|
-
/**
|
|
179
|
-
* 主文件代码
|
|
180
|
-
*/
|
|
181
|
-
main: string;
|
|
182
|
-
/**
|
|
183
|
-
* 依赖文件代码
|
|
184
|
-
*/
|
|
185
|
-
dependencies?: Record<string, string>;
|
|
186
|
-
/**
|
|
187
|
-
* 配置文件代码
|
|
188
|
-
*/
|
|
189
|
-
config?: Record<string, string>;
|
|
190
|
-
/**
|
|
191
|
-
* 示例说明
|
|
192
|
-
*/
|
|
193
|
-
description?: string;
|
|
194
|
-
/**
|
|
195
|
-
* 示例标题
|
|
196
|
-
*/
|
|
197
|
-
title?: string;
|
|
198
|
-
}
|