@hitachivantara/uikit-react-viz 6.1.6 → 6.1.8
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 +201 -0
- package/dist/BarChart/BarChart.js +86 -112
- package/dist/BaseChart/BaseChart.js +53 -51
- package/dist/Boxplot/Boxplot.js +68 -83
- package/dist/Boxplot/Boxplot.styles.js +22 -23
- package/dist/Boxplot/useBoxplot.js +56 -70
- package/dist/Boxplot/useBoxplotData.js +34 -37
- package/dist/ConfusionMatrix/ConfusionMatrix.js +151 -150
- package/dist/ConfusionMatrix/ConfusionMatrix.styles.js +23 -27
- package/dist/ConfusionMatrix/utils.js +105 -138
- package/dist/DonutChart/DonutChart.js +67 -85
- package/dist/Heatmap/Heatmap.js +81 -97
- package/dist/Heatmap/Heatmap.styles.js +22 -23
- package/dist/LineChart/LineChart.js +84 -110
- package/dist/ScatterPlot/ScatterPlot.js +80 -102
- package/dist/Treemap/Treemap.js +36 -50
- package/dist/hooks/tooltip/styles.js +76 -77
- package/dist/hooks/tooltip/useTooltip.js +66 -89
- package/dist/hooks/useData.js +122 -162
- package/dist/hooks/useDataZoom.js +17 -25
- package/dist/hooks/useDataset.js +10 -14
- package/dist/hooks/useGrid.js +21 -37
- package/dist/hooks/useLegend.js +35 -44
- package/dist/hooks/useOption.js +12 -18
- package/dist/hooks/useSeries.js +84 -117
- package/dist/hooks/useVisualMap.js +38 -55
- package/dist/hooks/useXAxis.js +42 -61
- package/dist/hooks/useYAxis.js +31 -55
- package/dist/index.js +2 -16
- package/dist/providers/Provider.js +41 -21
- package/dist/utils/index.js +120 -186
- package/dist/utils/registerTheme.js +84 -122
- package/package.json +23 -11
|
@@ -1,93 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { PieChart } from "echarts/charts";
|
|
4
|
-
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from "echarts/components";
|
|
5
|
-
import * as echarts from "echarts/core";
|
|
1
|
+
import { HvBaseChart } from "../BaseChart/BaseChart.js";
|
|
2
|
+
import { useGrid } from "../hooks/useGrid.js";
|
|
6
3
|
import { useData } from "../hooks/useData.js";
|
|
7
4
|
import { useDataset } from "../hooks/useDataset.js";
|
|
8
5
|
import { useSeries } from "../hooks/useSeries.js";
|
|
9
6
|
import { useLegend } from "../hooks/useLegend.js";
|
|
10
7
|
import { useTooltip } from "../hooks/tooltip/useTooltip.js";
|
|
11
|
-
import { useGrid } from "../hooks/useGrid.js";
|
|
12
8
|
import { useOption } from "../hooks/useOption.js";
|
|
13
|
-
import {
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { DatasetComponent, GridComponent, LegendComponent, TooltipComponent } from "echarts/components";
|
|
11
|
+
import * as echarts from "echarts/core";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
import { PieChart } from "echarts/charts";
|
|
14
|
+
//#region src/DonutChart/DonutChart.tsx
|
|
14
15
|
echarts.use([
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
PieChart,
|
|
17
|
+
DatasetComponent,
|
|
18
|
+
GridComponent,
|
|
19
|
+
TooltipComponent,
|
|
20
|
+
LegendComponent
|
|
20
21
|
]);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
...chartGrid
|
|
76
|
-
},
|
|
77
|
-
onOptionChange
|
|
78
|
-
});
|
|
79
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
-
HvBaseChart,
|
|
81
|
-
{
|
|
82
|
-
ref,
|
|
83
|
-
option,
|
|
84
|
-
width,
|
|
85
|
-
height,
|
|
86
|
-
...others
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
export {
|
|
92
|
-
HvDonutChart
|
|
93
|
-
};
|
|
22
|
+
/**
|
|
23
|
+
* Donut charts nicely convey the part-whole relationship and they have become
|
|
24
|
+
* the most recognizable chart types for representing proportions in business and data statistics.
|
|
25
|
+
*/
|
|
26
|
+
var HvDonutChart = forwardRef(function HvDonutChart(props, ref) {
|
|
27
|
+
const { data, groupBy, classes, legend, tooltip, measure: measures, sortBy, filters, grid, width, height, type = "regular", slicesNameFormatter, onOptionChange, ...others } = props;
|
|
28
|
+
const { data: chartData, mapping: measuresMapping } = useData({
|
|
29
|
+
data,
|
|
30
|
+
groupBy,
|
|
31
|
+
measures,
|
|
32
|
+
sortBy,
|
|
33
|
+
filters
|
|
34
|
+
});
|
|
35
|
+
const chartDataset = useDataset(chartData);
|
|
36
|
+
const chartSeries = useSeries({
|
|
37
|
+
type: "pie",
|
|
38
|
+
data: chartData,
|
|
39
|
+
groupBy,
|
|
40
|
+
measuresMapping,
|
|
41
|
+
radius: type === "thin" ? ["65%", "70%"] : ["55%", "70%"]
|
|
42
|
+
});
|
|
43
|
+
const chartLegend = useLegend({
|
|
44
|
+
...legend,
|
|
45
|
+
show: legend?.show ?? true,
|
|
46
|
+
icon: "square",
|
|
47
|
+
series: chartSeries.series,
|
|
48
|
+
formatter: slicesNameFormatter
|
|
49
|
+
});
|
|
50
|
+
const chartTooltip = useTooltip({
|
|
51
|
+
...tooltip,
|
|
52
|
+
measuresMapping,
|
|
53
|
+
classes,
|
|
54
|
+
nameFormatter: slicesNameFormatter
|
|
55
|
+
});
|
|
56
|
+
const chartGrid = useGrid({ ...grid });
|
|
57
|
+
return /* @__PURE__ */ jsx(HvBaseChart, {
|
|
58
|
+
ref,
|
|
59
|
+
option: useOption({
|
|
60
|
+
option: {
|
|
61
|
+
...chartSeries,
|
|
62
|
+
...chartDataset,
|
|
63
|
+
...chartLegend,
|
|
64
|
+
...chartTooltip,
|
|
65
|
+
...chartGrid
|
|
66
|
+
},
|
|
67
|
+
onOptionChange
|
|
68
|
+
}),
|
|
69
|
+
width,
|
|
70
|
+
height,
|
|
71
|
+
...others
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { HvDonutChart };
|
package/dist/Heatmap/Heatmap.js
CHANGED
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { HeatmapChart } from "echarts/charts";
|
|
4
|
-
import { TooltipComponent, VisualMapComponent } from "echarts/components";
|
|
5
|
-
import * as echarts from "echarts/core";
|
|
6
|
-
import { useTheme } from "@hitachivantara/uikit-react-utils";
|
|
7
|
-
import { useClasses } from "./Heatmap.styles.js";
|
|
8
|
-
import { useTooltip } from "../hooks/tooltip/useTooltip.js";
|
|
1
|
+
import { HvBaseChart } from "../BaseChart/BaseChart.js";
|
|
9
2
|
import { useXAxis } from "../hooks/useXAxis.js";
|
|
10
3
|
import { useYAxis } from "../hooks/useYAxis.js";
|
|
11
4
|
import { useVisualMap } from "../hooks/useVisualMap.js";
|
|
5
|
+
import { useTooltip } from "../hooks/tooltip/useTooltip.js";
|
|
12
6
|
import { useOption } from "../hooks/useOption.js";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return `
|
|
7
|
+
import { useClasses } from "./Heatmap.styles.js";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { TooltipComponent, VisualMapComponent } from "echarts/components";
|
|
10
|
+
import * as echarts from "echarts/core";
|
|
11
|
+
import { useTheme } from "@hitachivantara/uikit-react-utils";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
import { HeatmapChart } from "echarts/charts";
|
|
14
|
+
//#region src/Heatmap/Heatmap.tsx
|
|
15
|
+
echarts.use([
|
|
16
|
+
HeatmapChart,
|
|
17
|
+
TooltipComponent,
|
|
18
|
+
VisualMapComponent
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* A Heatmap uses color gradients to represent data intensity across a surface.
|
|
22
|
+
*/
|
|
23
|
+
var HvHeatmap = forwardRef(function HvHeatmap(props, ref) {
|
|
24
|
+
const { name, data, min, max, colorScale, xAxis, yAxis, classes: classesProp, tooltip, width, height, onOptionChange, ...others } = props;
|
|
25
|
+
const { classes } = useClasses(classesProp);
|
|
26
|
+
const { colors } = useTheme();
|
|
27
|
+
const chartTooltip = useTooltip({
|
|
28
|
+
component: (params) => {
|
|
29
|
+
const value = params?.value;
|
|
30
|
+
const title = params?.title;
|
|
31
|
+
const valueToShow = value ? `${yAxis?.data?.[Number(value[1])]} - ${xAxis?.data?.[Number(value[0])]}: ${params?.series?.[0]?.name}` : "-";
|
|
32
|
+
return `
|
|
40
33
|
<div class="${classes.tooltipRoot}">
|
|
41
34
|
<div class="${classes.tooltipContainer}">
|
|
42
35
|
<div>
|
|
@@ -45,65 +38,56 @@ const HvHeatmap = forwardRef(
|
|
|
45
38
|
</div>
|
|
46
39
|
</div>
|
|
47
40
|
</div>`;
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
height,
|
|
102
|
-
...others
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
export {
|
|
108
|
-
HvHeatmap
|
|
109
|
-
};
|
|
41
|
+
},
|
|
42
|
+
...tooltip
|
|
43
|
+
});
|
|
44
|
+
const chartXAxis = useXAxis({
|
|
45
|
+
type: "categorical",
|
|
46
|
+
...xAxis
|
|
47
|
+
});
|
|
48
|
+
const chartYAxis = useYAxis({
|
|
49
|
+
defaultType: "categorical",
|
|
50
|
+
axes: yAxis ? [yAxis] : []
|
|
51
|
+
});
|
|
52
|
+
const convertedColors = colorScale?.map((color) => colors?.[color] || color);
|
|
53
|
+
const chartVisualMap = useVisualMap({
|
|
54
|
+
min,
|
|
55
|
+
max,
|
|
56
|
+
orient: "horizontal",
|
|
57
|
+
left: "center",
|
|
58
|
+
calculable: true,
|
|
59
|
+
position: { y: "bottom" },
|
|
60
|
+
colorScale: convertedColors || [
|
|
61
|
+
"#2D4B87",
|
|
62
|
+
"#95AFE8",
|
|
63
|
+
"#E7EDF9"
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx(HvBaseChart, {
|
|
67
|
+
ref,
|
|
68
|
+
option: useOption({
|
|
69
|
+
option: {
|
|
70
|
+
xAxis: chartXAxis.xAxis,
|
|
71
|
+
yAxis: chartYAxis.yAxis,
|
|
72
|
+
visualMap: chartVisualMap.visualMap,
|
|
73
|
+
series: [{
|
|
74
|
+
name,
|
|
75
|
+
type: "heatmap",
|
|
76
|
+
data,
|
|
77
|
+
label: { show: true },
|
|
78
|
+
emphasis: { itemStyle: {
|
|
79
|
+
shadowBlur: 10,
|
|
80
|
+
shadowColor: "rgba(0, 0, 0, 0.5)"
|
|
81
|
+
} }
|
|
82
|
+
}],
|
|
83
|
+
...chartTooltip
|
|
84
|
+
},
|
|
85
|
+
onOptionChange
|
|
86
|
+
}),
|
|
87
|
+
width,
|
|
88
|
+
height,
|
|
89
|
+
...others
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
export { HvHeatmap };
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { createClasses } from "@hitachivantara/uikit-react-utils";
|
|
2
2
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
//#region src/Heatmap/Heatmap.styles.tsx
|
|
4
|
+
var { useClasses, staticClasses } = createClasses("HvHeatmap", {
|
|
5
|
+
tooltipRoot: {
|
|
6
|
+
backgroundColor: theme.colors.bgContainer,
|
|
7
|
+
width: "fit-content",
|
|
8
|
+
minWidth: 150,
|
|
9
|
+
boxShadow: theme.colors.shadow,
|
|
10
|
+
zIndex: theme.zIndices.sticky
|
|
11
|
+
},
|
|
12
|
+
tooltipContainer: {
|
|
13
|
+
padding: theme.spacing("15px", "sm"),
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "column"
|
|
16
|
+
},
|
|
17
|
+
tooltipText: {
|
|
18
|
+
fontFamily: theme.fontFamily.body,
|
|
19
|
+
fontWeight: theme.fontWeights.normal,
|
|
20
|
+
fontSize: theme.fontSizes.sm,
|
|
21
|
+
color: theme.colors.text
|
|
22
|
+
}
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
useClasses
|
|
26
|
-
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useClasses };
|
|
@@ -1,118 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { LineChart } from "echarts/charts";
|
|
4
|
-
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent, DataZoomSliderComponent, DataZoomInsideComponent, MarkLineComponent } from "echarts/components";
|
|
5
|
-
import * as echarts from "echarts/core";
|
|
6
|
-
import { useData } from "../hooks/useData.js";
|
|
7
|
-
import { useDataset } from "../hooks/useDataset.js";
|
|
8
|
-
import { useYAxis } from "../hooks/useYAxis.js";
|
|
9
|
-
import { useXAxis } from "../hooks/useXAxis.js";
|
|
1
|
+
import { HvBaseChart } from "../BaseChart/BaseChart.js";
|
|
10
2
|
import { useDataZoom } from "../hooks/useDataZoom.js";
|
|
3
|
+
import { useXAxis } from "../hooks/useXAxis.js";
|
|
4
|
+
import { useYAxis } from "../hooks/useYAxis.js";
|
|
11
5
|
import { useGrid } from "../hooks/useGrid.js";
|
|
6
|
+
import { useData } from "../hooks/useData.js";
|
|
7
|
+
import { useDataset } from "../hooks/useDataset.js";
|
|
12
8
|
import { useSeries } from "../hooks/useSeries.js";
|
|
13
9
|
import { useLegend } from "../hooks/useLegend.js";
|
|
14
10
|
import { useTooltip } from "../hooks/tooltip/useTooltip.js";
|
|
15
11
|
import { useOption } from "../hooks/useOption.js";
|
|
16
|
-
import {
|
|
12
|
+
import { forwardRef } from "react";
|
|
13
|
+
import { DataZoomInsideComponent, DataZoomSliderComponent, DatasetComponent, GridComponent, LegendComponent, MarkLineComponent, TooltipComponent } from "echarts/components";
|
|
14
|
+
import * as echarts from "echarts/core";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
import { LineChart } from "echarts/charts";
|
|
17
|
+
//#region src/LineChart/LineChart.tsx
|
|
17
18
|
echarts.use([
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
LineChart,
|
|
20
|
+
DatasetComponent,
|
|
21
|
+
GridComponent,
|
|
22
|
+
TooltipComponent,
|
|
23
|
+
LegendComponent,
|
|
24
|
+
DataZoomSliderComponent,
|
|
25
|
+
DataZoomInsideComponent,
|
|
26
|
+
MarkLineComponent
|
|
26
27
|
]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
option: {
|
|
93
|
-
...chartYAxis,
|
|
94
|
-
...chartXAxis,
|
|
95
|
-
...chartSlider,
|
|
96
|
-
...chartGrid,
|
|
97
|
-
...chartDataset,
|
|
98
|
-
...chartSeries,
|
|
99
|
-
...chartLegend,
|
|
100
|
-
...chartTooltip
|
|
101
|
-
},
|
|
102
|
-
onOptionChange
|
|
103
|
-
});
|
|
104
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
-
HvBaseChart,
|
|
106
|
-
{
|
|
107
|
-
ref,
|
|
108
|
-
option,
|
|
109
|
-
width,
|
|
110
|
-
height,
|
|
111
|
-
...others
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
export {
|
|
117
|
-
HvLineChart
|
|
118
|
-
};
|
|
28
|
+
/**
|
|
29
|
+
* A line chart or line plot or line graph is a type of chart which displays information as a series of data points
|
|
30
|
+
* connected by straight line segments.
|
|
31
|
+
*/
|
|
32
|
+
var HvLineChart = forwardRef(function HvLineChart(props, ref) {
|
|
33
|
+
const { area = false, emptyCellMode = "void", areaOpacity = .5, yAxis, xAxis, horizontalRangeSlider, grid, data, groupBy, splitBy, sortBy, filters, measures, stack, seriesNameFormatter, legend, classes, tooltip, width, height, onOptionChange, ...others } = props;
|
|
34
|
+
const { data: chartData, mapping: measuresMapping } = useData({
|
|
35
|
+
data,
|
|
36
|
+
groupBy,
|
|
37
|
+
measures,
|
|
38
|
+
splitBy,
|
|
39
|
+
sortBy,
|
|
40
|
+
filters
|
|
41
|
+
});
|
|
42
|
+
const chartDataset = useDataset(chartData);
|
|
43
|
+
const chartYAxis = useYAxis({ axes: Array.isArray(yAxis) || yAxis == null ? yAxis : [yAxis] });
|
|
44
|
+
const chartXAxis = useXAxis({
|
|
45
|
+
...xAxis,
|
|
46
|
+
scale: true
|
|
47
|
+
});
|
|
48
|
+
const chartSlider = useDataZoom({ showHorizontal: horizontalRangeSlider?.show });
|
|
49
|
+
const chartGrid = useGrid({ ...grid });
|
|
50
|
+
const chartSeries = useSeries({
|
|
51
|
+
type: "line",
|
|
52
|
+
data: chartData,
|
|
53
|
+
groupBy,
|
|
54
|
+
measuresMapping,
|
|
55
|
+
area,
|
|
56
|
+
areaOpacity,
|
|
57
|
+
emptyCellMode,
|
|
58
|
+
stack,
|
|
59
|
+
nameFormatter: seriesNameFormatter
|
|
60
|
+
});
|
|
61
|
+
const chartLegend = useLegend({
|
|
62
|
+
...legend,
|
|
63
|
+
series: chartSeries.series
|
|
64
|
+
});
|
|
65
|
+
const chartTooltip = useTooltip({
|
|
66
|
+
...tooltip,
|
|
67
|
+
trigger: "axis",
|
|
68
|
+
measuresMapping,
|
|
69
|
+
classes
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ jsx(HvBaseChart, {
|
|
72
|
+
ref,
|
|
73
|
+
option: useOption({
|
|
74
|
+
option: {
|
|
75
|
+
...chartYAxis,
|
|
76
|
+
...chartXAxis,
|
|
77
|
+
...chartSlider,
|
|
78
|
+
...chartGrid,
|
|
79
|
+
...chartDataset,
|
|
80
|
+
...chartSeries,
|
|
81
|
+
...chartLegend,
|
|
82
|
+
...chartTooltip
|
|
83
|
+
},
|
|
84
|
+
onOptionChange
|
|
85
|
+
}),
|
|
86
|
+
width,
|
|
87
|
+
height,
|
|
88
|
+
...others
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { HvLineChart };
|