Debian Codegraph @

node/@patternfly/react-core/src/demos/examples/Card/CardUtilizationDemo2.tsx

raw
1 import {
2 Card,
3 CardTitle,
4 CardBody,
5 CardFooter,
6 Title,
7 Gallery,
8 GalleryItem,
9 Flex,
10 FlexItem,
11 Stack,
12 Divider
13 } from '@patternfly/react-core';
14 import { ChartArea, ChartGroup, ChartVoronoiContainer } from '@patternfly/react-charts/victory';
15
16 export const CardUtilizationDemo2: React.FunctionComponent = () => (
17 <Gallery hasGutter minWidths={{ default: '360px' }}>
18 <GalleryItem>
19 <Card id="utilization-card-2-card" component="div">
20 <CardTitle>
21 <Title headingLevel="h4" size="lg">
22 Top Utilized Clusters
23 </Title>
24 </CardTitle>
25 <CardBody>
26 <Flex direction={{ default: 'column' }}>
27 <FlexItem>
28 <Stack>
29 <a href="#">Cluster-1204</a>
30 <span>27.3 cores available</span>
31 </Stack>
32 </FlexItem>
33 <FlexItem>
34 <ChartGroup
35 ariaDesc="Mock average cluster utilization"
36 ariaTitle="Mock cluster sparkline chart"
37 containerComponent={
38 <ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />
39 }
40 height={100}
41 maxDomain={{ y: 9 }}
42 padding={0}
43 width={400}
44 >
45 <ChartArea
46 data={[
47 { name: 'Cluster', x: '2015', y: 7 },
48 { name: 'Cluster', x: '2016', y: 6 },
49 { name: 'Cluster', x: '2017', y: 8 },
50 { name: 'Cluster', x: '2018', y: 3 },
51 { name: 'Cluster', x: '2019', y: 4 },
52 { name: 'Cluster', x: '2020', y: 1 },
53 { name: 'Cluster', x: '2021', y: 0 }
54 ]}
55 />
56 </ChartGroup>
57 </FlexItem>
58 </Flex>
59 </CardBody>
60 <CardBody>
61 <Flex direction={{ default: 'column' }}>
62 <FlexItem>
63 <Stack>
64 <a href="#">Abcdef-1204</a>
65 <span>50.6 cores available</span>
66 </Stack>
67 </FlexItem>
68 <FlexItem>
69 <ChartGroup
70 ariaDesc="Mock average cluster utilization"
71 ariaTitle="Mock cluster sparkline chart"
72 containerComponent={
73 <ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />
74 }
75 height={100}
76 maxDomain={{ y: 9 }}
77 padding={0}
78 width={400}
79 >
80 <ChartArea
81 data={[
82 { name: 'Cluster', x: '2015', y: 7 },
83 { name: 'Cluster', x: '2016', y: 6 },
84 { name: 'Cluster', x: '2017', y: 8 },
85 { name: 'Cluster', x: '2018', y: 3 },
86 { name: 'Cluster', x: '2019', y: 4 },
87 { name: 'Cluster', x: '2020', y: 1 },
88 { name: 'Cluster', x: '2021', y: 0 }
89 ]}
90 />
91 </ChartGroup>
92 </FlexItem>
93 </Flex>
94 </CardBody>
95 <Divider />
96 <CardFooter>
97 <a href="#">View all clusters</a>
98 </CardFooter>
99 </Card>
100 </GalleryItem>
101 </Gallery>
102 );