@centreon/ui 25.4.2 → 25.4.3
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/package.json
CHANGED
|
@@ -30,6 +30,8 @@ interface Props {
|
|
|
30
30
|
start?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
const getBoolean = (value) => Boolean(Number(value));
|
|
34
|
+
|
|
33
35
|
const useGraphData = ({ data, end, start }: Props): GraphDataResult => {
|
|
34
36
|
const adjustedDataRef = useRef<Data>();
|
|
35
37
|
|
|
@@ -48,7 +50,16 @@ const useGraphData = ({ data, end, start }: Props): GraphDataResult => {
|
|
|
48
50
|
|
|
49
51
|
const newMetrics = Object.entries(metricsGroupedByColor).map(
|
|
50
52
|
([color, value]) => {
|
|
51
|
-
|
|
53
|
+
const adjustedValue = value?.map((item) => ({
|
|
54
|
+
...item,
|
|
55
|
+
ds_data: {
|
|
56
|
+
...item?.ds_data,
|
|
57
|
+
ds_invert: getBoolean(item?.ds_data?.ds_invert),
|
|
58
|
+
ds_filled: getBoolean(item?.ds_data?.ds_filled)
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
return adjustedValue?.map((metric, index) =>
|
|
52
63
|
set(
|
|
53
64
|
lensPath(['ds_data', 'ds_color_line']),
|
|
54
65
|
emphasizeCurveColor({ color, index }),
|
|
@@ -76,6 +87,7 @@ const useGraphData = ({ data, end, start }: Props): GraphDataResult => {
|
|
|
76
87
|
const { title } = dataWithAdjustedMetricsColor.global;
|
|
77
88
|
|
|
78
89
|
const newLineData = adjustGraphData(dataWithAdjustedMetricsColor).lines;
|
|
90
|
+
|
|
79
91
|
const sortedLines = sortBy(compose(toLower, prop('name')), newLineData);
|
|
80
92
|
|
|
81
93
|
adjustedDataRef.current = {
|