@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,30 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
// src/charts/sankey-chart/index.tsx
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { classNames, prefixCls } from "@aura-react-comp/shared";
|
|
3
5
|
import { SvgScene } from "../../scene/svg";
|
|
4
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
formatNumber,
|
|
8
|
+
formatPercent,
|
|
9
|
+
estimateTextWidth
|
|
10
|
+
} from "../../core/format";
|
|
5
11
|
import { withAlpha } from "../../theme";
|
|
6
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
layoutSankey
|
|
14
|
+
} from "../../core/sankey";
|
|
7
15
|
import { useChartTheme } from "../../hooks/useChartTheme";
|
|
8
16
|
import { useElementSize } from "../../hooks/useElementSize";
|
|
9
17
|
import { useChartTransition } from "../../hooks/useChartTransition";
|
|
10
18
|
import { resolveAnimation, staggerProgress } from "../../core/animation";
|
|
11
19
|
import { Tooltip } from "../../components/Tooltip";
|
|
12
|
-
import { jsx
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 桑基图。
|
|
16
|
-
*
|
|
17
|
-
* 用带宽编码流量,用节点位置编码阶段,一眼能看出「东西从哪来、到哪去、路上漏了多少」。
|
|
18
|
-
*
|
|
19
|
-
* 与漏斗图的区别:漏斗只能表达单链路层层递减,桑基能表达分流与合流。
|
|
20
|
-
*/
|
|
21
|
-
export function SankeyChart({
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
function SankeyChart({
|
|
22
22
|
nodes: nodesProp,
|
|
23
23
|
links = [],
|
|
24
24
|
nodeWidth = 12,
|
|
25
25
|
nodeGap = 10,
|
|
26
26
|
showValue = true,
|
|
27
|
-
width =
|
|
27
|
+
width = "100%",
|
|
28
28
|
height = 360,
|
|
29
29
|
theme: themeInput,
|
|
30
30
|
palette,
|
|
@@ -33,79 +33,94 @@ export function SankeyChart({
|
|
|
33
33
|
className,
|
|
34
34
|
style,
|
|
35
35
|
ariaLabel,
|
|
36
|
-
emptyText =
|
|
36
|
+
emptyText = "暂无数据"
|
|
37
37
|
}) {
|
|
38
38
|
const theme = useChartTheme(themeInput, palette);
|
|
39
|
-
const {
|
|
40
|
-
ref,
|
|
41
|
-
size
|
|
42
|
-
} = useElementSize();
|
|
39
|
+
const { ref, size } = useElementSize();
|
|
43
40
|
const [activeLink, setActiveLink] = useState(null);
|
|
44
41
|
const [activeNode, setActiveNode] = useState(null);
|
|
45
|
-
const animKey = typeof animation ===
|
|
46
|
-
const animConfig = useMemo(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const animKey = typeof animation === "object" ? JSON.stringify(animation) : String(animation);
|
|
43
|
+
const animConfig = useMemo(
|
|
44
|
+
() => resolveAnimation(animation),
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
[animKey]
|
|
47
|
+
);
|
|
51
48
|
const nodes = useMemo(() => {
|
|
52
|
-
if (nodesProp
|
|
53
|
-
|
|
49
|
+
if (nodesProp == null ? void 0 : nodesProp.length)
|
|
50
|
+
return nodesProp;
|
|
51
|
+
const seen = /* @__PURE__ */ new Set();
|
|
54
52
|
const derived = [];
|
|
55
53
|
for (const link of links) {
|
|
56
54
|
if (!seen.has(link.source)) {
|
|
57
55
|
seen.add(link.source);
|
|
58
|
-
derived.push({
|
|
59
|
-
name: link.source
|
|
60
|
-
});
|
|
56
|
+
derived.push({ name: link.source });
|
|
61
57
|
}
|
|
62
58
|
if (!seen.has(link.target)) {
|
|
63
59
|
seen.add(link.target);
|
|
64
|
-
derived.push({
|
|
65
|
-
name: link.target
|
|
66
|
-
});
|
|
60
|
+
derived.push({ name: link.target });
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
return derived;
|
|
70
64
|
}, [nodesProp, links]);
|
|
71
|
-
const total = useMemo(
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
const total = useMemo(
|
|
66
|
+
() => links.reduce((sum, link) => sum + (link.value || 0), 0) || 1,
|
|
67
|
+
[links]
|
|
68
|
+
);
|
|
74
69
|
const labelSpace = 92;
|
|
75
|
-
const layout = useMemo(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
const layout = useMemo(
|
|
71
|
+
() => layoutSankey(
|
|
72
|
+
nodes,
|
|
73
|
+
links,
|
|
74
|
+
{
|
|
75
|
+
x: labelSpace,
|
|
76
|
+
y: 12,
|
|
77
|
+
width: Math.max(0, size.width - labelSpace * 2),
|
|
78
|
+
height: Math.max(0, size.height - 24)
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
nodeWidth,
|
|
82
|
+
nodeGap,
|
|
83
|
+
colorOf: (layer, index) => theme.palette[(layer * 2 + index) % theme.palette.length]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
[nodes, links, size.width, size.height, nodeWidth, nodeGap, theme.palette]
|
|
87
|
+
);
|
|
88
|
+
const valueMatrix = useMemo(
|
|
89
|
+
() => [layout.links.map((link) => Math.round(link.value))],
|
|
90
|
+
[layout.links]
|
|
91
|
+
);
|
|
86
92
|
const progress = useChartTransition(valueMatrix, animConfig).progress;
|
|
87
93
|
const scene = useMemo(() => {
|
|
88
|
-
if (!layout.nodes.length || size.width <= 0)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// 链接先画,节点压在上面
|
|
94
|
+
if (!layout.nodes.length || size.width <= 0)
|
|
95
|
+
return [];
|
|
96
|
+
const nodes2 = [];
|
|
92
97
|
layout.links.forEach((link, index) => {
|
|
93
|
-
const local = staggerProgress(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
const local = staggerProgress(
|
|
99
|
+
progress,
|
|
100
|
+
link.source.layer,
|
|
101
|
+
layout.layers,
|
|
102
|
+
animConfig.stagger
|
|
103
|
+
);
|
|
104
|
+
const isActive = (activeLink == null ? void 0 : activeLink.source.name) === link.source.name && (activeLink == null ? void 0 : activeLink.target.name) === link.target.name && activeLink.value === link.value;
|
|
105
|
+
nodes2.push({
|
|
106
|
+
kind: "path",
|
|
97
107
|
key: `link-${index}`,
|
|
98
108
|
d: link.d,
|
|
99
109
|
fill: withAlpha(link.color, isActive ? 0.55 : 0.26),
|
|
100
110
|
opacity: local,
|
|
101
|
-
pointerEvents:
|
|
111
|
+
pointerEvents: "none"
|
|
102
112
|
});
|
|
103
113
|
});
|
|
104
114
|
layout.nodes.forEach((node, index) => {
|
|
105
|
-
const local = staggerProgress(
|
|
115
|
+
const local = staggerProgress(
|
|
116
|
+
progress,
|
|
117
|
+
node.layer,
|
|
118
|
+
layout.layers,
|
|
119
|
+
animConfig.stagger
|
|
120
|
+
);
|
|
106
121
|
const isActive = activeNode === node.name;
|
|
107
|
-
|
|
108
|
-
kind:
|
|
122
|
+
nodes2.push({
|
|
123
|
+
kind: "rect",
|
|
109
124
|
key: `node-${node.name}`,
|
|
110
125
|
x: node.x,
|
|
111
126
|
y: node.y,
|
|
@@ -113,32 +128,28 @@ export function SankeyChart({
|
|
|
113
128
|
height: Math.max(2, node.height * local),
|
|
114
129
|
radius: 2,
|
|
115
130
|
fill: node.color,
|
|
116
|
-
stroke: isActive ? theme.text.primary :
|
|
131
|
+
stroke: isActive ? theme.text.primary : void 0,
|
|
117
132
|
strokeWidth: isActive ? 2 : 0,
|
|
118
|
-
pointerEvents:
|
|
133
|
+
pointerEvents: "none"
|
|
119
134
|
});
|
|
120
|
-
|
|
121
|
-
// 首尾两列标签放节点外侧,中间列放内侧;内侧会被色带压住,
|
|
122
|
-
// 所以文字统一带白色光晕
|
|
123
135
|
const isLastLayer = node.layer === layout.layers - 1;
|
|
124
136
|
const onLeft = node.layer === 0 || isLastLayer;
|
|
125
137
|
const labelX = onLeft ? node.x - 8 : node.x + node.width + 8;
|
|
126
138
|
const maxLabelWidth = onLeft ? labelX - 4 : size.width - labelX - 4;
|
|
127
|
-
if (maxLabelWidth < 24)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
})}` : node.name;
|
|
139
|
+
if (maxLabelWidth < 24)
|
|
140
|
+
return;
|
|
141
|
+
const label = showValue && node.layer === layout.layers - 1 ? `${node.name} ${formatNumber(node.value, { compact: true })}` : node.name;
|
|
131
142
|
const text = estimateTextWidth(label, theme.font.size) > maxLabelWidth ? `${label.slice(0, Math.max(2, Math.floor(maxLabelWidth / theme.font.size)))}…` : label;
|
|
132
|
-
|
|
133
|
-
kind:
|
|
143
|
+
nodes2.push({
|
|
144
|
+
kind: "text",
|
|
134
145
|
key: `node-label-${node.name}-${index}`,
|
|
135
146
|
x: labelX,
|
|
136
147
|
y: node.y + node.height / 2,
|
|
137
148
|
text,
|
|
138
149
|
fill: isActive ? theme.text.primary : theme.text.secondary,
|
|
139
150
|
fontSize: theme.font.size,
|
|
140
|
-
anchor: onLeft ?
|
|
141
|
-
baseline:
|
|
151
|
+
anchor: onLeft ? "end" : "start",
|
|
152
|
+
baseline: "middle",
|
|
142
153
|
opacity: local,
|
|
143
154
|
fontFamily: theme.font.family,
|
|
144
155
|
// 光晕:文字压在色带上也读得清
|
|
@@ -146,16 +157,24 @@ export function SankeyChart({
|
|
|
146
157
|
strokeWidth: 3
|
|
147
158
|
});
|
|
148
159
|
});
|
|
149
|
-
return
|
|
150
|
-
}, [
|
|
160
|
+
return nodes2;
|
|
161
|
+
}, [
|
|
162
|
+
layout,
|
|
163
|
+
size.width,
|
|
164
|
+
theme,
|
|
165
|
+
progress,
|
|
166
|
+
animConfig.stagger,
|
|
167
|
+
activeLink,
|
|
168
|
+
activeNode,
|
|
169
|
+
showValue
|
|
170
|
+
]);
|
|
151
171
|
const linkFromPointer = (clientX, clientY) => {
|
|
152
172
|
const element = ref.current;
|
|
153
|
-
if (!element)
|
|
173
|
+
if (!element)
|
|
174
|
+
return null;
|
|
154
175
|
const rect = element.getBoundingClientRect();
|
|
155
176
|
const x = clientX - rect.left;
|
|
156
177
|
const y = clientY - rect.top;
|
|
157
|
-
|
|
158
|
-
// 节点优先
|
|
159
178
|
for (const node of layout.nodes) {
|
|
160
179
|
if (x >= node.x - 2 && x <= node.x + node.width + 2 && y >= node.y && y <= node.y + node.height) {
|
|
161
180
|
setActiveNode(node.name);
|
|
@@ -163,85 +182,97 @@ export function SankeyChart({
|
|
|
163
182
|
}
|
|
164
183
|
}
|
|
165
184
|
setActiveNode(null);
|
|
166
|
-
|
|
167
|
-
// 链接:按 x 在两端之间做线性插值,得到该处的带状区间
|
|
168
185
|
for (const link of layout.links) {
|
|
169
186
|
const x0 = link.source.x + link.source.width;
|
|
170
187
|
const x1 = link.target.x;
|
|
171
|
-
if (x < x0 || x > x1 || x1 <= x0)
|
|
188
|
+
if (x < x0 || x > x1 || x1 <= x0)
|
|
189
|
+
continue;
|
|
172
190
|
const ratio = (x - x0) / (x1 - x0);
|
|
173
191
|
const top = link.sourceY + (link.targetY - link.sourceY) * ratio;
|
|
174
192
|
const thickness = link.sourceThickness + (link.targetThickness - link.sourceThickness) * ratio;
|
|
175
|
-
if (y >= top && y <= top + thickness)
|
|
193
|
+
if (y >= top && y <= top + thickness)
|
|
194
|
+
return link;
|
|
176
195
|
}
|
|
177
196
|
return null;
|
|
178
197
|
};
|
|
179
198
|
const tooltipPayload = activeLink ? {
|
|
180
199
|
label: `${activeLink.source.name} → ${activeLink.target.name}`,
|
|
181
200
|
row: null,
|
|
182
|
-
series: [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
compact: true
|
|
189
|
-
}
|
|
190
|
-
|
|
201
|
+
series: [
|
|
202
|
+
{
|
|
203
|
+
key: "value",
|
|
204
|
+
name: "流量",
|
|
205
|
+
color: activeLink.color,
|
|
206
|
+
value: activeLink.value,
|
|
207
|
+
formatted: `${formatNumber(activeLink.value, { compact: true })}(${formatPercent(activeLink.value, total, 1)})`
|
|
208
|
+
}
|
|
209
|
+
]
|
|
191
210
|
} : activeNode ? (() => {
|
|
192
|
-
const node = layout.nodes.find(item => item.name === activeNode);
|
|
193
|
-
if (!node)
|
|
211
|
+
const node = layout.nodes.find((item) => item.name === activeNode);
|
|
212
|
+
if (!node)
|
|
213
|
+
return null;
|
|
194
214
|
return {
|
|
195
215
|
label: node.name,
|
|
196
216
|
row: null,
|
|
197
|
-
series: [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
compact: true
|
|
204
|
-
}
|
|
205
|
-
|
|
217
|
+
series: [
|
|
218
|
+
{
|
|
219
|
+
key: "value",
|
|
220
|
+
name: "流量",
|
|
221
|
+
color: node.color,
|
|
222
|
+
value: node.value,
|
|
223
|
+
formatted: formatNumber(node.value, { compact: true })
|
|
224
|
+
}
|
|
225
|
+
]
|
|
206
226
|
};
|
|
207
227
|
})() : null;
|
|
208
228
|
const autoAriaLabel = ariaLabel ?? `桑基图:${layout.nodes.length} 个节点,${layout.links.length} 条流向`;
|
|
209
|
-
return
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
height,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
229
|
+
return /* @__PURE__ */ jsx(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
className: classNames(prefixCls("chart"), className),
|
|
233
|
+
style: { width, height, ...style },
|
|
234
|
+
"data-aura-chart": "sankey",
|
|
235
|
+
children: /* @__PURE__ */ jsxs(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
className: prefixCls("chart__plot"),
|
|
240
|
+
onPointerMove: (event) => {
|
|
241
|
+
const link = linkFromPointer(event.clientX, event.clientY);
|
|
242
|
+
setActiveLink(link);
|
|
243
|
+
},
|
|
244
|
+
onPointerLeave: () => {
|
|
245
|
+
setActiveLink(null);
|
|
246
|
+
setActiveNode(null);
|
|
247
|
+
},
|
|
248
|
+
children: [
|
|
249
|
+
!layout.nodes.length || size.width === 0 ? /* @__PURE__ */ jsx("div", { className: prefixCls("chart__empty"), children: emptyText }) : /* @__PURE__ */ jsx(
|
|
250
|
+
SvgScene,
|
|
251
|
+
{
|
|
252
|
+
nodes: scene,
|
|
253
|
+
width: size.width,
|
|
254
|
+
height: size.height,
|
|
255
|
+
ariaLabel: autoAriaLabel
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ jsx(
|
|
259
|
+
Tooltip,
|
|
260
|
+
{
|
|
261
|
+
payload: tooltipPayload,
|
|
262
|
+
x: activeLink ? (activeLink.source.x + activeLink.target.x) / 2 : size.width / 2,
|
|
263
|
+
y: 12,
|
|
264
|
+
containerWidth: size.width,
|
|
265
|
+
containerHeight: size.height,
|
|
266
|
+
theme,
|
|
267
|
+
config: tooltip
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
export {
|
|
277
|
+
SankeyChart
|
|
278
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ChartDataRow, SeriesConfig } from '../../types';
|
|
3
|
-
import { type ChartThemeInput } from '../../theme';
|
|
4
|
-
import type { LegendConfig, TooltipConfig } from '../../types';
|
|
2
|
+
import type { ChartDataRow, SeriesConfig } from '../../types.js';
|
|
3
|
+
import { type ChartThemeInput } from '../../theme/index.js';
|
|
4
|
+
import type { LegendConfig, TooltipConfig } from '../../types.js';
|
|
5
5
|
export interface ScatterChartProps {
|
|
6
6
|
data?: ChartDataRow[];
|
|
7
7
|
/** 数值型 x 字段 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAO9E,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAO9E,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAQ5D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,6BAA6B,CAAC;AAErC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,YAAY,EAAE,CAAC;IACtB,eAAe;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAClC,UAAU;IACV,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IACzE,UAAU;IACV,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAS,EACT,IAAU,EACV,MAAW,EACX,KAAc,EACd,MAAY,EACZ,KAAK,EAAE,UAAU,EACjB,OAAO,EACP,MAAa,EACb,OAAc,EACd,MAAiB,EACjB,UAAc,EACd,SAAgB,EAChB,SAAS,EACT,KAAK,EACL,SAAS,EACT,SAAkB,GACnB,EAAE,iBAAiB,qBA8WnB"}
|