@aura-react-comp/charts 0.2.0 → 0.4.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 (98) hide show
  1. package/esm/charts/area-chart/index.d.ts +2 -2
  2. package/esm/charts/area-chart/index.js +28 -23
  3. package/esm/charts/bar-chart/index.d.ts +1 -1
  4. package/esm/charts/bar-chart/index.js +18 -21
  5. package/esm/charts/candlestick-chart/index.d.ts +2 -2
  6. package/esm/charts/candlestick-chart/index.js +243 -180
  7. package/esm/charts/combo-chart/index.d.ts +1 -1
  8. package/esm/charts/combo-chart/index.js +9 -20
  9. package/esm/charts/funnel-chart/index.d.ts +2 -2
  10. package/esm/charts/funnel-chart/index.js +134 -108
  11. package/esm/charts/gauge-chart/index.d.ts +1 -1
  12. package/esm/charts/gauge-chart/index.js +103 -105
  13. package/esm/charts/graph-chart/index.d.ts +3 -3
  14. package/esm/charts/graph-chart/index.js +155 -114
  15. package/esm/charts/heatmap-chart/index.d.ts +2 -2
  16. package/esm/charts/heatmap-chart/index.js +180 -135
  17. package/esm/charts/line-chart/index.d.ts +2 -2
  18. package/esm/charts/line-chart/index.js +29 -24
  19. package/esm/charts/pie-chart/index.d.ts +2 -2
  20. package/esm/charts/pie-chart/index.d.ts.map +1 -1
  21. package/esm/charts/pie-chart/index.js +199 -139
  22. package/esm/charts/radar-chart/index.d.ts +2 -2
  23. package/esm/charts/radar-chart/index.d.ts.map +1 -1
  24. package/esm/charts/radar-chart/index.js +155 -128
  25. package/esm/charts/ring-progress/index.d.ts +1 -1
  26. package/esm/charts/ring-progress/index.js +82 -82
  27. package/esm/charts/sankey-chart/index.d.ts +3 -3
  28. package/esm/charts/sankey-chart/index.js +172 -141
  29. package/esm/charts/scatter-chart/index.d.ts +3 -3
  30. package/esm/charts/scatter-chart/index.d.ts.map +1 -1
  31. package/esm/charts/scatter-chart/index.js +226 -159
  32. package/esm/charts/sparkline/index.d.ts +1 -1
  33. package/esm/charts/sparkline/index.js +82 -66
  34. package/esm/charts/tree-chart/index.d.ts +3 -3
  35. package/esm/charts/tree-chart/index.js +129 -102
  36. package/esm/charts/treemap-chart/index.d.ts +3 -3
  37. package/esm/charts/treemap-chart/index.js +163 -141
  38. package/esm/charts/waterfall-chart/index.d.ts +2 -2
  39. package/esm/charts/waterfall-chart/index.js +166 -121
  40. package/esm/components/Legend.d.ts +5 -4
  41. package/esm/components/Legend.d.ts.map +1 -1
  42. package/esm/components/Legend.js +80 -48
  43. package/esm/components/Tooltip.d.ts +2 -2
  44. package/esm/components/Tooltip.js +63 -71
  45. package/esm/components/chart/index.d.ts +5 -2
  46. package/esm/components/chart/index.d.ts.map +1 -1
  47. package/esm/components/chart/index.js +81 -102
  48. package/esm/components/chart.less +13 -0
  49. package/esm/core/animation.js +32 -43
  50. package/esm/core/export.d.ts +34 -0
  51. package/esm/core/export.d.ts.map +1 -0
  52. package/esm/core/export.js +390 -0
  53. package/esm/core/force.js +23 -45
  54. package/esm/core/format.js +49 -52
  55. package/esm/core/hierarchy.d.ts +1 -1
  56. package/esm/core/hierarchy.js +61 -92
  57. package/esm/core/layout.d.ts +1 -1
  58. package/esm/core/layout.js +33 -50
  59. package/esm/core/sampling.js +31 -53
  60. package/esm/core/sankey.js +36 -55
  61. package/esm/core/scale.js +73 -86
  62. package/esm/core/shape.js +102 -133
  63. package/esm/core/sync.d.ts +41 -0
  64. package/esm/core/sync.d.ts.map +1 -0
  65. package/esm/core/sync.js +120 -0
  66. package/esm/hooks/useChartExport.d.ts +19 -0
  67. package/esm/hooks/useChartExport.d.ts.map +1 -0
  68. package/esm/hooks/useChartExport.js +35 -0
  69. package/esm/hooks/useChartTheme.d.ts +6 -5
  70. package/esm/hooks/useChartTheme.d.ts.map +1 -1
  71. package/esm/hooks/useChartTheme.js +18 -18
  72. package/esm/hooks/useChartTransition.d.ts +1 -1
  73. package/esm/hooks/useChartTransition.js +59 -73
  74. package/esm/hooks/useElementSize.js +20 -28
  75. package/esm/hooks/usePlotPointer.d.ts +23 -0
  76. package/esm/hooks/usePlotPointer.d.ts.map +1 -0
  77. package/esm/hooks/usePlotPointer.js +94 -0
  78. package/esm/index.d.ts +56 -50
  79. package/esm/index.d.ts.map +1 -1
  80. package/esm/index.js +137 -47
  81. package/esm/internal/CartesianChart.d.ts +1 -1
  82. package/esm/internal/CartesianChart.d.ts.map +1 -1
  83. package/esm/internal/CartesianChart.js +667 -485
  84. package/esm/internal/model.d.ts +2 -2
  85. package/esm/internal/model.js +45 -60
  86. package/esm/scene/canvas.d.ts +1 -1
  87. package/esm/scene/canvas.js +101 -107
  88. package/esm/scene/svg.d.ts +1 -1
  89. package/esm/scene/svg.js +107 -99
  90. package/esm/scene/types.js +9 -15
  91. package/esm/style.css +10 -0
  92. package/esm/theme/index.d.ts +2 -2
  93. package/esm/theme/index.d.ts.map +1 -1
  94. package/esm/theme/index.js +145 -170
  95. package/esm/types.d.ts +7 -3
  96. package/esm/types.d.ts.map +1 -1
  97. package/esm/types.js +1 -1
  98. package/package.json +2 -2
