import { Bar, BarChart, Cell, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; import type { BatchResult } from "../api"; const LABEL_COLOR: Record = { negative: "#ef4444", neutral: "#94a3b8", positive: "#10b981", }; /** * Two views of the same batch: label counts (how many rows landed in each * class) and mean softmax scores (how confident the model was on average). * Both matter — 100 barely-positive rows and 100 emphatic ones have the * same counts but very different mean scores. */ export default function AggregateCharts({ aggregates }: { aggregates: BatchResult["aggregates"] }) { const countData = Object.entries(aggregates.counts).map(([label, count]) => ({ label, count })); const meanData = Object.entries(aggregates.mean_scores).map(([label, mean]) => ({ label, mean })); return (

Sentiment counts

{countData.map((d) => ( ))}

Mean confidence per class

{meanData.map((d) => ( ))}
); }