"use client"; import React from "react"; import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Cell, } from "recharts"; interface QValuesGraphProps { qValues: Record; selectedAction?: string; handlingScore?: number; } const ACTION_LABELS: Record = { explain: "Explain", correct_fact: "Correct", worked_example: "Example", analogize: "Analogy", question: "Query", }; const ACTION_COLORS: Record = { explain: "#6366f1", correct_fact: "#22d3ee", worked_example: "#10b981", analogize: "#8b5cf6", question: "#f59e0b", }; export default function QValuesGraph({ qValues, selectedAction, handlingScore = 85 }: QValuesGraphProps) { const data = Object.entries(qValues).map(([key, value]) => ({ name: ACTION_LABELS[key] || key, id: key, q: +value.toFixed(2), })); return (
DQN STRATEGY CONFIDENCE (Q-VALUES)
{selectedAction && (
SELECTED: {ACTION_LABELS[selectedAction].toUpperCase()}
)}
{data.map((entry, index) => ( ))}
{/* Handling Score Bar */}
HYBRID HANDLING SCORE {handlingScore}%
); }