@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.
- package/esm/charts/area-chart/index.d.ts +2 -2
- package/esm/charts/area-chart/index.js +28 -23
- package/esm/charts/bar-chart/index.d.ts +1 -1
- package/esm/charts/bar-chart/index.js +18 -21
- package/esm/charts/candlestick-chart/index.d.ts +2 -2
- package/esm/charts/candlestick-chart/index.js +243 -180
- package/esm/charts/combo-chart/index.d.ts +1 -1
- package/esm/charts/combo-chart/index.js +9 -20
- package/esm/charts/funnel-chart/index.d.ts +2 -2
- package/esm/charts/funnel-chart/index.js +134 -108
- package/esm/charts/gauge-chart/index.d.ts +1 -1
- package/esm/charts/gauge-chart/index.js +103 -105
- package/esm/charts/graph-chart/index.d.ts +3 -3
- package/esm/charts/graph-chart/index.js +155 -114
- package/esm/charts/heatmap-chart/index.d.ts +2 -2
- package/esm/charts/heatmap-chart/index.js +180 -135
- package/esm/charts/line-chart/index.d.ts +2 -2
- package/esm/charts/line-chart/index.js +29 -24
- package/esm/charts/pie-chart/index.d.ts +2 -2
- package/esm/charts/pie-chart/index.d.ts.map +1 -1
- package/esm/charts/pie-chart/index.js +199 -139
- package/esm/charts/radar-chart/index.d.ts +2 -2
- package/esm/charts/radar-chart/index.d.ts.map +1 -1
- package/esm/charts/radar-chart/index.js +155 -128
- package/esm/charts/ring-progress/index.d.ts +1 -1
- package/esm/charts/ring-progress/index.js +82 -82
- package/esm/charts/sankey-chart/index.d.ts +3 -3
- package/esm/charts/sankey-chart/index.js +172 -141
- package/esm/charts/scatter-chart/index.d.ts +3 -3
- package/esm/charts/scatter-chart/index.d.ts.map +1 -1
- package/esm/charts/scatter-chart/index.js +226 -159
- package/esm/charts/sparkline/index.d.ts +1 -1
- package/esm/charts/sparkline/index.js +82 -66
- package/esm/charts/tree-chart/index.d.ts +3 -3
- package/esm/charts/tree-chart/index.js +129 -102
- package/esm/charts/treemap-chart/index.d.ts +3 -3
- package/esm/charts/treemap-chart/index.js +163 -141
- package/esm/charts/waterfall-chart/index.d.ts +2 -2
- package/esm/charts/waterfall-chart/index.js +166 -121
- package/esm/components/Legend.d.ts +5 -4
- package/esm/components/Legend.d.ts.map +1 -1
- package/esm/components/Legend.js +80 -48
- package/esm/components/Tooltip.d.ts +2 -2
- package/esm/components/Tooltip.js +63 -71
- package/esm/components/chart/index.d.ts +5 -2
- package/esm/components/chart/index.d.ts.map +1 -1
- package/esm/components/chart/index.js +81 -102
- package/esm/components/chart.less +13 -0
- package/esm/core/animation.js +32 -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 +23 -45
- package/esm/core/format.js +49 -52
- package/esm/core/hierarchy.d.ts +1 -1
- package/esm/core/hierarchy.js +61 -92
- package/esm/core/layout.d.ts +1 -1
- package/esm/core/layout.js +33 -50
- package/esm/core/sampling.js +31 -53
- package/esm/core/sankey.js +36 -55
- package/esm/core/scale.js +73 -86
- package/esm/core/shape.js +102 -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.d.ts +6 -5
- package/esm/hooks/useChartTheme.d.ts.map +1 -1
- package/esm/hooks/useChartTheme.js +18 -18
- package/esm/hooks/useChartTransition.d.ts +1 -1
- package/esm/hooks/useChartTransition.js +59 -73
- package/esm/hooks/useElementSize.js +20 -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 +56 -50
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +137 -47
- package/esm/internal/CartesianChart.d.ts +1 -1
- package/esm/internal/CartesianChart.d.ts.map +1 -1
- package/esm/internal/CartesianChart.js +667 -485
- package/esm/internal/model.d.ts +2 -2
- package/esm/internal/model.js +45 -60
- package/esm/scene/canvas.d.ts +1 -1
- package/esm/scene/canvas.js +101 -107
- package/esm/scene/svg.d.ts +1 -1
- package/esm/scene/svg.js +107 -99
- package/esm/scene/types.js +9 -15
- package/esm/style.css +10 -0
- package/esm/theme/index.d.ts +2 -2
- package/esm/theme/index.d.ts.map +1 -1
- package/esm/theme/index.js +145 -170
- package/esm/types.d.ts +7 -3
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BaseChartProps } from '../../types';
|
|
3
|
-
import type { CurveType } from '../../core/shape';
|
|
2
|
+
import type { BaseChartProps } from '../../types.js';
|
|
3
|
+
import type { CurveType } from '../../core/shape.js';
|
|
4
4
|
export interface AreaChartProps extends BaseChartProps {
|
|
5
5
|
curve?: CurveType;
|
|
6
6
|
smooth?: boolean;
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
// src/charts/area-chart/index.tsx
|
|
3
|
+
import { useMemo } from "react";
|
|
2
4
|
import { CartesianChart } from "../../internal/CartesianChart";
|
|
3
|
-
import { jsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* 单系列面积图用来强调「量级」,多系列时**必须**开 stack,
|
|
8
|
-
* 否则后画的系列会遮住前面的 —— 这是面积图最常见的误用。
|
|
9
|
-
*/
|
|
10
|
-
export function AreaChart({
|
|
11
|
-
curve = 'monotone',
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function AreaChart({
|
|
7
|
+
curve = "monotone",
|
|
12
8
|
smooth = false,
|
|
13
9
|
stack = false,
|
|
14
10
|
areaOpacity,
|
|
15
11
|
series,
|
|
16
12
|
...rest
|
|
17
13
|
}) {
|
|
18
|
-
const merged = useMemo(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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,27 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
// src/charts/bar-chart/index.tsx
|
|
3
|
+
import { useMemo } from "react";
|
|
2
4
|
import { CartesianChart } from "../../internal/CartesianChart";
|
|
3
|
-
import { jsx
|
|
4
|
-
|
|
5
|
-
* 柱状图。
|
|
6
|
-
*
|
|
7
|
-
* y 轴默认从 0 起(startFromZero),这是柱状图的硬性要求:
|
|
8
|
-
* 柱子用「长度」编码数值,基线不在 0 会让长度比例失真。
|
|
9
|
-
*/
|
|
10
|
-
export function BarChart({
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function BarChart({
|
|
11
7
|
stack = false,
|
|
12
8
|
barMaxWidth,
|
|
13
9
|
series,
|
|
14
10
|
...rest
|
|
15
11
|
}) {
|
|
16
|
-
const merged = useMemo(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ChartThemeInput } from '../../theme';
|
|
3
|
-
import type { ChartAnimationInput, TooltipConfig } from '../../types';
|
|
2
|
+
import { type ChartThemeInput } from '../../theme/index.js';
|
|
3
|
+
import type { ChartAnimationInput, TooltipConfig } from '../../types.js';
|
|
4
4
|
export interface CandlestickItem {
|
|
5
5
|
/** 时间标签(交易日、周、月) */
|
|
6
6
|
date: string;
|