feat(compare): at-a-glance, Ofsted, admissions and community sections

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146VHeLAWjDVE2B5uU67jCB
This commit is contained in:
Tudor
2026-07-13 23:49:17 +01:00
co-authored by Claude Fable 5
parent 60cbc3f46d
commit 9f2260ce50
8 changed files with 1117 additions and 2 deletions
+2 -2
View File
@@ -229,14 +229,14 @@ export function stripPositions(
/** Latest non-null yearly value of `metricKey` per school, in `urns` order. */
export function latestValues(
data: Record<string, { yearly_data: Array<Record<string, unknown> & { year: number }> }>,
data: Record<string, { yearly_data: Array<{ year: number }> }>,
urns: number[],
metricKey: string,
): Array<number | null> {
return urns.map((urn) => {
const rows = data[String(urn)]?.yearly_data ?? [];
for (let i = rows.length - 1; i >= 0; i--) {
const v = rows[i][metricKey];
const v = (rows[i] as Record<string, unknown>)[metricKey];
if (typeof v === 'number' && !Number.isNaN(v)) return v;
}
return null;