// Tiny dependency-free horizontal bar for inline charts (leaderboard species view, // cross-model analysis, data page). Value in [0,1] by default; optional min–max // whisker overlaid on the bar. Purely presentational, theme-aware via CSS vars. interface BarRowProps { label: string value: number | null min?: number | null max?: number | null /** domain max (default 1) */ domain?: number /** bar fill color CSS var name, e.g. 'var(--accent)' */ color?: string /** show the numeric value at the end */ showValue?: boolean /** right-side annotation (e.g. species name) */ note?: string labelWidth?: number /** format the numeric value (default: 3 decimals) */ format?: (v: number) => string } export default function BarRow({ label, value, min, max, domain = 1, color = 'var(--accent)', showValue = true, note, labelWidth = 150, format = (v) => v.toFixed(3), }: BarRowProps) { const pct = value == null ? 0 : Math.max(0, Math.min(100, (value / domain) * 100)) const hasWhisker = min != null && max != null && max > min return (