@centreon/ui 23.10.57 → 23.10.58
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 +3 -1
- package/src/Graph/Gauge/AnimatedPie.tsx +87 -0
- package/src/Graph/Gauge/Gauge.stories.tsx +45 -0
- package/src/Graph/Gauge/Gauge.tsx +44 -0
- package/src/Graph/Gauge/PieData.tsx +79 -0
- package/src/Graph/Gauge/ResponsiveGauge.tsx +135 -0
- package/src/Graph/Gauge/Thresholds.tsx +87 -0
- package/src/Graph/Gauge/index.ts +1 -0
- package/src/Graph/Gauge/models.ts +20 -0
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/index.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/models.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/useAxisY.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/RegularLines/index.tsx +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/RegularLines/useRegularLines.ts +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/StackedLines/index.tsx +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/StackedLines/useStackedLines.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/BasicThreshold.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/ThresholdWithPatternLines.tsx +3 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/ThresholdWithVariation.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/index.tsx +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/models.ts +1 -1
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/useScaleThreshold.ts +2 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/index.tsx +6 -2
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/models.ts +3 -3
- package/src/Graph/{BasicComponents → LineChart/BasicComponents}/useFilterLines.ts +1 -1
- package/src/Graph/{Header → LineChart/Header}/index.tsx +4 -4
- package/src/Graph/{Icons → LineChart/Icons}/Downtime.tsx +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/RegularAnchorPoint.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/StackedAnchorPoint.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/models.ts +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/useTickGraph.ts +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/useGraphTooltip.ts +1 -1
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/index.tsx +2 -2
- package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/interactionWithGraphAtoms.ts +1 -1
- package/src/Graph/{Legend → LineChart/Legend}/LegendHeader.tsx +1 -1
- package/src/Graph/{Legend → LineChart/Legend}/index.tsx +2 -2
- package/src/Graph/{Legend → LineChart/Legend}/useInteractiveValues.ts +6 -2
- package/src/Graph/{Legend → LineChart/Legend}/useLegend.ts +1 -1
- package/src/Graph/{Graph.tsx → LineChart/LineChart.tsx} +8 -7
- package/src/Graph/{graphAtoms.ts → LineChart/graphAtoms.ts} +1 -1
- package/src/Graph/{helpers → LineChart/helpers}/index.ts +9 -4
- package/src/Graph/{index.stories.tsx → LineChart/index.stories.tsx} +39 -38
- package/src/Graph/{index.tsx → LineChart/index.tsx} +14 -12
- package/src/Graph/{models.ts → LineChart/models.ts} +8 -12
- package/src/Graph/{useGraphData.ts → LineChart/useLineChartData.ts} +5 -3
- package/src/Graph/SingleBar/ResponsiveSingleBar.tsx +163 -0
- package/src/Graph/SingleBar/SingleBar.stories.tsx +45 -0
- package/src/Graph/SingleBar/SingleBar.tsx +25 -0
- package/src/Graph/SingleBar/Thresholds.tsx +100 -0
- package/src/Graph/SingleBar/index.ts +1 -0
- package/src/Graph/SingleBar/models.ts +8 -0
- package/src/Graph/Text/Text.stories.tsx +54 -0
- package/src/Graph/Text/Text.styles.ts +17 -0
- package/src/Graph/Text/Text.tsx +80 -0
- package/src/Graph/Text/index.ts +1 -0
- package/src/Graph/common/margins.ts +1 -0
- package/src/Graph/common/models.ts +7 -0
- package/src/Graph/{timeSeries → common/timeSeries}/index.test.ts +2 -2
- package/src/Graph/{timeSeries → common/timeSeries}/index.ts +22 -6
- package/src/Graph/{timeSeries → common/timeSeries}/models.ts +2 -0
- package/src/Graph/common/utils.ts +20 -0
- package/src/Graph/index.ts +4 -0
- package/src/RichTextEditor/RichTextEditor.cypress.spec.tsx +10 -6
- package/src/api/useGraphQuery/index.ts +7 -4
- package/src/components/CollapsibleItem/useCollapsibleItemStyles.ts +1 -0
- package/src/index.ts +3 -2
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Axes/UnitLabel.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Grids/index.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/Circle.tsx +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/helpers/index.ts +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/useCoordinateCircle.ts +0 -0
- /package/src/Graph/{BasicComponents → LineChart/BasicComponents}/LoadingProgress.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/GuidingLines.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/TooltipAnchorPoint.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/useTooltipAnchorPoint.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/Area.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/Line.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Annotation/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Area/Downtime.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/EventAnnotations.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Line/Acknowledgement.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/Line/Comments.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/annotationsAtoms.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/useAnnotation.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Bar.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/TimeShiftIcon.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/TimeShiftZone.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/TimeShiftZones/useTimeShiftZones.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/index.tsx +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/models.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/useZoomPreview.ts +0 -0
- /package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/zoomPreviewAtoms.ts +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/InteractiveValue.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/Legend.styles.ts +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/LegendContent.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/Marker.tsx +0 -0
- /package/src/Graph/{Legend → LineChart/Legend}/models.ts +0 -0
- /package/src/Graph/{Graph.styles.ts → LineChart/LineChart.styles.ts} +0 -0
- /package/src/Graph/{LoadingSkeleton.tsx → LineChart/LoadingSkeleton.tsx} +0 -0
- /package/src/Graph/{common → LineChart/common}/index.ts +0 -0
- /package/src/Graph/{helpers → LineChart/helpers}/doc.ts +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/annotationData.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodFirstPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodSecondPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/exclusionPeriodThirdPeriod.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDay.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayAreaStack.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayForward.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastDayThreshold.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastMonth.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/lastWeek.json +0 -0
- /package/src/Graph/{mockedData → LineChart/mockedData}/zoomPreview.json +0 -0
- /package/src/Graph/{translatedLabels.ts → LineChart/translatedLabels.ts} +0 -0
- /package/src/Graph/{useGraphIntersection.ts → LineChart/useLineChartIntersection.ts} +0 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { T, always, cond, flatten, isEmpty, join, pipe, pluck } from 'ramda';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { LineChartData, useFetchQuery } from '../..';
|
|
5
5
|
|
|
6
6
|
import { ServiceMetric } from './models';
|
|
7
7
|
|
|
8
8
|
interface UseMetricsQueryProps {
|
|
9
9
|
baseEndpoint: string;
|
|
10
10
|
metrics: Array<ServiceMetric>;
|
|
11
|
+
refreshInterval?: number | false;
|
|
11
12
|
timePeriod?: TimePeriod;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
interface UseMetricsQueryState {
|
|
15
16
|
end: string;
|
|
16
|
-
graphData:
|
|
17
|
+
graphData: LineChartData | undefined;
|
|
17
18
|
isGraphLoading: boolean;
|
|
18
19
|
isMetricIdsEmpty: boolean;
|
|
19
20
|
start: string;
|
|
@@ -37,14 +38,15 @@ const getStartEndFromTimePeriod = (
|
|
|
37
38
|
])(timePeriod);
|
|
38
39
|
};
|
|
39
40
|
|
|
40
|
-
interface PerformanceGraphData extends Omit<
|
|
41
|
+
interface PerformanceGraphData extends Omit<LineChartData, 'global'> {
|
|
41
42
|
base: number;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const useGraphQuery = ({
|
|
45
46
|
metrics,
|
|
46
47
|
baseEndpoint,
|
|
47
|
-
timePeriod = TimePeriod.lastDay
|
|
48
|
+
timePeriod = TimePeriod.lastDay,
|
|
49
|
+
refreshInterval = false
|
|
48
50
|
}: UseMetricsQueryProps): UseMetricsQueryState => {
|
|
49
51
|
const metricIds = pipe(
|
|
50
52
|
pluck('metrics'),
|
|
@@ -65,6 +67,7 @@ const useGraphQuery = ({
|
|
|
65
67
|
getQueryKey: () => ['graph', metricIds],
|
|
66
68
|
queryOptions: {
|
|
67
69
|
enabled: !isEmpty(metricIds),
|
|
70
|
+
refetchInterval: refreshInterval,
|
|
68
71
|
suspense: false
|
|
69
72
|
}
|
|
70
73
|
});
|
package/src/index.ts
CHANGED
|
@@ -144,5 +144,6 @@ export type { ResponseError, CatchErrorProps } from './api/customFetch';
|
|
|
144
144
|
export * from './utils';
|
|
145
145
|
export { default as FluidTypography } from './Typography/FluidTypography';
|
|
146
146
|
export * from './Dashboard';
|
|
147
|
-
export
|
|
148
|
-
export type {
|
|
147
|
+
export * from './Graph';
|
|
148
|
+
export type { LineChartData } from './Graph/common/models';
|
|
149
|
+
export * from './Graph/common/timeSeries';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{BasicComponents → LineChart/BasicComponents}/Lines/Threshold/helpers/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/AnchorPoint/index.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Annotations/models.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/Tooltip/models.ts
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/index.tsx
RENAMED
|
File without changes
|
/package/src/Graph/{InteractiveComponents → LineChart/InteractiveComponents}/ZoomPreview/models.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|