rift-ds 1.0.0 → 1.1.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/LICENSE +1 -1
- package/README.md +11 -3
- package/components/AppLayout/AppLayout.css +13 -3
- package/components/AppLayout/AppLayout.d.ts +5 -1
- package/components/AppLayout/AppLayout.js +4 -0
- package/components/AppSidebar/AppSidebar.css +237 -0
- package/components/AppSidebar/AppSidebar.d.ts +32 -3
- package/components/AppSidebar/AppSidebar.js +187 -16
- package/components/BottomNav/BottomNav.css +417 -0
- package/components/BottomNav/BottomNav.d.ts +73 -0
- package/components/BottomNav/BottomNav.js +100 -0
- package/components/Chart/AreaChart.js +67 -56
- package/components/Chart/BarChart.js +67 -56
- package/components/Chart/ComboChart.js +93 -82
- package/components/Chart/LineChart.js +59 -48
- package/components/Chart/PieChart.js +56 -45
- package/components/Chart/RadarChart.js +60 -49
- package/components/Chart/RadialChart.js +70 -59
- package/components/Chart/ScatterChart.js +61 -50
- package/components/Chart/StackedBarChart.js +64 -53
- package/components/Chart/Treemap.js +34 -23
- package/components/Nav/Nav.d.ts +11 -3
- package/components/Nav/Nav.js +3 -2
- package/components/SidebarPanel/SidebarPanel.css +291 -0
- package/components/SidebarPanel/SidebarPanel.d.ts +45 -0
- package/components/SidebarPanel/SidebarPanel.js +166 -0
- package/components/Stepper/Stepper.d.ts +3 -1
- package/components/Stepper/Stepper.js +1 -1
- package/components/TopAppBar/TopAppBar.css +464 -0
- package/components/TopAppBar/TopAppBar.d.ts +80 -0
- package/components/TopAppBar/TopAppBar.js +138 -0
- package/components/registry.json +25 -1
- package/components/registry.json.d.ts +25 -1
- package/components/registry.json.js +1 -1
- package/index.d.ts +3 -0
- package/index.js +6 -0
- package/package.json +5 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, PieChart as PieChart$1, Pie, Cell, Tooltip, Legend } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -33,6 +33,8 @@ const PieChart = ({
|
|
|
33
33
|
bare = false,
|
|
34
34
|
className = ""
|
|
35
35
|
}) => {
|
|
36
|
+
const titleId = useId();
|
|
37
|
+
const subtitleId = useId();
|
|
36
38
|
const baseClass = "ds-chart";
|
|
37
39
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
38
40
|
const defaultColors = getChartSeriesColors();
|
|
@@ -42,51 +44,60 @@ const PieChart = ({
|
|
|
42
44
|
(props) => /* @__PURE__ */ jsx(PieChartTooltip, { ...props }),
|
|
43
45
|
[]
|
|
44
46
|
);
|
|
45
|
-
return /* @__PURE__ */ jsxs(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
outerRadius,
|
|
67
|
-
strokeWidth: 2,
|
|
68
|
-
stroke: "var(--color-bg-container-primary)",
|
|
69
|
-
children: data.map((slice, i) => /* @__PURE__ */ jsx(
|
|
70
|
-
Cell,
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: classes,
|
|
51
|
+
role: "figure",
|
|
52
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
53
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
54
|
+
children: [
|
|
55
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
57
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
58
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
59
|
+
] }),
|
|
60
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
63
|
+
] }, i)) })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(PieChart$1, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Pie,
|
|
71
68
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
data,
|
|
70
|
+
dataKey: "value",
|
|
71
|
+
nameKey: "name",
|
|
72
|
+
cx: "50%",
|
|
73
|
+
cy: "50%",
|
|
74
|
+
innerRadius,
|
|
75
|
+
outerRadius,
|
|
76
|
+
strokeWidth: 2,
|
|
77
|
+
stroke: "var(--color-bg-container-primary)",
|
|
78
|
+
children: data.map((slice, i) => /* @__PURE__ */ jsx(
|
|
79
|
+
Cell,
|
|
80
|
+
{
|
|
81
|
+
fill: slice.color || defaultColors[i % defaultColors.length]
|
|
82
|
+
},
|
|
83
|
+
slice.name
|
|
84
|
+
))
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
|
|
88
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
89
|
+
Legend,
|
|
90
|
+
{
|
|
91
|
+
verticalAlign: "bottom",
|
|
92
|
+
iconType: "circle",
|
|
93
|
+
iconSize: 8,
|
|
94
|
+
formatter: (value) => /* @__PURE__ */ jsx("span", { style: { color: textSecondary, fontSize: 12 }, children: value })
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }) }) })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
90
101
|
};
|
|
91
102
|
export {
|
|
92
103
|
PieChart
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, RadarChart as RadarChart$1, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Tooltip, Radar, Legend } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -28,6 +28,8 @@ const RadarChart = ({
|
|
|
28
28
|
bare = false,
|
|
29
29
|
className = ""
|
|
30
30
|
}) => {
|
|
31
|
+
const titleId = useId();
|
|
32
|
+
const subtitleId = useId();
|
|
31
33
|
const baseClass = "ds-chart";
|
|
32
34
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
33
35
|
const textSecondary = getCSSVar("--color-text-secondary", "#303030");
|
|
@@ -38,54 +40,63 @@ const RadarChart = ({
|
|
|
38
40
|
(props) => /* @__PURE__ */ jsx(RadarTooltip, { ...props }),
|
|
39
41
|
[]
|
|
40
42
|
);
|
|
41
|
-
return /* @__PURE__ */ jsxs(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: classes,
|
|
47
|
+
role: "figure",
|
|
48
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
49
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
50
|
+
children: [
|
|
51
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
53
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
54
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
55
|
+
] }),
|
|
56
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
58
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
59
|
+
] }, i)) })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(RadarChart$1, { data, cx: "50%", cy: "50%", outerRadius: "70%", children: [
|
|
62
|
+
/* @__PURE__ */ jsx(PolarGrid, { stroke: gridColor }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
PolarAngleAxis,
|
|
65
|
+
{
|
|
66
|
+
dataKey: categoryKey,
|
|
67
|
+
tick: { fill: textSecondary, fontSize: 12 }
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
PolarRadiusAxis,
|
|
72
|
+
{
|
|
73
|
+
tick: { fill: textSecondary, fontSize: 10 },
|
|
74
|
+
axisLine: false,
|
|
75
|
+
tickCount: 5
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
|
|
79
|
+
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
80
|
+
Radar,
|
|
81
|
+
{
|
|
82
|
+
name: s.label,
|
|
83
|
+
dataKey: s.dataKey,
|
|
84
|
+
stroke: s.color || seriesColors[i % seriesColors.length],
|
|
85
|
+
fill: s.color || seriesColors[i % seriesColors.length],
|
|
86
|
+
fillOpacity: s.fillOpacity ?? 0.3
|
|
87
|
+
},
|
|
88
|
+
s.dataKey
|
|
89
|
+
)),
|
|
90
|
+
series.length > 1 && /* @__PURE__ */ jsx(
|
|
91
|
+
Legend,
|
|
92
|
+
{
|
|
93
|
+
wrapperStyle: { color: textSecondary, fontSize: 12 }
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) }) })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
89
100
|
};
|
|
90
101
|
export {
|
|
91
102
|
RadarChart
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, RadialBarChart, PolarAngleAxis, RadialBar, Tooltip, Legend } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -36,6 +36,8 @@ const RadialChart = ({
|
|
|
36
36
|
bare = false,
|
|
37
37
|
className = ""
|
|
38
38
|
}) => {
|
|
39
|
+
const titleId = useId();
|
|
40
|
+
const subtitleId = useId();
|
|
39
41
|
const baseClass = "ds-chart";
|
|
40
42
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
41
43
|
const defaultColors = getChartSeriesColors();
|
|
@@ -50,64 +52,73 @@ const RadialChart = ({
|
|
|
50
52
|
(props) => /* @__PURE__ */ jsx(RadialTooltip, { ...props }),
|
|
51
53
|
[]
|
|
52
54
|
);
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: classes,
|
|
59
|
+
role: "figure",
|
|
60
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
61
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
62
|
+
children: [
|
|
63
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
65
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
66
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
67
|
+
] }),
|
|
68
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
69
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
71
|
+
] }, i)) })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__body`, children: [
|
|
74
|
+
/* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
|
|
75
|
+
RadialBarChart,
|
|
76
|
+
{
|
|
77
|
+
cx: "50%",
|
|
78
|
+
cy: "50%",
|
|
79
|
+
innerRadius,
|
|
80
|
+
outerRadius,
|
|
81
|
+
data: chartData,
|
|
82
|
+
startAngle: 90,
|
|
83
|
+
endAngle: -270,
|
|
84
|
+
barSize: 16,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(PolarAngleAxis, { type: "number", domain: [0, maxValue], tick: false }),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
RadialBar,
|
|
89
|
+
{
|
|
90
|
+
background: { fill: bgColor },
|
|
91
|
+
dataKey: "value",
|
|
92
|
+
cornerRadius: 8
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
|
|
96
|
+
showLegend && /* @__PURE__ */ jsx(
|
|
97
|
+
Legend,
|
|
98
|
+
{
|
|
99
|
+
verticalAlign: "bottom",
|
|
100
|
+
iconType: "circle",
|
|
101
|
+
iconSize: 8,
|
|
102
|
+
...{ payload: chartData.map((d) => ({
|
|
103
|
+
value: d.name,
|
|
104
|
+
type: "circle",
|
|
105
|
+
color: d.fill
|
|
106
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
107
|
+
})) },
|
|
108
|
+
formatter: (value) => /* @__PURE__ */ jsx("span", { style: { color: textSecondary, fontSize: 12 }, children: value })
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
) }),
|
|
114
|
+
centerLabel && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__radial-center`, children: [
|
|
115
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__radial-center-value`, children: centerLabel }),
|
|
116
|
+
centerSublabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__radial-center-sub`, children: centerSublabel })
|
|
117
|
+
] })
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
111
122
|
};
|
|
112
123
|
export {
|
|
113
124
|
RadialChart
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useId, useCallback } from "react";
|
|
3
3
|
import { ResponsiveContainer, ScatterChart as ScatterChart$1, CartesianGrid, XAxis, YAxis, ZAxis, Tooltip, Scatter, Legend } from "recharts";
|
|
4
4
|
import { getChartSeriesColors } from "./palette.js";
|
|
5
5
|
import "./Chart.css";
|
|
@@ -34,6 +34,8 @@ const ScatterChart = ({
|
|
|
34
34
|
bare = false,
|
|
35
35
|
className = ""
|
|
36
36
|
}) => {
|
|
37
|
+
const titleId = useId();
|
|
38
|
+
const subtitleId = useId();
|
|
37
39
|
const baseClass = "ds-chart";
|
|
38
40
|
const classes = [baseClass, bare ? `${baseClass}--bare` : "", className].filter(Boolean).join(" ");
|
|
39
41
|
const seriesColors = getChartSeriesColors();
|
|
@@ -44,55 +46,64 @@ const ScatterChart = ({
|
|
|
44
46
|
(props) => /* @__PURE__ */ jsx(ScatterTooltip, { ...props, xLabel, yLabel }),
|
|
45
47
|
[xLabel, yLabel]
|
|
46
48
|
);
|
|
47
|
-
return /* @__PURE__ */ jsxs(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: classes,
|
|
53
|
+
role: "figure",
|
|
54
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
55
|
+
"aria-describedby": subtitle ? subtitleId : void 0,
|
|
56
|
+
children: [
|
|
57
|
+
(title || subtitle || summaryItems) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header-text`, children: [
|
|
59
|
+
title && /* @__PURE__ */ jsx("h3", { id: titleId, className: `${baseClass}__title`, children: title }),
|
|
60
|
+
subtitle && /* @__PURE__ */ jsx("p", { id: subtitleId, className: `${baseClass}__subtitle`, children: subtitle })
|
|
61
|
+
] }),
|
|
62
|
+
summaryItems && summaryItems.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, children: summaryItems.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__summary-item`, children: [
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-label`, children: item.label }),
|
|
64
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__summary-value`, children: typeof item.value === "number" ? item.value.toLocaleString() : item.value })
|
|
65
|
+
] }, i)) })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(ScatterChart$1, { margin: { top: 8, right: 4, bottom: 0, left: -12 }, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(CartesianGrid, { stroke: gridColor }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
XAxis,
|
|
71
|
+
{
|
|
72
|
+
type: "number",
|
|
73
|
+
dataKey: xKey,
|
|
74
|
+
name: xLabel,
|
|
75
|
+
tick: { fill: textSecondary, fontSize: 12 },
|
|
76
|
+
tickLine: false,
|
|
77
|
+
axisLine: { stroke: gridColor }
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
YAxis,
|
|
82
|
+
{
|
|
83
|
+
type: "number",
|
|
84
|
+
dataKey: yKey,
|
|
85
|
+
name: yLabel,
|
|
86
|
+
tick: { fill: textSecondary, fontSize: 12 },
|
|
87
|
+
tickLine: false,
|
|
88
|
+
axisLine: false
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(ZAxis, { range: [48, 48] }),
|
|
92
|
+
/* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
|
|
93
|
+
datasets.map((ds, i) => /* @__PURE__ */ jsx(
|
|
94
|
+
Scatter,
|
|
95
|
+
{
|
|
96
|
+
name: ds.name,
|
|
97
|
+
data: ds.data,
|
|
98
|
+
fill: ds.color || seriesColors[i % seriesColors.length]
|
|
99
|
+
},
|
|
100
|
+
ds.name
|
|
101
|
+
)),
|
|
102
|
+
datasets.length > 1 && /* @__PURE__ */ jsx(Legend, { wrapperStyle: { color: textSecondary, fontSize: 12 } })
|
|
103
|
+
] }) }) })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
);
|
|
96
107
|
};
|
|
97
108
|
export {
|
|
98
109
|
ScatterChart
|