Skip to content

Commit ec769ca

Browse files
committed
style: make charts page fit in viewport
Reduce chart heights, padding, and gaps to fit 2x2 grid in single viewport without scrolling.
1 parent 342b078 commit ec769ca

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/app/analysis/[id]/charts/page.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ export default function ChartsPage() {
1919

2020
if (isLoading) {
2121
return (
22-
<div className="grid grid-cols-2 gap-6">
23-
<Skeleton className="h-80" />
24-
<Skeleton className="h-80" />
25-
<Skeleton className="h-80" />
26-
<Skeleton className="h-80" />
22+
<div className="grid grid-cols-2 gap-3">
23+
<Skeleton className="h-52" />
24+
<Skeleton className="h-52" />
25+
<Skeleton className="h-52" />
26+
<Skeleton className="h-52" />
2727
</div>
2828
);
2929
}
3030

3131
if (error || !analysis) {
3232
return (
33-
<div className="flex items-center justify-center h-96">
33+
<div className="flex items-center justify-center h-64">
3434
<div className="text-center">
3535
<h2 className="text-lg font-semibold text-[#1E3A5F] mb-2">
3636
Charts Unavailable
@@ -47,25 +47,25 @@ export default function ChartsPage() {
4747
{
4848
title: "Sentiment Distribution",
4949
description:
50-
"How comments are distributed across sentiment categories. A balanced positive-to-negative ratio indicates healthy audience engagement.",
50+
"Comment distribution across sentiment categories.",
5151
chart: <SentimentPie sentiment={analysis.sentiment} />,
5252
},
5353
{
5454
title: "Engagement by Category",
5555
description:
56-
"Total likes received by each sentiment type. High engagement on positive comments suggests strong content resonance.",
56+
"Total likes by sentiment type.",
5757
chart: <EngagementBar sentiment={analysis.sentiment} />,
5858
},
5959
{
6060
title: "Topic Overview",
6161
description:
62-
"Visual representation of detected topics sized by mention frequency. Larger bubbles indicate more frequently discussed themes.",
62+
"Topics sized by mention frequency.",
6363
chart: <TopicBubble topics={analysis.topics} />,
6464
},
6565
{
6666
title: "ML Confidence",
6767
description:
68-
"Distribution of model confidence scores. Higher concentration toward 1.0 indicates more reliable classifications.",
68+
"Model confidence score distribution.",
6969
chart: (
7070
<ConfidenceHistogram
7171
avgConfidence={analysis.ml_metadata?.avg_confidence || 0.85}
@@ -76,27 +76,27 @@ export default function ChartsPage() {
7676
];
7777

7878
return (
79-
<div className="space-y-6">
79+
<div className="space-y-3">
8080
<div className="reveal stagger-1">
81-
<h2 className="text-xl font-display font-semibold text-[#1E3A5F] mb-2">
81+
<h2 className="text-lg font-display font-semibold text-[#1E3A5F]">
8282
Analysis Charts
8383
</h2>
84-
<p className="text-[#6B7280]">
85-
Visual breakdown of sentiment distribution, engagement, and ML metrics.
84+
<p className="text-xs text-[#6B7280]">
85+
Visual breakdown of sentiment, engagement, and ML metrics.
8686
</p>
8787
</div>
8888

89-
<div className="grid grid-cols-2 gap-6">
89+
<div className="grid grid-cols-2 gap-3">
9090
{chartPanels.map((panel, index) => (
9191
<div
9292
key={panel.title}
93-
className={`rounded-xl border border-[#E8E4DC] bg-white p-6 shadow-sm reveal stagger-${index + 2}`}
93+
className={`rounded-lg border border-[#E8E4DC] bg-white p-3 shadow-sm reveal stagger-${index + 2}`}
9494
>
95-
<h3 className="text-lg font-semibold text-[#1E3A5F] mb-2">
95+
<h3 className="text-sm font-semibold text-[#1E3A5F] mb-1">
9696
{panel.title}
9797
</h3>
98-
<div className="h-64 mb-4">{panel.chart}</div>
99-
<p className="text-sm text-[#6B7280] leading-relaxed">
98+
<div className="h-40">{panel.chart}</div>
99+
<p className="mt-1 text-[10px] text-[#6B7280] leading-tight">
100100
{panel.description}
101101
</p>
102102
</div>

0 commit comments

Comments
 (0)