import { memo } from 'react'; import { CLINICAL_COLORS } from './chartColors'; export interface BoxRow { label: string; p25: number; median: number; p75: number; n: number; } interface BoxPlotRowsProps { rows: BoxRow[]; /** 数值单位后缀,如 "天" / ""。 */ unit?: string; /** 标签列宽(px)。 */ labelWidth?: number; } /** * 横向箱线图(p25–中位–p75)。Recharts 无原生 box plot, * 故用纯 div 渲染:每行一条从 p25 到 p75 的横条,中位处一根竖向刻度。 * 复用于「各病种住院天数」与「年龄别BMI」。 */ export const BoxPlotRows = memo(function BoxPlotRows({ rows, unit = '', labelWidth = 96, }: BoxPlotRowsProps) { if (!rows || rows.length === 0) { return