import { INK } from '@/lib/chart' import type { Pair } from '@/lib/types' const MIN = -0.1 const MAX = 0.5 const TICKS = [0, 0.1, 0.2, 0.3, 0.4, 0.5] /** Paired comparisons: for each pair, the accuracy difference on the SAME questions as * a dot with its 95% interval, against a zero line; beside it what changed (fixed / * broken) and McNemar's p. A difference to a baseline is a dot-and-interval form, in * ink, not a system colour (each row is a pair, not a system). */ export function PairsPlot({ pairs }: { pairs: Pair[] }) { const x = (v: number) => ((v - MIN) / (MAX - MIN)) * 100 // percent of the track return (
{TICKS.map((t) => ( {t === 0 ? '0' : `+${Math.round(t * 100)}`} ))}
{pairs.map((p) => { const [low, high] = [p.ci[0] ?? p.diff, p.ci[1] ?? p.diff] return (
{p.new.toUpperCase()} vs {p.base.toUpperCase()} {p.primary && declared} {TICKS.map((t) => ( ))} +{Math.round(p.diff * 100)} points (95% interval +{Math.round(low * 100)} to +{Math.round(high * 100)}) +{Math.round(p.diff * 100)} pts · {p.fixed} fixed ·{' '} {p.broken} broken · p {p.p < 0.001 ? '< 0.001' : `= ${p.p.toFixed(3)}`}
) })}

Accuracy difference in points on the same questions; the line is the 95% interval.

) }