import React, { useState } from 'react'; const BoxPlotComparisonWidget: React.FC = () => { // Box Plot A is fixed const statsA = { min: 10, q1: 18, med: 24, q3: 30, max: 42 }; // Box Plot B is adjustable const [shift, setShift] = useState(0); // Shift median const [spread, setSpread] = useState(1); // Scale spread const statsB = { min: 10 + shift - (5 * (spread - 1)), // Just approximating visual expansion q1: 16 + shift - (2 * (spread - 1)), med: 26 + shift, q3: 34 + shift + (2 * (spread - 1)), max: 38 + shift + (4 * (spread - 1)) }; const scaleX = (val: number) => (val / 60) * 100; // 0 to 60 range mapping to % const BoxPlot = ({ stats, color, label }: { stats: any, color: string, label: string }) => { const leftW = scaleX(stats.min); const rightW = scaleX(stats.max); const boxL = scaleX(stats.q1); const boxR = scaleX(stats.q3); const med = scaleX(stats.med); return (