@scality/core-ui 0.186.0 → 0.187.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/dist/components/{linetemporalchart/MetricTimespanProvider.d.ts → charts/MetricsTimeSpanProvider.d.ts} +1 -1
- package/dist/components/charts/MetricsTimeSpanProvider.d.ts.map +1 -0
- package/dist/components/{barchartv2/Barchart.component.d.ts → charts/barchart/Barchart.d.ts} +2 -33
- package/dist/components/charts/barchart/Barchart.d.ts.map +1 -0
- package/dist/components/charts/barchart/Barchart.js +56 -0
- package/dist/components/{barchartv2/utils.d.ts → charts/barchart/Barchart.utils.d.ts} +8 -35
- package/dist/components/charts/barchart/Barchart.utils.d.ts.map +1 -0
- package/dist/components/{barchartv2/utils.js → charts/barchart/Barchart.utils.js} +7 -88
- package/dist/components/{barchartv2 → charts/barchart}/BarchartTooltip.d.ts +2 -1
- package/dist/components/charts/barchart/BarchartTooltip.d.ts.map +1 -0
- package/dist/components/{barchartv2 → charts/barchart}/BarchartTooltip.js +3 -3
- package/dist/components/{charttooltip → charts/common}/ChartTooltip.d.ts +9 -2
- package/dist/components/charts/common/ChartTooltip.d.ts.map +1 -0
- package/dist/components/{charttooltip → charts/common}/ChartTooltip.js +11 -15
- package/dist/components/charts/common/SharedComponents.d.ts +47 -0
- package/dist/components/charts/common/SharedComponents.d.ts.map +1 -0
- package/dist/components/charts/common/SharedComponents.js +73 -0
- package/dist/components/charts/common/chartUtils.d.ts +91 -0
- package/dist/components/charts/common/chartUtils.d.ts.map +1 -0
- package/dist/components/charts/common/chartUtils.js +243 -0
- package/dist/components/{globalhealthbar/GlobalHealthBarRecharts.component.d.ts → charts/globalhealthbar/GlobalHealthBar.d.ts} +2 -2
- package/dist/components/charts/globalhealthbar/GlobalHealthBar.d.ts.map +1 -0
- package/dist/components/{globalhealthbar/useHealthBarData.d.ts → charts/globalhealthbar/GlobalHealthBar.hooks.d.ts} +1 -1
- package/dist/components/charts/globalhealthbar/GlobalHealthBar.hooks.d.ts.map +1 -0
- package/dist/components/{globalhealthbar/GlobalHealthBarRecharts.component.js → charts/globalhealthbar/GlobalHealthBar.js} +4 -4
- package/dist/components/{globalhealthbar/healthBarUtils.d.ts → charts/globalhealthbar/GlobalHealthBar.utils.d.ts} +1 -1
- package/dist/components/charts/globalhealthbar/GlobalHealthBar.utils.d.ts.map +1 -0
- package/dist/components/{globalhealthbar/healthBarUtils.js → charts/globalhealthbar/GlobalHealthBar.utils.js} +1 -1
- package/dist/components/{globalhealthbar/components → charts/globalhealthbar}/GlobalHealthBarTooltip.d.ts +1 -1
- package/dist/components/charts/globalhealthbar/GlobalHealthBarTooltip.d.ts.map +1 -0
- package/dist/components/{globalhealthbar/components → charts/globalhealthbar}/GlobalHealthBarTooltip.js +7 -3
- package/dist/components/charts/globalhealthbar/HealthBarXAxis.d.ts.map +1 -0
- package/dist/components/{globalhealthbar/components → charts/globalhealthbar}/HealthBarXAxis.js +1 -1
- package/dist/components/charts/index.d.ts +16 -0
- package/dist/components/charts/index.d.ts.map +1 -0
- package/dist/components/charts/index.js +15 -0
- package/dist/components/{chartlegend → charts/legend}/ChartLegend.d.ts +1 -1
- package/dist/components/charts/legend/ChartLegend.d.ts.map +1 -0
- package/dist/components/{chartlegend → charts/legend}/ChartLegend.js +2 -2
- package/dist/components/{chartlegend → charts/legend}/ChartLegendWrapper.d.ts +1 -1
- package/dist/components/charts/legend/ChartLegendWrapper.d.ts.map +1 -0
- package/dist/components/{linetimeseriechart/linetimeseriechart.component.d.ts → charts/linetimeseries/LineTimeSerieChart.d.ts} +12 -2
- package/dist/components/charts/linetimeseries/LineTimeSerieChart.d.ts.map +1 -0
- package/dist/components/{linetimeseriechart/linetimeseriechart.component.js → charts/linetimeseries/LineTimeSerieChart.js} +34 -35
- package/dist/components/charts/linetimeseries/LineTimeSerieChart.utils.d.ts +14 -0
- package/dist/components/charts/linetimeseries/LineTimeSerieChart.utils.d.ts.map +1 -0
- package/dist/components/{linetimeseriechart/utils.js → charts/linetimeseries/LineTimeSerieChart.utils.js} +4 -6
- package/dist/components/charts/sparkline/Sparkline.d.ts +23 -0
- package/dist/components/charts/sparkline/Sparkline.d.ts.map +1 -0
- package/dist/components/{sparkline/sparkline.component.js → charts/sparkline/Sparkline.js} +12 -6
- package/dist/components/charts/types.d.ts +34 -0
- package/dist/components/charts/types.d.ts.map +1 -0
- package/dist/components/charts/types.js +4 -0
- package/dist/components/icon/Icon.component.d.ts +1 -0
- package/dist/components/icon/Icon.component.d.ts.map +1 -1
- package/dist/components/icon/Icon.component.js +2 -2
- package/dist/components/textbadge/TextBadge.component.d.ts +1 -1
- package/dist/components/textbadge/TextBadge.component.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/next.d.ts +3 -11
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +4 -11
- package/package.json +2 -6
- package/src/lib/components/{barchartv2/Barchart.component.test.tsx → charts/barchart/Barchart.test.tsx} +35 -10
- package/src/lib/components/{barchartv2/Barchart.component.tsx → charts/barchart/Barchart.tsx} +42 -207
- package/src/lib/components/{barchartv2/utils.test.ts → charts/barchart/Barchart.utils.test.ts} +2 -141
- package/src/lib/components/{barchartv2/utils.ts → charts/barchart/Barchart.utils.ts} +17 -143
- package/src/lib/components/{barchartv2 → charts/barchart}/BarchartTooltip.tsx +5 -9
- package/src/lib/components/{charttooltip → charts/common}/ChartTooltip.tsx +13 -20
- package/src/lib/components/charts/common/SharedComponents.tsx +180 -0
- package/src/lib/components/charts/common/chartUtils.test.ts +402 -0
- package/src/lib/components/charts/common/chartUtils.ts +334 -0
- package/src/lib/components/{globalhealthbar/useHealthBarData.spec.tsx → charts/globalhealthbar/GlobalHealthBar.hooks.test.tsx} +1 -1
- package/src/lib/components/{globalhealthbar/GlobalHealthBarRecharts.component.tsx → charts/globalhealthbar/GlobalHealthBar.tsx} +4 -4
- package/src/lib/components/{globalhealthbar/healthBarUtils.spec.ts → charts/globalhealthbar/GlobalHealthBar.utils.test.ts} +1 -1
- package/src/lib/components/{globalhealthbar/healthBarUtils.ts → charts/globalhealthbar/GlobalHealthBar.utils.ts} +1 -1
- package/src/lib/components/{globalhealthbar/components → charts/globalhealthbar}/GlobalHealthBarTooltip.tsx +8 -4
- package/src/lib/components/{globalhealthbar/components → charts/globalhealthbar}/HealthBarXAxis.tsx +1 -1
- package/src/lib/components/charts/index.ts +59 -0
- package/src/lib/components/{chartlegend → charts/legend}/ChartLegend.tsx +2 -2
- package/src/lib/components/{chartlegend → charts/legend}/ChartLegendWrapper.tsx +1 -1
- package/src/lib/components/{linetimeseriechart/linetimeseriechart.test.tsx → charts/linetimeseries/LineTimeSerieChart.test.tsx} +3 -6
- package/src/lib/components/{linetimeseriechart/linetimeseriechart.component.tsx → charts/linetimeseries/LineTimeSerieChart.tsx} +48 -44
- package/src/lib/components/{linetimeseriechart/utils.test.ts → charts/linetimeseries/LineTimeSerieChart.utils.test.ts} +1 -1
- package/src/lib/components/{linetimeseriechart/utils.ts → charts/linetimeseries/LineTimeSerieChart.utils.ts} +4 -6
- package/src/lib/components/charts/sparkline/Sparkline.tsx +80 -0
- package/src/lib/components/charts/types.ts +36 -0
- package/src/lib/components/icon/Icon.component.tsx +12 -8
- package/src/lib/components/textbadge/TextBadge.component.tsx +1 -1
- package/src/lib/index.ts +4 -2
- package/src/lib/next.ts +26 -13
- package/stories/BarChart/barchart.stories.tsx +10 -9
- package/stories/GlobalHealthBar/{globalhealthbarRecharts.stories.tsx → globalhealthbar.stories.tsx} +3 -21
- package/stories/GlobalHealthBar/globalheathbarrecharts.guideline.mdx +2 -2
- package/stories/guideline/chart-guideline.mdx +1 -38
- package/stories/linetimeseriechart.stories.tsx +4 -6
- package/stories/sparkline.stories.tsx +13 -11
- package/stories/textbadge.stories.tsx +15 -0
- package/dist/components/barchart/BarChart.component.d.ts +0 -17
- package/dist/components/barchart/BarChart.component.d.ts.map +0 -1
- package/dist/components/barchart/BarChart.component.js +0 -27
- package/dist/components/barchartv2/Barchart.component.d.ts.map +0 -1
- package/dist/components/barchartv2/Barchart.component.js +0 -122
- package/dist/components/barchartv2/BarchartTooltip.d.ts.map +0 -1
- package/dist/components/barchartv2/utils.d.ts.map +0 -1
- package/dist/components/chartlegend/ChartLegend.d.ts.map +0 -1
- package/dist/components/chartlegend/ChartLegendWrapper.d.ts.map +0 -1
- package/dist/components/charttooltip/ChartTooltip.d.ts.map +0 -1
- package/dist/components/globalhealthbar/GlobalHealthBar.component.d.ts +0 -23
- package/dist/components/globalhealthbar/GlobalHealthBar.component.d.ts.map +0 -1
- package/dist/components/globalhealthbar/GlobalHealthBar.component.js +0 -173
- package/dist/components/globalhealthbar/GlobalHealthBarRecharts.component.d.ts.map +0 -1
- package/dist/components/globalhealthbar/components/GlobalHealthBarTooltip.d.ts.map +0 -1
- package/dist/components/globalhealthbar/components/HealthBarXAxis.d.ts.map +0 -1
- package/dist/components/globalhealthbar/healthBarUtils.d.ts.map +0 -1
- package/dist/components/globalhealthbar/healthBarUtils.spec.d.ts +0 -2
- package/dist/components/globalhealthbar/healthBarUtils.spec.d.ts.map +0 -1
- package/dist/components/globalhealthbar/healthBarUtils.spec.js +0 -391
- package/dist/components/globalhealthbar/tooltip/index.d.ts +0 -8
- package/dist/components/globalhealthbar/tooltip/index.d.ts.map +0 -1
- package/dist/components/globalhealthbar/tooltip/index.js +0 -55
- package/dist/components/globalhealthbar/useHealthBarData.d.ts.map +0 -1
- package/dist/components/globalhealthbar/useHealthBarData.spec.d.ts +0 -2
- package/dist/components/globalhealthbar/useHealthBarData.spec.d.ts.map +0 -1
- package/dist/components/globalhealthbar/useHealthBarData.spec.js +0 -209
- package/dist/components/linetemporalchart/ChartUtil.d.ts +0 -41
- package/dist/components/linetemporalchart/ChartUtil.d.ts.map +0 -1
- package/dist/components/linetemporalchart/ChartUtil.js +0 -148
- package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts +0 -46
- package/dist/components/linetemporalchart/LineTemporalChart.component.d.ts.map +0 -1
- package/dist/components/linetemporalchart/LineTemporalChart.component.js +0 -579
- package/dist/components/linetemporalchart/MetricTimespanProvider.d.ts.map +0 -1
- package/dist/components/linetemporalchart/tooltip/index.d.ts +0 -30
- package/dist/components/linetemporalchart/tooltip/index.d.ts.map +0 -1
- package/dist/components/linetemporalchart/tooltip/index.js +0 -104
- package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts.map +0 -1
- package/dist/components/linetimeseriechart/utils.d.ts +0 -16
- package/dist/components/linetimeseriechart/utils.d.ts.map +0 -1
- package/dist/components/sparkline/sparkline.component.d.ts +0 -17
- package/dist/components/sparkline/sparkline.component.d.ts.map +0 -1
- package/dist/components/vegachartv2/SyncedCursorCharts.d.ts +0 -12
- package/dist/components/vegachartv2/SyncedCursorCharts.d.ts.map +0 -1
- package/dist/components/vegachartv2/SyncedCursorCharts.js +0 -15
- package/dist/components/vegachartv2/VegaChartV2.component.d.ts +0 -15
- package/dist/components/vegachartv2/VegaChartV2.component.d.ts.map +0 -1
- package/dist/components/vegachartv2/VegaChartV2.component.js +0 -218
- package/src/lib/components/barchart/BarChart.component.tsx +0 -51
- package/src/lib/components/globalhealthbar/GlobalHealthBar.component.tsx +0 -204
- package/src/lib/components/globalhealthbar/tooltip/index.ts +0 -72
- package/src/lib/components/linetemporalchart/ChartUtil.test.ts +0 -250
- package/src/lib/components/linetemporalchart/ChartUtil.ts +0 -225
- package/src/lib/components/linetemporalchart/LineTemporalChart.component.tsx +0 -800
- package/src/lib/components/linetemporalchart/tooltip/index.ts +0 -178
- package/src/lib/components/sparkline/sparkline.component.tsx +0 -56
- package/src/lib/components/vegachartv2/SyncedCursorCharts.tsx +0 -28
- package/src/lib/components/vegachartv2/VegaChartV2.component.tsx +0 -276
- package/stories/barchart.stories.tsx +0 -142
- package/stories/globalhealthbar.stories.tsx +0 -191
- package/stories/guideline/mdxExampleComponents.tsx +0 -57
- package/stories/linecharttemporal.stories.tsx +0 -88
- /package/dist/components/{linetemporalchart/MetricTimespanProvider.js → charts/MetricsTimeSpanProvider.js} +0 -0
- /package/dist/components/{globalhealthbar/useHealthBarData.js → charts/globalhealthbar/GlobalHealthBar.hooks.js} +0 -0
- /package/dist/components/{globalhealthbar/components → charts/globalhealthbar}/HealthBarXAxis.d.ts +0 -0
- /package/dist/components/{chartlegend → charts/legend}/ChartLegendWrapper.js +0 -0
- /package/src/lib/components/{linetemporalchart/MetricTimespanProvider.tsx → charts/MetricsTimeSpanProvider.tsx} +0 -0
- /package/src/lib/components/{barchartv2 → charts/barchart}/BarchartTooltip.test.tsx +0 -0
- /package/src/lib/components/{globalhealthbar/useHealthBarData.ts → charts/globalhealthbar/GlobalHealthBar.hooks.ts} +0 -0
- /package/src/lib/components/{chartlegend → charts/legend}/ChartLegend.test.tsx +0 -0
- /package/src/lib/components/{chartlegend → charts/legend}/ChartLegendWrapper.test.tsx +0 -0
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef } from 'react';
|
|
3
|
-
import { Bar, BarChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from 'recharts';
|
|
4
|
-
import styled, { useTheme } from 'styled-components';
|
|
5
|
-
import { spacing, Stack, Wrap } from '../../spacing';
|
|
6
|
-
import { chartColors, fontSize } from '../../style/theme';
|
|
7
|
-
import { Box } from '../box/Box';
|
|
8
|
-
import { useChartLegend } from '../chartlegend/ChartLegendWrapper';
|
|
9
|
-
import { ConstrainedText } from '../constrainedtext/Constrainedtext.component';
|
|
10
|
-
import { FormattedDateTime } from '../date/FormattedDateTime';
|
|
11
|
-
import { IconHelp } from '../iconhelper/IconHelper';
|
|
12
|
-
import { Loader } from '../loader/Loader.component';
|
|
13
|
-
import { Text } from '../text/Text.component';
|
|
14
|
-
import { BarchartTooltip } from './BarchartTooltip';
|
|
15
|
-
import { getTicks, useChartData } from './utils';
|
|
16
|
-
const CHART_CONSTANTS = {
|
|
17
|
-
TICK_WIDTH_OFFSET: 4,
|
|
18
|
-
BAR_SIZE: 12,
|
|
19
|
-
MIN_POINT_SIZE: 3,
|
|
20
|
-
DEFAULT_HEIGHT: 200,
|
|
21
|
-
CHART_MARGIN: {
|
|
22
|
-
left: 0,
|
|
23
|
-
right: -10,
|
|
24
|
-
top: 0,
|
|
25
|
-
bottom: 0,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
const maxWidthTooltip = { maxWidth: '20rem' };
|
|
29
|
-
/* ---------------------------------- COMPONENTS ---------------------------------- */
|
|
30
|
-
/**
|
|
31
|
-
* Get the format of the date based on the duration
|
|
32
|
-
* @param duration - Duration in seconds
|
|
33
|
-
* @returns Formatted string
|
|
34
|
-
*/
|
|
35
|
-
export const formatDate = (duration) => {
|
|
36
|
-
if (duration <= 24 * 60 * 60) {
|
|
37
|
-
return 'time';
|
|
38
|
-
}
|
|
39
|
-
else if (duration <= 7 * 24 * 60 * 60) {
|
|
40
|
-
return 'day-month-abbreviated';
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return 'chart-long-term-date';
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
export const CustomTick = ({ x, y, payload, visibleTicksCount, width, type, }) => {
|
|
47
|
-
const theme = useTheme();
|
|
48
|
-
const tickWidth = width / visibleTicksCount - CHART_CONSTANTS.TICK_WIDTH_OFFSET;
|
|
49
|
-
const centerX = x - tickWidth / 2;
|
|
50
|
-
const duration = type.type === 'time'
|
|
51
|
-
? (type.timeRange.endDate.getTime() -
|
|
52
|
-
type.timeRange.startDate.getTime()) /
|
|
53
|
-
1000
|
|
54
|
-
: 0;
|
|
55
|
-
return (_jsx("foreignObject", { x: centerX, y: y - 8, width: tickWidth, color: theme.textSecondary, overflow: "visible", children: _jsx(ConstrainedText, { color: "textSecondary", text: _jsx(Text, { variant: "Smaller", children: type.type === 'time' ? (_jsx(FormattedDateTime, { format: formatDate(duration), value: new Date(payload.value) })) : (String(payload.value)) }), centered: true, tooltipStyle: {
|
|
56
|
-
backgroundColor: theme.backgroundLevel1,
|
|
57
|
-
padding: spacing.r10,
|
|
58
|
-
borderRadius: spacing.r8,
|
|
59
|
-
border: `1px solid ${theme.border}`,
|
|
60
|
-
position: 'absolute',
|
|
61
|
-
} }) }));
|
|
62
|
-
};
|
|
63
|
-
export const StyledResponsiveContainer = styled(ResponsiveContainer) `
|
|
64
|
-
// Avoid tooltip over constrained text to be cut off
|
|
65
|
-
& .recharts-surface {
|
|
66
|
-
outline: none;
|
|
67
|
-
overflow: visible;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
const ChartHeader = ({ title, secondaryTitle, helpTooltip, rightTitle, }) => {
|
|
71
|
-
return (_jsxs(Wrap, { children: [_jsxs(Stack, { gap: "r4", children: [_jsx(Text, { variant: "ChartTitle", children: title }), helpTooltip && (_jsx(IconHelp, { tooltipMessage: helpTooltip, overlayStyle: maxWidthTooltip })), secondaryTitle && (_jsx(Text, { color: "textSecondary", style: {
|
|
72
|
-
marginLeft: spacing.r8,
|
|
73
|
-
}, children: secondaryTitle }))] }), rightTitle && _jsx(Text, { children: rightTitle })] }));
|
|
74
|
-
};
|
|
75
|
-
const Error = ({ height }) => {
|
|
76
|
-
return (_jsx(Box, { height: height, style: {
|
|
77
|
-
alignItems: 'center',
|
|
78
|
-
justifyContent: 'center',
|
|
79
|
-
display: 'flex',
|
|
80
|
-
}, children: _jsx(Text, { children: "Chart data is not available" }) }));
|
|
81
|
-
};
|
|
82
|
-
const Loading = ({ height }) => {
|
|
83
|
-
return (_jsx(Box, { height: height, style: {
|
|
84
|
-
alignItems: 'center',
|
|
85
|
-
justifyContent: 'center',
|
|
86
|
-
display: 'flex',
|
|
87
|
-
}, children: _jsx(Loader, { size: "larger", children: _jsx(Text, { children: "Loading Chart Data..." }) }) }));
|
|
88
|
-
};
|
|
89
|
-
/* ---------------------------------- MAIN COMPONENT ---------------------------------- */
|
|
90
|
-
export const Barchart = (props) => {
|
|
91
|
-
const theme = useTheme();
|
|
92
|
-
const { getColor } = useChartLegend();
|
|
93
|
-
const [hoveredValue, setHoveredValue] = useState();
|
|
94
|
-
const chartRef = useRef(null);
|
|
95
|
-
const { height = CHART_CONSTANTS.DEFAULT_HEIGHT, bars, type = { type: 'category' }, unitRange, stacked, stackedBarSort = 'default', defaultSort, tooltip, title, secondaryTitle, helpTooltip, rightTitle, isLoading, isError, } = props;
|
|
96
|
-
// Create colorSet from ChartLegendWrapper
|
|
97
|
-
const colorSet = bars === null || bars === void 0 ? void 0 : bars.reduce((acc, bar) => {
|
|
98
|
-
const color = getColor(bar.label);
|
|
99
|
-
if (color) {
|
|
100
|
-
acc[bar.label] = color;
|
|
101
|
-
}
|
|
102
|
-
return acc;
|
|
103
|
-
}, {});
|
|
104
|
-
const { rechartsBars, unitLabel, roundReferenceValue, rechartsData, topDomain } = useChartData(bars || [], type, colorSet || {}, stacked, defaultSort, unitRange, stackedBarSort);
|
|
105
|
-
const titleWithUnit = unitLabel ? `${title} (${unitLabel})` : title;
|
|
106
|
-
return (_jsxs(Stack, { direction: "vertical", style: { gap: '0' }, children: [_jsx(ChartHeader, { title: titleWithUnit, secondaryTitle: secondaryTitle, helpTooltip: helpTooltip, rightTitle: rightTitle }), isError || (!bars && !isLoading) ? (_jsx(Error, { height: height })) : isLoading ? (_jsx(Loading, { height: height })) : (_jsx(StyledResponsiveContainer, { ref: chartRef, width: "100%", height: height, children: _jsxs(BarChart, { data: rechartsData, accessibilityLayer: true, barSize: type.type === 'category'
|
|
107
|
-
? type.gap === 0
|
|
108
|
-
? undefined
|
|
109
|
-
: CHART_CONSTANTS.BAR_SIZE
|
|
110
|
-
: CHART_CONSTANTS.BAR_SIZE, height: height, margin: CHART_CONSTANTS.CHART_MARGIN, barCategoryGap: type.type === 'category' ? type.gap : undefined, children: [_jsx(CartesianGrid, { vertical: true, horizontal: true, verticalPoints: [0], horizontalPoints: [0], stroke: theme.border, fill: theme.backgroundLevel4, strokeWidth: 1 }), rechartsBars.map((bar) => {
|
|
111
|
-
const { fill, dataKey, stackId } = bar;
|
|
112
|
-
return (_jsx(Bar, { dataKey: dataKey, fill: chartColors[fill] || fill, minPointSize: stacked ? 0 : CHART_CONSTANTS.MIN_POINT_SIZE, stackId: stackId, isAnimationActive: false, onMouseOver: () => setHoveredValue(dataKey), onMouseLeave: () => setHoveredValue(undefined) }, dataKey));
|
|
113
|
-
}), _jsx(YAxis, { interval: 0, domain: [0, topDomain], ticks: getTicks(roundReferenceValue, false), tickFormatter: (value) => new Intl.NumberFormat('fr-FR').format(value) // Add a space as thousand separator
|
|
114
|
-
, axisLine: { stroke: theme.border }, tick: {
|
|
115
|
-
fill: theme.textSecondary,
|
|
116
|
-
fontSize: fontSize.smaller,
|
|
117
|
-
}, orientation: "right" }), _jsx(XAxis, { dataKey: "category", tick: (props) => _jsx(CustomTick, { ...props, type: type }), type: "category", interval: 0, allowDataOverflow: true, tickLine: {
|
|
118
|
-
stroke: theme.border,
|
|
119
|
-
}, axisLine: {
|
|
120
|
-
stroke: theme.border,
|
|
121
|
-
} }), _jsx(Tooltip, { content: (props) => (_jsx(BarchartTooltip, { type: type, colorSet: colorSet, tooltipProps: props, hoveredValue: hoveredValue, tooltip: tooltip, unitLabel: unitLabel, chartContainerRef: chartRef })), cursor: false })] }) }))] }));
|
|
122
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BarchartTooltip.d.ts","sourceRoot":"","sources":["../../../src/lib/components/barchartv2/BarchartTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAS/C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,YAAY,0FAQnD;IACD,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC;IAC9B,YAAY,EAAE,mBAA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{
|
|
5
|
-
id: string;
|
|
6
|
-
alerts: {
|
|
7
|
-
description: string;
|
|
8
|
-
startsAt: string;
|
|
9
|
-
endsAt: string;
|
|
10
|
-
severity: string;
|
|
11
|
-
}[];
|
|
12
|
-
start: string;
|
|
13
|
-
end: string;
|
|
14
|
-
height?: number;
|
|
15
|
-
tooltipPosition?: Position;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use GlobalHealthBar v2 instead
|
|
19
|
-
* @example import { GlobalHealthBar } from '@scality/core-ui/dist/next';
|
|
20
|
-
*/
|
|
21
|
-
declare function GlobalHealthBar({ id, alerts, start, end, height, tooltipPosition, }: GlobalHealthProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export { GlobalHealthBar };
|
|
23
|
-
//# sourceMappingURL=GlobalHealthBar.component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalHealthBar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/globalhealthbar/GlobalHealthBar.component.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,KAAK,QAAQ,GAAG,OAAO,GAAG,GAAG,OAAO,MAAM,CAAC;AAC3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,QAAQ,CAAC;CAC5B,CAAC;AACF;;;GAGG;AACH,iBAAS,eAAe,CAAC,EACvB,EAAE,EACF,MAAM,EACN,KAAK,EACL,GAAG,EACH,MAAU,EACV,eAAqB,GACtB,EAAE,iBAAiB,2CAyKnB;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { VegaChart } from '../vegachartv2/VegaChartV2.component';
|
|
5
|
-
import { useTheme } from 'styled-components';
|
|
6
|
-
import { formatValue } from './tooltip/index';
|
|
7
|
-
export const TOP = 'top';
|
|
8
|
-
export const BOTTOM = 'bottom';
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use GlobalHealthBar v2 instead
|
|
11
|
-
* @example import { GlobalHealthBar } from '@scality/core-ui/dist/next';
|
|
12
|
-
*/
|
|
13
|
-
function GlobalHealthBar({ id, alerts, start, end, height = 8, tooltipPosition = TOP, }) {
|
|
14
|
-
const theme = useTheme();
|
|
15
|
-
const trimAlerts = alerts.map((alert) => {
|
|
16
|
-
if (new Date(alert.startsAt) < new Date(start)) {
|
|
17
|
-
return { ...alert, startsAt: start };
|
|
18
|
-
}
|
|
19
|
-
return { ...alert };
|
|
20
|
-
});
|
|
21
|
-
trimAlerts.unshift({
|
|
22
|
-
startsAt: start,
|
|
23
|
-
endsAt: end,
|
|
24
|
-
severity: 'healthy',
|
|
25
|
-
});
|
|
26
|
-
const spec = {
|
|
27
|
-
width: 'container',
|
|
28
|
-
height,
|
|
29
|
-
data: {
|
|
30
|
-
values: trimAlerts,
|
|
31
|
-
},
|
|
32
|
-
transform: [
|
|
33
|
-
{
|
|
34
|
-
calculate: "datum.description !== '' ? 'View details on alert page' : ''",
|
|
35
|
-
as: 'title',
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
view: {
|
|
39
|
-
cornerRadius: 6,
|
|
40
|
-
},
|
|
41
|
-
config: {
|
|
42
|
-
style: {
|
|
43
|
-
cell: {
|
|
44
|
-
stroke: 'transparent',
|
|
45
|
-
strokeWidth: 0,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
layer: [
|
|
50
|
-
// Paint the entire bar with green
|
|
51
|
-
{
|
|
52
|
-
mark: {
|
|
53
|
-
type: 'rect',
|
|
54
|
-
clip: true,
|
|
55
|
-
},
|
|
56
|
-
encoding: {
|
|
57
|
-
color: {
|
|
58
|
-
value: theme.statusHealthy,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
}, // Paint the timespan as x-axis
|
|
62
|
-
{
|
|
63
|
-
mark: {
|
|
64
|
-
type: 'rect',
|
|
65
|
-
cursor: 'pointer',
|
|
66
|
-
clip: true,
|
|
67
|
-
},
|
|
68
|
-
encoding: {
|
|
69
|
-
x: {
|
|
70
|
-
field: 'startsAt',
|
|
71
|
-
type: 'temporal',
|
|
72
|
-
title: null,
|
|
73
|
-
stack: null,
|
|
74
|
-
axis: {
|
|
75
|
-
format: '%d%b %H:%M:%S',
|
|
76
|
-
ticks: true,
|
|
77
|
-
tickCount: 5,
|
|
78
|
-
//A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are “nice” (multiples of 2, 5, 10) and lie within the underlying scale’s range.
|
|
79
|
-
labelFlush: 20,
|
|
80
|
-
labelColor: theme.textSecondary,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
x2: {
|
|
84
|
-
field: 'endsAt',
|
|
85
|
-
},
|
|
86
|
-
color: {
|
|
87
|
-
value: theme.statusHealthy,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
mark: {
|
|
93
|
-
type: 'rect',
|
|
94
|
-
tooltip: true,
|
|
95
|
-
cursor: 'pointer',
|
|
96
|
-
clip: true,
|
|
97
|
-
},
|
|
98
|
-
params: [
|
|
99
|
-
{
|
|
100
|
-
name: 'highlight',
|
|
101
|
-
// The supported DOM event types for mark items are https://vega.github.io/vega/docs/event-streams/
|
|
102
|
-
select: {
|
|
103
|
-
type: 'point',
|
|
104
|
-
on: 'mouseover',
|
|
105
|
-
clear: 'mouseout',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
encoding: {
|
|
110
|
-
x: {
|
|
111
|
-
timeUnit: 'yearmonthdatehoursminutes',
|
|
112
|
-
field: 'startsAt',
|
|
113
|
-
type: 'temporal',
|
|
114
|
-
title: null,
|
|
115
|
-
},
|
|
116
|
-
x2: {
|
|
117
|
-
field: 'endsAt',
|
|
118
|
-
},
|
|
119
|
-
color: {
|
|
120
|
-
field: 'severity',
|
|
121
|
-
type: 'nominal',
|
|
122
|
-
title: 'null',
|
|
123
|
-
scale: {
|
|
124
|
-
domain: ['healthy', 'critical', 'unavailable', 'warning'],
|
|
125
|
-
range: [
|
|
126
|
-
theme.statusHealthy,
|
|
127
|
-
theme.statusCritical,
|
|
128
|
-
theme.textSecondary,
|
|
129
|
-
theme.statusWarning,
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
legend: null,
|
|
133
|
-
},
|
|
134
|
-
tooltip: [
|
|
135
|
-
{
|
|
136
|
-
field: 'severity',
|
|
137
|
-
title: 'Severity',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
field: 'startsAt',
|
|
141
|
-
title: 'Start',
|
|
142
|
-
type: 'temporal',
|
|
143
|
-
timeUnit: 'yearmonthdatehoursminutes',
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
field: 'endsAt',
|
|
147
|
-
title: 'End',
|
|
148
|
-
type: 'temporal',
|
|
149
|
-
timeUnit: 'yearmonthdatehoursminutes',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
field: 'title',
|
|
153
|
-
title: 'title',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
field: 'description',
|
|
157
|
-
title: 'Description',
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
opacity: {
|
|
161
|
-
condition: {
|
|
162
|
-
param: 'highlight',
|
|
163
|
-
value: 1,
|
|
164
|
-
},
|
|
165
|
-
value: 0.6,
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
};
|
|
171
|
-
return (_jsx(VegaChart, { className: "sc-globalhealthbar", spec: spec, theme: 'custom', tooltipPosition: tooltipPosition, formatTooltip: useMemo(() => formatValue(), []) }));
|
|
172
|
-
}
|
|
173
|
-
export { GlobalHealthBar };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalHealthBarRecharts.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/globalhealthbar/GlobalHealthBarRecharts.component.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,EAAoB,MAAM,oBAAoB,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAUD,wBAAgB,eAAe,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,iBAAiB,2CAkN5E;AAGD,YAAY,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalHealthBarTooltip.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/globalhealthbar/components/GlobalHealthBarTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAK/C,UAAU,2BAA2B;IACnC,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,YAAY,EAAE,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoBD,eAAO,MAAM,sBAAsB,UAAW,2BAA2B,mDA6FxE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HealthBarXAxis.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/globalhealthbar/components/HealthBarXAxis.tsx"],"names":[],"mappings":"AAWA,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAiDD,eAAO,MAAM,cAAc,sCAGxB,mBAAmB,4CA4BrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"healthBarUtils.d.ts","sourceRoot":"","sources":["../../../src/lib/components/globalhealthbar/healthBarUtils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAWf,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;CAOf,CAAC;AA4BX,eAAO,MAAM,sBAAsB,iBAAkB,MAAM,KAAG,MAAM,EAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,iBAAkB,MAAM,KAAG,MAAM,EAM9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,iBAAkB,MAAM,KAAG,MAAM,EAO/D,CAAC;AAEF,eAAO,MAAM,aAAa,UACjB,MAAM,cACD,MAAM,aACP,OAAO,KACjB,MAKF,CAAC;AAEF,eAAO,MAAM,QAAQ,mBACH,MAAM,gBACR,MAAM,KACnB,MAAM,EAYR,CAAC;AAMF,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,wBAAwB,eACvB,MAAM,cACN,MAAM,QACZ,MAAM,SACL,MAAM,gBACC,MAAM,KACnB,OA+BF,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,sBAAsB,wBACZ,MAAM,qBACR,MAAM,uBACJ,MAAM,qBACR,MAAM,kBACT,MAAM,UACf,MAAM;;;;CAkBd,CAAC;AAMF,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,GAAG,GAAG,IAAI,CAAC;IAC1B,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,gBAAgB,GAAG,IAiBpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,WAC3B,gBAAgB,gBACV,MAAM,eACP,MAAM,KAClB,MAiBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,UAChC,gBAAgB,gBACV,MAAM,UACZ,CAAC,EAAE,KACV,eAYF,CAAC;AAMF;;GAEG;AACH,eAAO,MAAM,kBAAkB,UACtB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,kBAC3B,MAAM,gBACR,MAAM,oBACF,MAAM,WAgBzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"healthBarUtils.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/components/globalhealthbar/healthBarUtils.spec.ts"],"names":[],"mappings":""}
|