From 8f2805f664d009bcf45e8dbd1241c4ac1b0fd664 Mon Sep 17 00:00:00 2001 From: Dylan De Faoite Date: Tue, 10 Feb 2026 14:13:48 +0000 Subject: [PATCH] fix(frontend): average emotion not being the main card item --- frontend/src/components/EmotionalStats.tsx | 45 +--------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/frontend/src/components/EmotionalStats.tsx b/frontend/src/components/EmotionalStats.tsx index 5e8d356..62b9605 100644 --- a/frontend/src/components/EmotionalStats.tsx +++ b/frontend/src/components/EmotionalStats.tsx @@ -1,14 +1,3 @@ -import { - BarChart, - Bar, - XAxis, - YAxis, - Tooltip, - CartesianGrid, - ResponsiveContainer, - Legend -} from "recharts"; - import type { ContentAnalysisResponse } from "../types/ApiTypes" import StatsStyling from "../styles/stats_styling"; @@ -24,16 +13,6 @@ const EmotionalStats = ({contentData}: EmotionalStatsProps) => { ? Object.keys(rows[0]).filter((key) => key.startsWith("emotion_")) : []; - const colors = ["#2563eb", "#f59e0b", "#10b981", "#ef4444", "#8b5cf6", "#14b8a6"]; - - const chartData = rows.map((row) => { - const topic = String(row.topic); - return { - ...row, - topicLabel: topic.length > 20 ? `${topic.slice(0, 20)}...` : topic - }; - }); - const strongestPerTopic = rows.map((row) => { let maxKey = ""; let maxValue = Number.NEGATIVE_INFINITY; @@ -68,34 +47,14 @@ const EmotionalStats = ({contentData}: EmotionalStatsProps) => {

Average Emotion by Topic

Mean emotion scores for each detected topic

- - {/*
- - - - - - - - {emotionKeys.map((key, index) => ( - - ))} - - -
*/}
{strongestPerTopic.map((topic) => (

{topic.topic}

-

Top emotion: {topic.emotion}

-
{topic.value.toFixed(3)}
+
Top emotion: {topic.emotion}
+

Model Confidence: {topic.value.toFixed(3)}

Based on {topic.count} events