@agions/taroviz 1.2.0 → 1.2.1

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 (37) hide show
  1. package/README.md +42 -36
  2. package/dist/cjs/index.js +1 -0
  3. package/dist/{index.esm.js → esm/index.js} +73473 -59179
  4. package/package.json +67 -8
  5. package/src/adapters/__tests__/index.test.ts +2 -2
  6. package/src/adapters/h5/index.ts +1 -1
  7. package/src/adapters/index.ts +99 -167
  8. package/src/charts/bar/index.tsx +2 -11
  9. package/src/charts/common/BaseChartWrapper.tsx +2 -2
  10. package/src/charts/funnel/index.tsx +2 -17
  11. package/src/charts/gauge/index.tsx +2 -17
  12. package/src/charts/heatmap/index.tsx +2 -17
  13. package/src/charts/line/index.tsx +2 -11
  14. package/src/charts/pie/index.tsx +3 -6
  15. package/src/charts/radar/index.tsx +2 -17
  16. package/src/charts/scatter/index.tsx +2 -17
  17. package/src/charts/types.ts +503 -30
  18. package/src/charts/utils.ts +1 -1
  19. package/src/core/__tests__/platform.test.ts +1 -1
  20. package/src/core/animation/AnimationManager.ts +2 -2
  21. package/src/core/components/BaseChart.tsx +12 -18
  22. package/src/core/components/ErrorBoundary.tsx +458 -0
  23. package/src/core/echarts.ts +58 -0
  24. package/src/core/index.ts +4 -1
  25. package/src/core/utils/__tests__/common.test.ts +1 -1
  26. package/src/core/utils/chartInstances.ts +2 -2
  27. package/src/core/utils/codeGenerator/CodeGenerator.ts +2 -2
  28. package/src/core/utils/codeGenerator/types.ts +0 -2
  29. package/src/core/utils/configGenerator/ConfigGenerator.ts +12 -12
  30. package/src/core/utils/debug/DebugPanel.tsx +1 -1
  31. package/src/core/utils/debug/debugger.ts +1 -1
  32. package/src/core/utils/index.ts +1 -1
  33. package/src/core/utils/performance/PerformanceAnalyzer.ts +5 -5
  34. package/src/editor/ThemeEditor.tsx +9 -9
  35. package/src/hooks/index.ts +441 -61
  36. package/src/main.tsx +1 -1
  37. package/src/themes/index.ts +651 -256
@@ -1,21 +1,18 @@
1
1
  /**
2
2
  * 饼图组件
3
3
  */
4
- import { PieChart as PieChartComponent } from 'echarts/charts';
5
- import { TooltipComponent, TitleComponent, LegendComponent } from 'echarts/components';
6
- import * as echarts from 'echarts/core';
7
4
  import React from 'react';
8
5
 
9
6
  import BaseChartWrapper from '../common/BaseChartWrapper';
10
7
  import { BaseChartProps } from '../types';
11
8
 
12
- // 注册必要的组件
13
- echarts.use([PieChartComponent, TooltipComponent, TitleComponent, LegendComponent]);
9
+ // 导入统一注册的 echarts
10
+ import '@/core/echarts';
14
11
 
15
12
  /**
16
13
  * 饼图组件
17
14
  */
18
- const PieChart: React.FC<BaseChartProps> = props => (
15
+ const PieChart: React.FC<BaseChartProps> = (props) => (
19
16
  <BaseChartWrapper {...props} chartType="pie-chart" />
20
17
  );
21
18
 
@@ -1,32 +1,17 @@
1
1
  /**
2
2
  * 雷达图组件
3
3
  */
4
- import { RadarChart as RadarChartComponent } from 'echarts/charts';
5
- import {
6
- GridComponent,
7
- TooltipComponent,
8
- TitleComponent,
9
- LegendComponent,
10
- } from 'echarts/components';
11
- import * as echarts from 'echarts/core';
12
4
  import React from 'react';
13
5
 
14
6
  import BaseChartWrapper from '../common/BaseChartWrapper';
15
7
  import { RadarChartProps } from '../types';
16
8
 
17
- // 注册必要的组件
18
- echarts.use([
19
- RadarChartComponent,
20
- GridComponent,
21
- TooltipComponent,
22
- TitleComponent,
23
- LegendComponent,
24
- ]);
9
+ import '@/core/echarts';
25
10
 
26
11
  /**
27
12
  * 雷达图组件
28
13
  */
29
- const RadarChart: React.FC<RadarChartProps> = props => (
14
+ const RadarChart: React.FC<RadarChartProps> = (props) => (
30
15
  <BaseChartWrapper {...props} chartType="radar-chart" />
31
16
  );
32
17
 
@@ -1,32 +1,17 @@
1
1
  /**
2
2
  * 散点图组件
3
3
  */
4
- import { ScatterChart as ScatterChartComponent } from 'echarts/charts';
5
- import {
6
- GridComponent,
7
- TooltipComponent,
8
- TitleComponent,
9
- LegendComponent,
10
- } from 'echarts/components';
11
- import * as echarts from 'echarts/core';
12
4
  import React from 'react';
13
5
 
14
6
  import BaseChartWrapper from '../common/BaseChartWrapper';
15
7
  import { ScatterChartProps } from '../types';
16
8
 
17
- // 注册必要的组件
18
- echarts.use([
19
- ScatterChartComponent,
20
- GridComponent,
21
- TooltipComponent,
22
- TitleComponent,
23
- LegendComponent,
24
- ]);
9
+ import '@/core/echarts';
25
10
 
26
11
  /**
27
12
  * 散点图组件
28
13
  */
29
- const ScatterChart: React.FC<ScatterChartProps> = props => (
14
+ const ScatterChart: React.FC<ScatterChartProps> = (props) => (
30
15
  <BaseChartWrapper {...props} chartType="scatter-chart" />
31
16
  );
32
17