package/esm/index.js CHANGED
@@ -1,47 +1,137 @@
1
- /**
2
- * @aura-react-comp/charts
3
- *
4
- * 自研图表库:SVG / Canvas 双渲染内核 + 令牌驱动主题。
5
- *
6
- * 分层导出:
7
- * · 图表组件(LineChart / BarChart / ...)—— 日常使用
8
- * · 配置式 <Chart option> —— 迁移 ECharts 或让 AI 生成
9
- * · 主题工具(createChartTheme / readAuraTheme)—— 深度定制
10
- * · 内核(scale / shape)—— 自建图表时的乐高积木
11
- */
12
-
13
- // 图表组件
14
- export { LineChart } from "./charts/line-chart";
15
- export { BarChart } from "./charts/bar-chart";
16
- export { AreaChart } from "./charts/area-chart";
17
- export { ComboChart } from "./charts/combo-chart";
18
- export { ScatterChart } from "./charts/scatter-chart";
19
- export { PieChart } from "./charts/pie-chart";
20
- export { RadarChart } from "./charts/radar-chart";
21
- export { GaugeChart } from "./charts/gauge-chart";
22
- export { FunnelChart } from "./charts/funnel-chart";
23
- export { RingProgress } from "./charts/ring-progress";
24
- export { WaterfallChart } from "./charts/waterfall-chart";
25
- export { Sparkline } from "./charts/sparkline";
26
- export { HeatmapChart } from "./charts/heatmap-chart";
27
- export { CandlestickChart } from "./charts/candlestick-chart";
28
- export { TreemapChart } from "./charts/treemap-chart";
29
- export { TreeChart } from "./charts/tree-chart";
30
- export { SankeyChart } from "./charts/sankey-chart";
31
- export { GraphChart } from "./charts/graph-chart";
32
- // Tooltip 组件(3D 图表等外部场景复用)
33
- export { Tooltip } from "./components/Tooltip";
34
- export { useElementSize } from "./hooks/useElementSize";
35
-
36
- // 配置式入口
37
- export { Chart } from "./components/chart";
38
-
39
- // 通用类型
40
-
41
- // 主题
42
- export { createChartTheme, readAuraTheme, resolveTheme, detectDarkMode, colorAt, withAlpha, mixColor, parseColor, lightTheme, darkTheme, DEFAULT_PALETTE } from "./theme";
43
- // 内核(供自建图表复用)
44
- export { createBandScale, createPointScale, createLinearScale, linearTicks, niceStep, niceExtent, extentOf, extentWithZero } from "./core/scale";
45
- export { linePath, areaPath, arcLinePath, arcPath, roundedRectPath, symbolPath, splitSegments } from "./core/shape";
46
- export { formatNumber, formatCompact, formatPercent, estimateTextWidth } from "./core/format";
47
- export { squarify, buildTreemap, layoutTree, sumValues } from "./core/hierarchy";
1
+ 'use client';
2
+ // src/index.ts
3
+ import { LineChart } from "./charts/line-chart";
4
+ import { BarChart } from "./charts/bar-chart";
5
+ import { AreaChart } from "./charts/area-chart";
6
+ import { ComboChart } from "./charts/combo-chart";
7
+ import { ScatterChart } from "./charts/scatter-chart";
8
+ import { PieChart } from "./charts/pie-chart";
9
+ import { RadarChart } from "./charts/radar-chart";
10
+ import { GaugeChart } from "./charts/gauge-chart";
11
+ import { FunnelChart } from "./charts/funnel-chart";
12
+ import { RingProgress } from "./charts/ring-progress";
13
+ import { WaterfallChart } from "./charts/waterfall-chart";
14
+ import { Sparkline } from "./charts/sparkline";
15
+ import { HeatmapChart } from "./charts/heatmap-chart";
16
+ import { CandlestickChart } from "./charts/candlestick-chart";
17
+ import { TreemapChart } from "./charts/treemap-chart";
18
+ import { TreeChart } from "./charts/tree-chart";
19
+ import { SankeyChart } from "./charts/sankey-chart";
20
+ import { GraphChart } from "./charts/graph-chart";
21
+ import { Tooltip } from "./components/Tooltip";
22
+ import { useElementSize } from "./hooks/useElementSize";
23
+ import { ChartSyncProvider, useChartSync } from "./core/sync";
24
+ import {
25
+ exportChartSvg,
26
+ exportChartDataUrl,
27
+ downloadChart
28
+ } from "./core/export";
29
+ import { useChartExport } from "./hooks/useChartExport";
30
+ import { Chart } from "./components/chart";
31
+ import {
32
+ createChartTheme,
33
+ readAuraTheme,
34
+ resolveTheme,
35
+ detectDarkMode,
36
+ colorAt,
37
+ withAlpha,
38
+ mixColor,
39
+ parseColor,
40
+ lightTheme,
41
+ darkTheme,
42
+ DEFAULT_PALETTE
43
+ } from "./theme";
44
+ import {
45
+ createBandScale,
46
+ createPointScale,
47
+ createLinearScale,
48
+ linearTicks,
49
+ niceStep,
50
+ niceExtent,
51
+ extentOf,
52
+ extentWithZero
53
+ } from "./core/scale";
54
+ import {
55
+ linePath,
56
+ areaPath,
57
+ arcLinePath,
58
+ arcPath,
59
+ roundedRectPath,
60
+ symbolPath,
61
+ splitSegments
62
+ } from "./core/shape";
63
+ import {
64
+ formatNumber,
65
+ formatCompact,
66
+ formatPercent,
67
+ estimateTextWidth
68
+ } from "./core/format";
69
+ import {
70
+ squarify,
71
+ buildTreemap,
72
+ layoutTree,
73
+ sumValues
74
+ } from "./core/hierarchy";
75
+ export {
76
+ AreaChart,
77
+ BarChart,
78
+ CandlestickChart,
79
+ Chart,
80
+ ChartSyncProvider,
81
+ ComboChart,
82
+ DEFAULT_PALETTE,
83
+ FunnelChart,
84
+ GaugeChart,
85
+ GraphChart,
86
+ HeatmapChart,
87
+ LineChart,
88
+ PieChart,
89
+ RadarChart,
90
+ RingProgress,
91
+ SankeyChart,
92
+ ScatterChart,
93
+ Sparkline,
94
+ Tooltip,
95
+ TreeChart,
96
+ TreemapChart,
97
+ WaterfallChart,
98
+ arcLinePath,
99
+ arcPath,
100
+ areaPath,
101
+ buildTreemap,
102
+ colorAt,
103
+ createBandScale,
104
+ createChartTheme,
105
+ createLinearScale,
106
+ createPointScale,
107
+ darkTheme,
108
+ detectDarkMode,
109
+ downloadChart,
110
+ estimateTextWidth,
111
+ exportChartDataUrl,
112
+ exportChartSvg,
113
+ extentOf,
114
+ extentWithZero,
115
+ formatCompact,
116
+ formatNumber,
117
+ formatPercent,
118
+ layoutTree,
119
+ lightTheme,
120
+ linePath,
121
+ linearTicks,
122
+ mixColor,
123
+ niceExtent,
124
+ niceStep,
125
+ parseColor,
126
+ readAuraTheme,
127
+ resolveTheme,
128
+ roundedRectPath,
129
+ splitSegments,
130
+ squarify,
131
+ sumValues,
132
+ symbolPath,
133
+ useChartExport,
134
+ useChartSync,
135
+ useElementSize,
136
+ withAlpha
137
+ };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { BaseChartProps, SeriesType } from '../types';
2
+ import type { BaseChartProps, SeriesType } from '../types.js';
3
3
  export interface CartesianChartProps extends BaseChartProps {
4
4
  /** 系列默认类型,由各图表组件注入 */
5
5
  defaultType: SeriesType;
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAEV,cAAc,EACd,UAAU,EAEX,MAAM,UAAU,CAAC;AAwBlB,OAAO,0BAA0B,CAAC;AAclC,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,sBAAsB;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4BD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA4/BxD"}
1
+ {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAEV,cAAc,EACd,UAAU,EAEX,MAAM,UAAU,CAAC;AA0BlB,OAAO,0BAA0B,CAAC;AAclC,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,sBAAsB;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA4BD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAmiCxD"}