Skip to content

Commit 300508e

Browse files
authored
Merge pull request #73 from takahiroanno2024/feature/report
階層型クラスタリング:分析手法にサマリーを追加
2 parents 3d98d87 + ca5358f commit 300508e

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

scatter/report/app/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ body {
22
font-family: 'Roboto', 'Noto Sans JP', sans-serif;
33
margin: 0;
44
border: 0;
5-
background: linear-gradient(to bottom right, #f9c8a0, #f7c5da);
5+
background: linear-gradient(to right, #f9c8a0, #f7c5da);
66
padding: 1rem 0;
77
min-height: 100vh;
88
text-align: justify;

scatter/report/components/Analysis.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import {Result} from '@/type'
4-
import {Box, Button, Heading, HStack, Separator, Text} from '@chakra-ui/react'
4+
import {Box, Button, Heading, HStack, Icon, Separator, Text, VStack} from '@chakra-ui/react'
55
import {
66
TimelineConnector,
77
TimelineContent,
@@ -10,7 +10,12 @@ import {
1010
TimelineRoot,
1111
TimelineTitle
1212
} from '@/components/ui/timeline'
13-
import {CircleArrowDownIcon} from 'lucide-react'
13+
import {
14+
ChevronRightIcon,
15+
CircleArrowDownIcon, ClipboardCheckIcon,
16+
MessageCircleIcon,
17+
MessagesSquareIcon,
18+
} from 'lucide-react'
1419
import {
1520
DrawerBackdrop, DrawerBody,
1621
DrawerContent, DrawerFooter,
@@ -30,8 +35,27 @@ export function Analysis({result}: ReportProps) {
3035

3136
return (
3237
<Box mx={'auto'} maxW={'750px'} mb={12}>
33-
<Separator my={12} />
38+
<Separator mt={20} mb={12} />
3439
<Heading textAlign={'center'} fontSize={'xl'} mb={5}>Analysis</Heading>
40+
<HStack mb={5} justify={'center'}>
41+
<VStack gap={0} w={'200px'}>
42+
<Icon mb={2}><MessageCircleIcon size={'30px'} /></Icon>
43+
<Text fontSize={'3xl'} fontWeight={'bold'} lineHeight={1} mb={1}>{Object.keys(result.comments).length.toLocaleString()}</Text>
44+
<Text fontSize={'xs'}>意見が含まれるコメント数</Text>
45+
</VStack>
46+
<ChevronRightIcon />
47+
<VStack gap={0} w={'200px'}>
48+
<Icon mb={2}><MessagesSquareIcon size={'30px'} /></Icon>
49+
<Text fontSize={'3xl'} fontWeight={'bold'} lineHeight={1} mb={1}>{result.arguments.length.toLocaleString()}</Text>
50+
<Text fontSize={'xs'}>AIが抽出した意見数</Text>
51+
</VStack>
52+
<ChevronRightIcon />
53+
<VStack gap={0} w={'200px'}>
54+
<Icon mb={2}><ClipboardCheckIcon size={'30px'} /></Icon>
55+
<Text fontSize={'3xl'} fontWeight={'bold'} lineHeight={1} mb={1}>{result.clusters.length.toLocaleString()}</Text>
56+
<Text fontSize={'xs'}>AIが集約したクラスター数</Text>
57+
</VStack>
58+
</HStack>
3559
<Text mb={5}>{result.config.intro}</Text>
3660
<Box>
3761
<Heading fontSize={'md'} mb={5}>分析手順</Heading>

scatter/report/components/ClientContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function ClientContainer({resultSize, meta, children}: PropsWithChildren<
7777
return (
7878
<>
7979
<LoadingBar loaded={loadedSize} max={resultSize} />
80-
<Skeleton height="516px" mb={5} mx={'auto'} w={'100%'} maxW={'1200px'} />
80+
<Skeleton height="534px" mb={5} mx={'auto'} w={'100%'} maxW={'1200px'} />
8181
{ children }
8282
<LoadingBar loaded={loadedSize} max={resultSize} />
8383
</>

scatter/report/components/ClusterOverview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Cluster} from '@/type'
22
import {Box, Heading, Icon, Text} from '@chakra-ui/react'
3-
import {MessageSquareIcon} from 'lucide-react'
3+
import {MessagesSquareIcon} from 'lucide-react'
44

55
type Props = {
66
cluster: Cluster
@@ -11,7 +11,7 @@ export function ClusterOverview({cluster}: Props) {
1111
<Box mx={'auto'} maxW={'750px'} mb={12}>
1212
<Box mb={2}>
1313
<Heading fontSize={'2xl'} className={'headingColor'} mb={1}>{cluster.label}</Heading>
14-
<Text fontWeight={'bold'}><Icon mr={1}><MessageSquareIcon size={20} /></Icon>{cluster.value}コメント</Text>
14+
<Text fontWeight={'bold'}><Icon mr={1}><MessagesSquareIcon size={20} /></Icon>{cluster.value}意見</Text>
1515
</Box>
1616
<Text>{cluster.takeaway}</Text>
1717
</Box>

scatter/report/components/Overview.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {Box, Heading} from '@chakra-ui/react'
1+
import {Box, Heading, Icon, Text} from '@chakra-ui/react'
22
import {Result} from '@/type'
3+
import {MessagesSquareIcon} from 'lucide-react'
34

45
type Props = {
56
result: Result
@@ -9,7 +10,8 @@ export function Overview({result}: Props) {
910
return (
1011
<Box mx={'auto'} maxW={'750px'} mb={5}>
1112
<Heading textAlign={'center'} fontSize={'xl'} mb={5}>Report</Heading>
12-
<Heading as={'h2'} size={'4xl'} mb={5} className={'headingColor'}>{result.config.question}</Heading>
13+
<Heading as={'h2'} size={'4xl'} mb={2} className={'headingColor'}>{result.config.question}</Heading>
14+
<Text fontWeight={'bold'} fontSize={'xl'} mb={2}><Icon mr={1}><MessagesSquareIcon size={20} /></Icon>{result.arguments.length}意見</Text>
1315
<p>{result.overview}</p>
1416
</Box>
1517
)

0 commit comments

Comments
 (0)