@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,191 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GlobalHealthBar } from '../src/lib/components/globalhealthbar/GlobalHealthBarRecharts.component';
|
|
3
|
-
import { GlobalHealthBar as VegaGlobalHealthBar } from '../src/lib/components/globalhealthbar/GlobalHealthBar.component';
|
|
4
|
-
import { SyncedCursorCharts } from '../src/lib/components/vegachartv2/SyncedCursorCharts';
|
|
5
|
-
import { Wrapper } from './common';
|
|
6
|
-
import { Stack } from '../src/lib/spacing';
|
|
7
|
-
const alerts = [
|
|
8
|
-
{
|
|
9
|
-
id: '1',
|
|
10
|
-
severity: 'warning',
|
|
11
|
-
startsAt: '2021-02-01T07:00:00Z',
|
|
12
|
-
endsAt: '2021-02-01T21:00:00Z',
|
|
13
|
-
description: 'Global health warning',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
id: '2',
|
|
17
|
-
severity: 'warning',
|
|
18
|
-
startsAt: '2021-02-01T23:00:00Z',
|
|
19
|
-
endsAt: '2021-02-02T23:00:00Z',
|
|
20
|
-
description: 'Global health warning',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: '3',
|
|
24
|
-
severity: 'critical',
|
|
25
|
-
startsAt: '2021-02-03T00:00:00Z',
|
|
26
|
-
endsAt: '2021-02-04T00:00:00Z',
|
|
27
|
-
description: 'Global health critical',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: '4',
|
|
31
|
-
severity: 'warning',
|
|
32
|
-
startsAt: '2021-02-04T10:00:00Z',
|
|
33
|
-
endsAt: '2021-02-06T00:00:00Z',
|
|
34
|
-
description: 'Global health warning',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: '5',
|
|
38
|
-
severity: 'warning',
|
|
39
|
-
startsAt: '2021-02-06T10:00:00Z',
|
|
40
|
-
endsAt: '2021-02-06T20:00:00Z',
|
|
41
|
-
description: 'Global health warning',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: '6',
|
|
45
|
-
severity: 'warning',
|
|
46
|
-
startsAt: '2021-02-06T12:00:00Z',
|
|
47
|
-
endsAt: '2021-02-06T22:30:00Z',
|
|
48
|
-
description: 'Global health warning',
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
const alertsLast24h = [
|
|
52
|
-
{
|
|
53
|
-
id: '1',
|
|
54
|
-
severity: 'warning',
|
|
55
|
-
startsAt: '2021-02-01T07:00:00Z',
|
|
56
|
-
endsAt: '2021-02-01T08:00:00Z',
|
|
57
|
-
description: 'Global health warning',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: '5',
|
|
61
|
-
severity: 'warning',
|
|
62
|
-
startsAt: '2021-02-01T10:00:00Z',
|
|
63
|
-
endsAt: '2021-02-01T20:00:00Z',
|
|
64
|
-
description: 'Global health warning',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: '6',
|
|
68
|
-
severity: 'unavailable',
|
|
69
|
-
startsAt: '2021-02-01T02:00:00Z',
|
|
70
|
-
endsAt: '2021-02-01T03:00:00Z',
|
|
71
|
-
description: 'unavailable',
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
const emptyAlert = [];
|
|
75
|
-
const alertRetrieveBefore = [
|
|
76
|
-
{
|
|
77
|
-
id: '1',
|
|
78
|
-
severity: 'warning',
|
|
79
|
-
startsAt: '2021-01-31T23:00:00Z',
|
|
80
|
-
endsAt: '2021-02-03T21:00:00Z',
|
|
81
|
-
description: 'Global health warning',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: '2',
|
|
85
|
-
severity: 'critical',
|
|
86
|
-
startsAt: '2021-02-05T23:00:00Z',
|
|
87
|
-
endsAt: '2021-02-07T00:00:00Z',
|
|
88
|
-
description: 'Global health warning',
|
|
89
|
-
},
|
|
90
|
-
];
|
|
91
|
-
const alertTriggerNotFirstDay = [
|
|
92
|
-
{
|
|
93
|
-
id: '1',
|
|
94
|
-
severity: 'warning',
|
|
95
|
-
startsAt: '2021-02-24T21:00:00Z',
|
|
96
|
-
endsAt: '2021-02-25T21:00:00Z',
|
|
97
|
-
description: 'Global health warning',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: '2',
|
|
101
|
-
severity: 'critical',
|
|
102
|
-
startsAt: '2021-02-26T23:00:00Z',
|
|
103
|
-
endsAt: '2021-02-27T21:00:00Z',
|
|
104
|
-
description: 'Global health warning',
|
|
105
|
-
},
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
const start = '2021-01-31T23:00:00Z'; // UTC time
|
|
109
|
-
const end = '2021-02-06T23:00:00Z';
|
|
110
|
-
const startLast24h = '2021-02-01T00:00:00Z';
|
|
111
|
-
const endLast24h = '2021-02-02T00:00:00Z';
|
|
112
|
-
const startNotFirstDay = '2021-02-23T23:00:00Z';
|
|
113
|
-
const endNotFirstDay = '2021-03-01T23:00:00Z';
|
|
114
|
-
|
|
115
|
-
export default {
|
|
116
|
-
title: 'Components/Data Display/Charts/GlobalHealthBar',
|
|
117
|
-
component: (props) => (
|
|
118
|
-
<Stack direction="vertical">
|
|
119
|
-
<GlobalHealthBar {...props} />
|
|
120
|
-
<VegaGlobalHealthBar {...props} />
|
|
121
|
-
</Stack>
|
|
122
|
-
),
|
|
123
|
-
decorators: [
|
|
124
|
-
(story) => (
|
|
125
|
-
<Wrapper
|
|
126
|
-
style={{ minHeight: '50vh', display: 'flex', alignItems: 'center' }}
|
|
127
|
-
>
|
|
128
|
-
<div style={{ width: '500px', height: '400px' }}>
|
|
129
|
-
<SyncedCursorCharts>{story()}</SyncedCursorCharts>
|
|
130
|
-
</div>
|
|
131
|
-
</Wrapper>
|
|
132
|
-
),
|
|
133
|
-
],
|
|
134
|
-
args: {
|
|
135
|
-
start,
|
|
136
|
-
end,
|
|
137
|
-
width: 500,
|
|
138
|
-
},
|
|
139
|
-
argTypes: {
|
|
140
|
-
start: {
|
|
141
|
-
control: 'date',
|
|
142
|
-
},
|
|
143
|
-
end: {
|
|
144
|
-
control: 'date',
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const GlobalHealthComponentDemo = {
|
|
150
|
-
args: {
|
|
151
|
-
id: 'vis_globalhealth',
|
|
152
|
-
alerts,
|
|
153
|
-
width: 500,
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const GlobalHealthLast24Hours = {
|
|
158
|
-
args: {
|
|
159
|
-
id: 'vis_globalhealth_24h',
|
|
160
|
-
alerts: alertsLast24h,
|
|
161
|
-
start: startLast24h,
|
|
162
|
-
end: endLast24h,
|
|
163
|
-
width: 500,
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
export const GlobalHealthEmpty = {
|
|
167
|
-
args: {
|
|
168
|
-
id: 'vis_globalhealth_empty',
|
|
169
|
-
alerts: emptyAlert,
|
|
170
|
-
width: 500,
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const AlertTriggeredEarlierThanTheStartingTime = {
|
|
175
|
-
args: {
|
|
176
|
-
id: 'vis_globalhealth_alert_retrieve_before',
|
|
177
|
-
alerts: alertRetrieveBefore,
|
|
178
|
-
width: 500,
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export const FirstLabel = {
|
|
183
|
-
name: 'First Label always includes the month label',
|
|
184
|
-
args: {
|
|
185
|
-
id: 'vis_globalhealth_display_month_1st_label',
|
|
186
|
-
alerts: alertTriggerNotFirstDay,
|
|
187
|
-
start: startNotFirstDay,
|
|
188
|
-
end: endNotFirstDay,
|
|
189
|
-
width: 500,
|
|
190
|
-
},
|
|
191
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BarChart } from '../../src/lib/components/barchart/BarChart.component';
|
|
3
|
-
import { verticalStackedData } from '../data/barchart';
|
|
4
|
-
// props for vertical stacked bar chart
|
|
5
|
-
const idVerticalStacked = 'vis_vertical_stacked';
|
|
6
|
-
const xAxisVerticalStacked = {
|
|
7
|
-
field: 'xlabel',
|
|
8
|
-
type: 'ordinal',
|
|
9
|
-
title: null,
|
|
10
|
-
axis: {
|
|
11
|
-
labelAngle: 0,
|
|
12
|
-
},
|
|
13
|
-
sort: {
|
|
14
|
-
order: 'ascending',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const yAxisVerticalStacked = {
|
|
18
|
-
aggregate: 'count',
|
|
19
|
-
field: '*',
|
|
20
|
-
title: null,
|
|
21
|
-
type: 'quantitative',
|
|
22
|
-
scale: {
|
|
23
|
-
padding: 1,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const colorVerticalStacked = {
|
|
27
|
-
field: 'status',
|
|
28
|
-
type: 'nominal',
|
|
29
|
-
legend: {
|
|
30
|
-
direction: 'horizontal',
|
|
31
|
-
orient: 'top',
|
|
32
|
-
title: null,
|
|
33
|
-
symbolType: 'circle',
|
|
34
|
-
columnPadding: 50,
|
|
35
|
-
},
|
|
36
|
-
scale: {
|
|
37
|
-
domain: ['2XX', '401', '404', '4XX', '503', '5XX'],
|
|
38
|
-
range: ['#4BE4E2', '#E45834', '#FEFA52', '#968BFF', '#BE2543', '#DC90F1'],
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
const width = 800;
|
|
42
|
-
// the size control the size of each small item of the bar
|
|
43
|
-
const barConfig = {
|
|
44
|
-
cornerRadius: 8,
|
|
45
|
-
size: 12,
|
|
46
|
-
};
|
|
47
|
-
export const ChartExample = ({}) => (
|
|
48
|
-
<BarChart
|
|
49
|
-
id={idVerticalStacked}
|
|
50
|
-
data={verticalStackedData}
|
|
51
|
-
xAxis={xAxisVerticalStacked}
|
|
52
|
-
yAxis={yAxisVerticalStacked}
|
|
53
|
-
color={colorVerticalStacked}
|
|
54
|
-
width={width}
|
|
55
|
-
barConfig={barConfig}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState, useEffect } from 'react';
|
|
2
|
-
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
-
import { SyncedCursorCharts } from '../src/lib/components/vegachartv2/SyncedCursorCharts';
|
|
4
|
-
import {
|
|
5
|
-
LineTemporalChart,
|
|
6
|
-
YAXIS_TITLE_READ_WRITE,
|
|
7
|
-
} from '../src/lib/components/linetemporalchart/LineTemporalChart.component';
|
|
8
|
-
import { MetricsTimeSpanProvider } from '../src/lib/components/linetemporalchart/MetricTimespanProvider';
|
|
9
|
-
import { Wrapper } from './common';
|
|
10
|
-
import { dataLineChartV2, dataLineChartV2_readwrite } from './data/linechart';
|
|
11
|
-
import { defaultRenderTooltipSerie } from '../src/lib/components/linetemporalchart/tooltip';
|
|
12
|
-
export default {
|
|
13
|
-
title: 'Components/Deprecated/Charts/LineTemporalChart',
|
|
14
|
-
component: LineTemporalChart,
|
|
15
|
-
decorators: [
|
|
16
|
-
(story) => (
|
|
17
|
-
<Wrapper>
|
|
18
|
-
<BrowserRouter>
|
|
19
|
-
<MetricsTimeSpanProvider>
|
|
20
|
-
<SyncedCursorCharts>{story()}</SyncedCursorCharts>
|
|
21
|
-
</MetricsTimeSpanProvider>
|
|
22
|
-
</BrowserRouter>
|
|
23
|
-
</Wrapper>
|
|
24
|
-
),
|
|
25
|
-
],
|
|
26
|
-
args: {
|
|
27
|
-
heigth: 300,
|
|
28
|
-
startingTimeStamp: 1629306229,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const CPUUsage = {
|
|
33
|
-
render: (args) => {
|
|
34
|
-
const [tooltipText, setTooltipText] = useState('initial text');
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setInterval(() => {
|
|
37
|
-
setTooltipText('New text ' + new Date().toISOString());
|
|
38
|
-
}, 500);
|
|
39
|
-
}, []);
|
|
40
|
-
return (
|
|
41
|
-
<LineTemporalChart
|
|
42
|
-
renderTooltipSerie={useCallback(
|
|
43
|
-
(serie, tooltipData) => {
|
|
44
|
-
if (serie.key === 'bootstrap') {
|
|
45
|
-
return (
|
|
46
|
-
defaultRenderTooltipSerie(serie) +
|
|
47
|
-
`<tr><td colspan="3">${tooltipText}</td></tr>`
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return defaultRenderTooltipSerie(serie);
|
|
51
|
-
},
|
|
52
|
-
[tooltipText],
|
|
53
|
-
)}
|
|
54
|
-
{...args}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
args: {
|
|
59
|
-
title: 'CPU Usage',
|
|
60
|
-
yAxisType: 'default',
|
|
61
|
-
series: dataLineChartV2,
|
|
62
|
-
helpText: (
|
|
63
|
-
<>
|
|
64
|
-
This charts represents lorem ipsum
|
|
65
|
-
<br />
|
|
66
|
-
This charts represents lorem ipsum
|
|
67
|
-
<br />
|
|
68
|
-
This charts represents lorem ipsum
|
|
69
|
-
<br />
|
|
70
|
-
This charts represents lorem ipsum
|
|
71
|
-
<br />
|
|
72
|
-
This charts represents lorem ipsum
|
|
73
|
-
<br />
|
|
74
|
-
This charts represents lorem ipsum
|
|
75
|
-
<br />
|
|
76
|
-
</>
|
|
77
|
-
),
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const IOPS = {
|
|
82
|
-
args: {
|
|
83
|
-
title: 'IOPS',
|
|
84
|
-
series: dataLineChartV2_readwrite,
|
|
85
|
-
yAxisTitle: YAXIS_TITLE_READ_WRITE,
|
|
86
|
-
yAxisType: 'symmetrical',
|
|
87
|
-
},
|
|
88
|
-
};
|
|
File without changes
|
|
File without changes
|
/package/dist/components/{globalhealthbar/components → charts/globalhealthbar}/HealthBarXAxis.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|