@aura-react-comp/charts 0.3.1 → 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.
- package/esm/charts/area-chart/index.js +27 -23
- package/esm/charts/bar-chart/index.js +17 -21
- package/esm/charts/candlestick-chart/index.js +242 -180
- package/esm/charts/combo-chart/index.js +8 -20
- package/esm/charts/funnel-chart/index.js +133 -108
- package/esm/charts/gauge-chart/index.js +102 -105
- package/esm/charts/graph-chart/index.js +154 -114
- package/esm/charts/heatmap-chart/index.js +179 -135
- package/esm/charts/line-chart/index.js +28 -24
- package/esm/charts/pie-chart/index.d.ts.map +1 -1
- package/esm/charts/pie-chart/index.js +198 -139
- package/esm/charts/radar-chart/index.d.ts.map +1 -1
- package/esm/charts/radar-chart/index.js +154 -128
- package/esm/charts/ring-progress/index.js +81 -82
- package/esm/charts/sankey-chart/index.js +171 -141
- package/esm/charts/scatter-chart/index.d.ts.map +1 -1
- package/esm/charts/scatter-chart/index.js +225 -159
- package/esm/charts/sparkline/index.js +81 -66
- package/esm/charts/tree-chart/index.js +128 -102
- package/esm/charts/treemap-chart/index.js +162 -141
- package/esm/charts/waterfall-chart/index.js +165 -121
- package/esm/components/Legend.d.ts +3 -2
- package/esm/components/Legend.d.ts.map +1 -1
- package/esm/components/Legend.js +79 -48
- package/esm/components/Tooltip.js +62 -71
- package/esm/components/chart/index.d.ts +4 -1
- package/esm/components/chart/index.d.ts.map +1 -1
- package/esm/components/chart/index.js +80 -102
- package/esm/components/chart.less +13 -0
- package/esm/core/animation.js +31 -43
- package/esm/core/export.d.ts +34 -0
- package/esm/core/export.d.ts.map +1 -0
- package/esm/core/export.js +390 -0
- package/esm/core/force.js +22 -45
- package/esm/core/format.js +48 -52
- package/esm/core/hierarchy.js +60 -92
- package/esm/core/layout.js +32 -50
- package/esm/core/sampling.js +30 -53
- package/esm/core/sankey.js +35 -55
- package/esm/core/scale.js +72 -86
- package/esm/core/shape.js +101 -133
- package/esm/core/sync.d.ts +41 -0
- package/esm/core/sync.d.ts.map +1 -0
- package/esm/core/sync.js +120 -0
- package/esm/hooks/useChartExport.d.ts +19 -0
- package/esm/hooks/useChartExport.d.ts.map +1 -0
- package/esm/hooks/useChartExport.js +35 -0
- package/esm/hooks/useChartTheme.js +17 -19
- package/esm/hooks/useChartTransition.js +58 -73
- package/esm/hooks/useElementSize.js +19 -28
- package/esm/hooks/usePlotPointer.d.ts +23 -0
- package/esm/hooks/usePlotPointer.d.ts.map +1 -0
- package/esm/hooks/usePlotPointer.js +94 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +136 -47
- package/esm/internal/CartesianChart.d.ts.map +1 -1
- package/esm/internal/CartesianChart.js +666 -485
- package/esm/internal/model.js +44 -60
- package/esm/scene/canvas.js +100 -107
- package/esm/scene/svg.js +106 -99
- package/esm/scene/types.js +8 -15
- package/esm/style.css +10 -0
- package/esm/theme/index.js +143 -171
- package/esm/types.d.ts +4 -0
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js +0 -1
- package/package.json +1 -1
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
2
|
+
// src/charts/area-chart/index.tsx
|
|
3
|
+
import { useMemo } from "react";
|
|
3
4
|
import { CartesianChart } from "../../internal/CartesianChart";
|
|
4
|
-
import { jsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* 单系列面积图用来强调「量级」,多系列时**必须**开 stack,
|
|
9
|
-
* 否则后画的系列会遮住前面的 —— 这是面积图最常见的误用。
|
|
10
|
-
*/
|
|
11
|
-
export function AreaChart({
|
|
12
|
-
curve = 'monotone',
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function AreaChart({
|
|
7
|
+
curve = "monotone",
|
|
13
8
|
smooth = false,
|
|
14
9
|
stack = false,
|
|
15
10
|
areaOpacity,
|
|
16
11
|
series,
|
|
17
12
|
...rest
|
|
18
13
|
}) {
|
|
19
|
-
const merged = useMemo(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
const merged = useMemo(
|
|
15
|
+
() => (series ?? []).map((item) => ({
|
|
16
|
+
type: "area",
|
|
17
|
+
curve: smooth ? "smooth" : curve,
|
|
18
|
+
areaOpacity,
|
|
19
|
+
...item
|
|
20
|
+
})),
|
|
21
|
+
[series, smooth, curve, areaOpacity]
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
CartesianChart,
|
|
25
|
+
{
|
|
26
|
+
...rest,
|
|
27
|
+
series: merged,
|
|
28
|
+
defaultType: "area",
|
|
29
|
+
stack
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
AreaChart
|
|
35
|
+
};
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
2
|
+
// src/charts/bar-chart/index.tsx
|
|
3
|
+
import { useMemo } from "react";
|
|
3
4
|
import { CartesianChart } from "../../internal/CartesianChart";
|
|
4
|
-
import { jsx
|
|
5
|
-
|
|
6
|
-
* 柱状图。
|
|
7
|
-
*
|
|
8
|
-
* y 轴默认从 0 起(startFromZero),这是柱状图的硬性要求:
|
|
9
|
-
* 柱子用「长度」编码数值,基线不在 0 会让长度比例失真。
|
|
10
|
-
*/
|
|
11
|
-
export function BarChart({
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function BarChart({
|
|
12
7
|
stack = false,
|
|
13
8
|
barMaxWidth,
|
|
14
9
|
series,
|
|
15
10
|
...rest
|
|
16
11
|
}) {
|
|
17
|
-
const merged = useMemo(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
const merged = useMemo(
|
|
13
|
+
() => (series ?? []).map((item) => ({
|
|
14
|
+
type: "bar",
|
|
15
|
+
barMaxWidth,
|
|
16
|
+
...item
|
|
17
|
+
})),
|
|
18
|
+
[series, barMaxWidth]
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ jsx(CartesianChart, { ...rest, series: merged, defaultType: "bar", stack });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
BarChart
|
|
24
|
+
};
|