| 10 | export default async function MethodologyPage() { |
10 | export default async function MethodologyPage() { |
| 11 | const m = await safe(api.methodology()); |
11 | const m = await safe(api.methodology()); |
| 12 | const bands = Array.isArray(m?.significance_bands) ? m.significance_bands : m?.significance_bands ? Object.entries(m.significance_bands).map(([label, [min, max]]) => ({ label, min, max })) : []; |
12 | const bands = Array.isArray(m?.significance_bands) ? m.significance_bands : m?.significance_bands ? Object.entries(m.significance_bands).map(([label, [min, max]]) => ({ label, min, max })) : []; |
| 13 | − const labels = m?.confidence_labels ? (Array.isArray(m.confidence_labels) ? m.confidence_labels.map((l) => [l, ''] as const) : Object.entries(m.confidence_labels)) : []; |
13 | + const labels: ReadonlyArray<readonly [string, string]> = m?.confidence_labels |
| |
14 | + ? Array.isArray(m.confidence_labels) |
| |
15 | + ? m.confidence_labels.map((l) => (typeof l === 'string' ? ([l, ''] as const) : ([l.label, l.min_confidence != null ? `confidence ≥ ${Math.round(l.min_confidence * 100)} %` : ''] as const))) |
| |
16 | + : Object.entries(m.confidence_labels).map(([k, v]) => [k, String(v)] as const) |
| |
17 | + : []; |
| 14 | return ( |
18 | return ( |
| 15 | <Container> |
19 | <Container> |
| 16 | <PageHeader eyebrow="Methodology" title="Reproducible metrics over observed public pages" lede="Every metric value on the site carries a formula version, its inputs and a computation time. Formula versions bump whenever weights or normalisation change, so historical values remain reproducible." /> |
20 | <PageHeader eyebrow="Methodology" title="Reproducible metrics over observed public pages" lede="Every metric value on the site carries a formula version, its inputs and a computation time. Formula versions bump whenever weights or normalisation change, so historical values remain reproducible." /> |