@agions/taroviz 1.2.0 → 1.3.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 (47) hide show
  1. package/README.md +53 -41
  2. package/dist/cjs/index.js +1 -0
  3. package/dist/esm/index.js +9103 -0
  4. package/package.json +99 -10
  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/index.ts +6 -1
  14. package/src/charts/line/index.tsx +2 -11
  15. package/src/charts/pie/index.tsx +3 -6
  16. package/src/charts/radar/index.tsx +2 -17
  17. package/src/charts/sankey/index.tsx +18 -0
  18. package/src/charts/scatter/index.tsx +2 -17
  19. package/src/charts/sunburst/index.tsx +18 -0
  20. package/src/charts/treemap/index.tsx +18 -0
  21. package/src/charts/types.ts +761 -30
  22. package/src/charts/utils.ts +1 -1
  23. package/src/core/__tests__/platform.test.ts +1 -1
  24. package/src/core/animation/AnimationManager.ts +2 -2
  25. package/src/core/components/Annotation.tsx +346 -0
  26. package/src/core/components/BaseChart.tsx +12 -18
  27. package/src/core/components/ErrorBoundary.tsx +153 -0
  28. package/src/core/components/LazyChart.tsx +200 -0
  29. package/src/core/echarts.ts +80 -0
  30. package/src/core/index.ts +4 -1
  31. package/src/core/themes/ThemeManager.ts +628 -0
  32. package/src/core/utils/__tests__/common.test.ts +1 -1
  33. package/src/core/utils/chartInstances.ts +2 -2
  34. package/src/core/utils/codeGenerator/CodeGenerator.ts +2 -2
  35. package/src/core/utils/codeGenerator/types.ts +0 -2
  36. package/src/core/utils/configGenerator/ConfigGenerator.ts +12 -12
  37. package/src/core/utils/debug/DebugPanel.tsx +1 -1
  38. package/src/core/utils/debug/debugger.ts +1 -1
  39. package/src/core/utils/export/ExportUtils.ts +385 -0
  40. package/src/core/utils/index.ts +1 -1
  41. package/src/core/utils/performance/PerformanceAnalyzer.ts +5 -5
  42. package/src/editor/ThemeEditor.tsx +9 -9
  43. package/src/hooks/index.ts +441 -61
  44. package/src/index.ts +72 -4
  45. package/src/main.tsx +1 -1
  46. package/src/themes/index.ts +651 -256
  47. package/dist/index.esm.js +0 -68685
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * TaroViz - 基于 Taro 和 ECharts 的多端图表组件库
3
- * @version 1.1.1
3
+ * @version 1.2.1
4
4
  */
5
5
 
6
6
  // 核心组件
@@ -45,18 +45,80 @@ export { default as HeatmapChart } from './charts/heatmap';
45
45
  export { default as GaugeChart } from './charts/gauge';
46
46
  export { default as FunnelChart } from './charts/funnel';
47
47
 
48
+ // 扩展图表组件 (新增)
49
+ export { default as TreeMapChart } from './charts/treemap';
50
+ export { default as SunburstChart } from './charts/sunburst';
51
+ export { default as SankeyChart } from './charts/sankey';
52
+
48
53
  // 适配器
49
54
  export { getAdapter, detectPlatform, getEnv } from './adapters';
50
55
  export { default as H5Adapter } from './adapters/h5';
51
56
  export { default as WeappAdapter } from './adapters/weapp';
52
57
 
53
- // 主题
58
+ // 主题系统
54
59
  export type { BuiltinTheme, ThemeOptions } from './themes';
55
- export { defaultTheme, darkTheme, getTheme, registerTheme } from './themes';
60
+ export {
61
+ defaultTheme,
62
+ darkTheme,
63
+ getTheme,
64
+ registerTheme,
65
+ switchTheme,
66
+ getRegisteredThemes,
67
+ getThemeByName,
68
+ getLightThemes,
69
+ getDarkThemes,
70
+ getThemesByTag,
71
+ } from './themes';
72
+
73
+ // 主题管理器 (新增)
74
+ export {
75
+ themeManager,
76
+ PRESET_THEMES,
77
+ type ThemeConfig,
78
+ type ThemeVariables,
79
+ type PresetThemeName,
80
+ } from './core/themes/ThemeManager';
56
81
 
57
82
  // 编辑器
58
83
  export { ThemeEditor } from './editor';
59
84
 
85
+ // 错误边界组件 (新增)
86
+ export { ErrorBoundary, withErrorBoundary, type ErrorBoundaryProps } from './core/components/ErrorBoundary';
87
+
88
+ // 懒加载组件 (新增)
89
+ export {
90
+ withLazyLoad,
91
+ preloadChart,
92
+ preloadAllCharts,
93
+ createLazyChart,
94
+ LazyChartRegistry,
95
+ } from './core/components/LazyChart';
96
+
97
+ // 标注系统 (新增)
98
+ export {
99
+ useAnnotation,
100
+ convertAnnotationToMarkLine,
101
+ convertAnnotationToMarkArea,
102
+ convertAnnotationToScatter,
103
+ AnnotationPresets,
104
+ createCompositeAnnotation,
105
+ type AnnotationProps,
106
+ type AnnotationType,
107
+ type MarkLineConfig,
108
+ type MarkAreaConfig,
109
+ type ScatterAnnotationConfig,
110
+ } from './core/components/Annotation';
111
+
112
+ // 导出工具 (新增)
113
+ export {
114
+ exportChart,
115
+ type ExportImageOptions,
116
+ type ExportSVGOptions,
117
+ type ExportPDFOptions,
118
+ type BatchExportOptions,
119
+ type ExportResult,
120
+ } from './core/utils/export/ExportUtils';
121
+
60
122
  // Hooks
61
123
  export {
62
124
  useChart,
@@ -66,10 +128,16 @@ export {
66
128
  useLoading,
67
129
  useChartTheme,
68
130
  useChartData,
131
+ useResponsive,
132
+ useThemeSwitcher,
133
+ useDataPolling,
134
+ useFullscreen,
135
+ useExport,
136
+ useChartTools,
69
137
  } from './hooks';
70
138
 
71
139
  /**
72
140
  * 库信息
73
141
  */
74
142
  export const name = 'taroviz';
75
- export const version = '1.1.1';
143
+ export const version = '1.2.1';
package/src/main.tsx CHANGED
@@ -163,7 +163,7 @@ const TestApp = () => {
163
163
  <select
164
164
  id="theme"
165
165
  value={darkMode ? 'dark' : 'light'}
166
- onChange={e => setDarkMode(e.target.value === 'dark')}
166
+ onChange={(e) => setDarkMode(e.target.value === 'dark')}
167
167
  >
168
168
  <option value="light">Light</option>
169
169
  <option value="dark">Dark</option>