@aura-react-comp/charts 0.0.0-stage → 0.3.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 (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +90 -2
  3. package/esm/charts/area-chart/index.d.ts +19 -0
  4. package/esm/charts/area-chart/index.d.ts.map +1 -0
  5. package/esm/charts/area-chart/index.js +31 -0
  6. package/esm/charts/bar-chart/index.d.ts +16 -0
  7. package/esm/charts/bar-chart/index.d.ts.map +1 -0
  8. package/esm/charts/bar-chart/index.js +28 -0
  9. package/esm/charts/candlestick-chart/index.d.ts +47 -0
  10. package/esm/charts/candlestick-chart/index.d.ts.map +1 -0
  11. package/esm/charts/candlestick-chart/index.js +347 -0
  12. package/esm/charts/combo-chart/index.d.ts +17 -0
  13. package/esm/charts/combo-chart/index.d.ts.map +1 -0
  14. package/esm/charts/combo-chart/index.js +26 -0
  15. package/esm/charts/funnel-chart/index.d.ts +35 -0
  16. package/esm/charts/funnel-chart/index.d.ts.map +1 -0
  17. package/esm/charts/funnel-chart/index.js +200 -0
  18. package/esm/charts/gauge-chart/index.d.ts +41 -0
  19. package/esm/charts/gauge-chart/index.d.ts.map +1 -0
  20. package/esm/charts/gauge-chart/index.js +217 -0
  21. package/esm/charts/graph-chart/index.d.ts +35 -0
  22. package/esm/charts/graph-chart/index.d.ts.map +1 -0
  23. package/esm/charts/graph-chart/index.js +224 -0
  24. package/esm/charts/heatmap-chart/index.d.ts +47 -0
  25. package/esm/charts/heatmap-chart/index.d.ts.map +1 -0
  26. package/esm/charts/heatmap-chart/index.js +281 -0
  27. package/esm/charts/line-chart/index.d.ts +23 -0
  28. package/esm/charts/line-chart/index.d.ts.map +1 -0
  29. package/esm/charts/line-chart/index.js +33 -0
  30. package/esm/charts/pie-chart/index.d.ts +38 -0
  31. package/esm/charts/pie-chart/index.d.ts.map +1 -0
  32. package/esm/charts/pie-chart/index.js +272 -0
  33. package/esm/charts/radar-chart/index.d.ts +44 -0
  34. package/esm/charts/radar-chart/index.d.ts.map +1 -0
  35. package/esm/charts/radar-chart/index.js +263 -0
  36. package/esm/charts/ring-progress/index.d.ts +38 -0
  37. package/esm/charts/ring-progress/index.d.ts.map +1 -0
  38. package/esm/charts/ring-progress/index.js +137 -0
  39. package/esm/charts/sankey-chart/index.d.ts +34 -0
  40. package/esm/charts/sankey-chart/index.d.ts.map +1 -0
  41. package/esm/charts/sankey-chart/index.js +248 -0
  42. package/esm/charts/scatter-chart/index.d.ts +34 -0
  43. package/esm/charts/scatter-chart/index.d.ts.map +1 -0
  44. package/esm/charts/scatter-chart/index.js +305 -0
  45. package/esm/charts/sparkline/index.d.ts +31 -0
  46. package/esm/charts/sparkline/index.d.ts.map +1 -0
  47. package/esm/charts/sparkline/index.js +152 -0
  48. package/esm/charts/tree-chart/index.d.ts +34 -0
  49. package/esm/charts/tree-chart/index.d.ts.map +1 -0
  50. package/esm/charts/tree-chart/index.js +200 -0
  51. package/esm/charts/treemap-chart/index.d.ts +35 -0
  52. package/esm/charts/treemap-chart/index.d.ts.map +1 -0
  53. package/esm/charts/treemap-chart/index.js +239 -0
  54. package/esm/charts/waterfall-chart/index.d.ts +41 -0
  55. package/esm/charts/waterfall-chart/index.d.ts.map +1 -0
  56. package/esm/charts/waterfall-chart/index.js +281 -0
  57. package/esm/components/Legend.d.ts +24 -0
  58. package/esm/components/Legend.d.ts.map +1 -0
  59. package/esm/components/Legend.js +50 -0
  60. package/esm/components/Tooltip.d.ts +24 -0
  61. package/esm/components/Tooltip.d.ts.map +1 -0
  62. package/esm/components/Tooltip.js +85 -0
  63. package/esm/components/chart/index.d.ts +71 -0
  64. package/esm/components/chart/index.d.ts.map +1 -0
  65. package/esm/components/chart/index.js +142 -0
  66. package/esm/components/chart.less +223 -0
  67. package/esm/core/animation.d.ts +49 -0
  68. package/esm/core/animation.d.ts.map +1 -0
  69. package/esm/core/animation.js +93 -0
  70. package/esm/core/force.d.ts +43 -0
  71. package/esm/core/force.d.ts.map +1 -0
  72. package/esm/core/force.js +134 -0
  73. package/esm/core/format.d.ts +34 -0
  74. package/esm/core/format.d.ts.map +1 -0
  75. package/esm/core/format.js +81 -0
  76. package/esm/core/hierarchy.d.ts +77 -0
  77. package/esm/core/hierarchy.d.ts.map +1 -0
  78. package/esm/core/hierarchy.js +233 -0
  79. package/esm/core/layout.d.ts +67 -0
  80. package/esm/core/layout.d.ts.map +1 -0
  81. package/esm/core/layout.js +121 -0
  82. package/esm/core/sampling.d.ts +32 -0
  83. package/esm/core/sampling.d.ts.map +1 -0
  84. package/esm/core/sampling.js +124 -0
  85. package/esm/core/sankey.d.ts +67 -0
  86. package/esm/core/sankey.d.ts.map +1 -0
  87. package/esm/core/sankey.js +136 -0
  88. package/esm/core/scale.d.ts +98 -0
  89. package/esm/core/scale.d.ts.map +1 -0
  90. package/esm/core/scale.js +207 -0
  91. package/esm/core/shape.d.ts +60 -0
  92. package/esm/core/shape.d.ts.map +1 -0
  93. package/esm/core/shape.js +246 -0
  94. package/esm/global.d.ts +6 -0
  95. package/esm/hooks/useChartTheme.d.ts +11 -0
  96. package/esm/hooks/useChartTheme.d.ts.map +1 -0
  97. package/esm/hooks/useChartTheme.js +35 -0
  98. package/esm/hooks/useChartTransition.d.ts +20 -0
  99. package/esm/hooks/useChartTransition.d.ts.map +1 -0
  100. package/esm/hooks/useChartTransition.js +120 -0
  101. package/esm/hooks/useElementSize.d.ts +17 -0
  102. package/esm/hooks/useElementSize.d.ts.map +1 -0
  103. package/esm/hooks/useElementSize.js +47 -0
  104. package/esm/index.d.ts +62 -0
  105. package/esm/index.d.ts.map +1 -0
  106. package/esm/index.js +48 -0
  107. package/esm/internal/CartesianChart.d.ts +16 -0
  108. package/esm/internal/CartesianChart.d.ts.map +1 -0
  109. package/esm/internal/CartesianChart.js +811 -0
  110. package/esm/internal/model.d.ts +67 -0
  111. package/esm/internal/model.d.ts.map +1 -0
  112. package/esm/internal/model.js +146 -0
  113. package/esm/scene/canvas.d.ts +18 -0
  114. package/esm/scene/canvas.d.ts.map +1 -0
  115. package/esm/scene/canvas.js +138 -0
  116. package/esm/scene/svg.d.ts +12 -0
  117. package/esm/scene/svg.d.ts.map +1 -0
  118. package/esm/scene/svg.js +116 -0
  119. package/esm/scene/types.d.ts +89 -0
  120. package/esm/scene/types.d.ts.map +1 -0
  121. package/esm/scene/types.js +21 -0
  122. package/esm/style.css +196 -0
  123. package/esm/theme/index.d.ts +127 -0
  124. package/esm/theme/index.d.ts.map +1 -0
  125. package/esm/theme/index.js +300 -0
  126. package/esm/types.d.ts +168 -0
  127. package/esm/types.d.ts.map +1 -0
  128. package/esm/types.js +2 -0
  129. package/package.json +64 -3
package/esm/index.js ADDED
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+ /**
3
+ * @aura-react-comp/charts
4
+ *
5
+ * 自研图表库:SVG / Canvas 双渲染内核 + 令牌驱动主题。
6
+ *
7
+ * 分层导出:
8
+ * · 图表组件(LineChart / BarChart / ...)—— 日常使用
9
+ * · 配置式 <Chart option> —— 迁移 ECharts 或让 AI 生成
10
+ * · 主题工具(createChartTheme / readAuraTheme)—— 深度定制
11
+ * · 内核(scale / shape)—— 自建图表时的乐高积木
12
+ */
13
+
14
+ // 图表组件
15
+ export { LineChart } from "./charts/line-chart";
16
+ export { BarChart } from "./charts/bar-chart";
17
+ export { AreaChart } from "./charts/area-chart";
18
+ export { ComboChart } from "./charts/combo-chart";
19
+ export { ScatterChart } from "./charts/scatter-chart";
20
+ export { PieChart } from "./charts/pie-chart";
21
+ export { RadarChart } from "./charts/radar-chart";
22
+ export { GaugeChart } from "./charts/gauge-chart";
23
+ export { FunnelChart } from "./charts/funnel-chart";
24
+ export { RingProgress } from "./charts/ring-progress";
25
+ export { WaterfallChart } from "./charts/waterfall-chart";
26
+ export { Sparkline } from "./charts/sparkline";
27
+ export { HeatmapChart } from "./charts/heatmap-chart";
28
+ export { CandlestickChart } from "./charts/candlestick-chart";
29
+ export { TreemapChart } from "./charts/treemap-chart";
30
+ export { TreeChart } from "./charts/tree-chart";
31
+ export { SankeyChart } from "./charts/sankey-chart";
32
+ export { GraphChart } from "./charts/graph-chart";
33
+ // Tooltip 组件(3D 图表等外部场景复用)
34
+ export { Tooltip } from "./components/Tooltip";
35
+ export { useElementSize } from "./hooks/useElementSize";
36
+
37
+ // 配置式入口
38
+ export { Chart } from "./components/chart";
39
+
40
+ // 通用类型
41
+
42
+ // 主题
43
+ export { createChartTheme, readAuraTheme, resolveTheme, detectDarkMode, colorAt, withAlpha, mixColor, parseColor, lightTheme, darkTheme, DEFAULT_PALETTE } from "./theme";
44
+ // 内核(供自建图表复用)
45
+ export { createBandScale, createPointScale, createLinearScale, linearTicks, niceStep, niceExtent, extentOf, extentWithZero } from "./core/scale";
46
+ export { linePath, areaPath, arcLinePath, arcPath, roundedRectPath, symbolPath, splitSegments } from "./core/shape";
47
+ export { formatNumber, formatCompact, formatPercent, estimateTextWidth } from "./core/format";
48
+ export { squarify, buildTreemap, layoutTree, sumValues } from "./core/hierarchy";
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { BaseChartProps, SeriesType } from '../types.js';
3
+ export interface CartesianChartProps extends BaseChartProps {
4
+ /** 系列默认类型,由各图表组件注入 */
5
+ defaultType: SeriesType;
6
+ /** 是否开启堆叠(等价于给每个系列设置同一个 stack id) */
7
+ stack?: boolean;
8
+ }
9
+ /**
10
+ * 直角坐标系图表内核。
11
+ *
12
+ * 折线 / 柱状 / 面积 / 折柱混合全部由它渲染 —— 差异只在 series.type。
13
+ * 这样组合图(一个系列折线、一个系列柱子)天然支持,无需额外组件。
14
+ */
15
+ export declare function CartesianChart(props: CartesianChartProps): React.JSX.Element;
16
+ //# sourceMappingURL=CartesianChart.d.ts.map
@@ -0,0 +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"}