School Ranking
Every school in the trust ranked on one measure, as bars against the trust average (and an optional benchmark), with a Data view. The trust-level counterpart of Metric Insight.
Live example
Athena Learning Trust's nine schools on Overall complexity, from TRUSTS — hover a row, flip the sort, try DataOverall complexity
Mean of the seven complexity dimensions (0–10). Higher = a more challenging context.EdCo data mapping — proposed
Proposed reading of the 21-column Metrics shape for a per-organisation frame. Nothing in EdCo's data describes this widget yet; this is the mapping the spec would need to confirm.
| Visual | Shape column | Contract field | Row | Notes |
|---|---|---|---|---|
| Family label and icon | DataFamily / DefaultIcon | family | any | Same for every row of the frame. |
| Title | DataCategory | name | any | The measure, e.g. Overall complexity. |
| Row: school name | SubjectLabel | schools[].name | one per school | |
| Row: link | SubjectRecordID | schools[].href | one per school | SPIRIT OrgID → the school's record URL. |
| Row: bar and figure | AbsoluteValue | schools[].<measure> | one per school | Formatted by the caller. |
| Data view: phase, pupils | ValueContext / SubjectType | schools[].phase, .roll | one per school | Needs confirming — the Metrics shape has no phase or roll column. |
| Trust average line | AbsoluteValue | average | trust cohort row | A row with CohortID = trust, or computed by the mapping layer. |
| Benchmark line | AbsoluteValue | benchmark.value | national cohort row | Optional. |
Widget elements and their frames
What tblWidgetElements would hold for this widget, and the kind of frame each element takes.
| Element | Shape | Frame it takes | Notes |
|---|---|---|---|
| Ranking | Metrics | A one-measure frame returning one row per organisation in the trust (SubjectType = Organisation), plus optional cohort rows for the trust and national references. | The unit is the school, not the cohort — the opposite of Metric Insight, where one organisation is compared against cohorts. |
Dependencies
Component: app/components/trust/SchoolRanking.vue
Explicit imports
Imported at the top of the component.
FamilyKey, LensKey (types)—~/data/widgetsThe data family (drives the header identity and the bar hue) and the lens (how to read a high value).DATA_FAMILIES—~/data/widgetsApp-level config: the family's label, icon and colour token. Stays in the app — not API data.TrustSchool (type)—~/data/trustsThe row type: id, name, href, phase, roll, plus whatever the `value` accessor reads.WidgetMode (type)—~/utils/typesThe "desktop" | "data" mode union for the home/table toggle.cssVar—~/utils/identityResolves the family colour token to a CSS variable for the bar fill (500 for the highlighted school, 300 for the rest).cn—~/utils/cnConditional class names.
Auto-imported components (Nuxt)
No import lines — Nuxt resolves these (flat names, pathPrefix: false). A port to another stack must import them explicitly.
WidgetShell—widgets/parts/WidgetShell.vueShared chrome: family header, definition tooltip, the sort toggle in the meta slot, and the home/Data mode toggle in the footer.NuxtLink—nuxtEach school name links to its record (`href`).UIcon—@nuxt/iconSort-direction arrows.
Framework APIs
Auto-imported by Nuxt; from 'vue' in a plain Vue build.
ref, computed—vueInternal state only — mode, sort direction, show-all, and the ranked/scaled rows. None of it needs the API.
Input contract — schools: TrustSchool[] + value accessor
Defined in app/data/trusts.ts. One row per organisation; the ranked measure is read through the `value` prop, so the same component serves every ranking on the trust page.
| Field | Type | Notes |
|---|---|---|
| name | string | Widget title, e.g. "Overall complexity". |
| family | FamilyKey | Data family ("demographics", "financial"…) — header identity and bar colour. |
| lens | LensKey? | How to read a high value ("complexity"…) — shown under the title. |
| definition | string | Plain-English definition for the header tooltip. |
| schools[] | TrustSchool[] | One entry per organisation in the trust. The widget reads id, name, href, phase and roll directly. |
| schools[].<measure> | number | null | The ranked measure, read via the `value` accessor. null = not available, shown as — and sorted last. |
| average | number? | The trust reference line (dashed). Caller decides: mean or pupil-weighted. |
| benchmark | { label, value }? | An external reference line (dotted), e.g. national. |
Props & events
| Prop | Type | Notes |
|---|---|---|
| value | (s: TrustSchool) => number | null | Accessor for the ranked measure. With an API, map the response so this reads a single field. |
| format | (v: number) => string | Formats the figure for display (e.g. toFixed(1), fmtGBP). |
| averageLabel | string? | Default "Trust average". |
| highlightId | string? | Row to emphasise — shared hover state across the page's widgets and the map. |
| limit | number? | Rows before "Show all N". Default 6. (Builder setting: Rows before scrolling.) |
| ascending | boolean? | Start lowest-first (e.g. reserves). The header toggle flips it. |
| drillable | boolean? | Marks the widget as having a drill-through; emits "drill". |
| @hover | (id: string | null) | Emitted as the pointer enters/leaves a row, for cross-highlighting. |
Wiring it to the API
- One call returns one row per organisation in the trust; the widget sorts, ranks and scales client-side. The scale always starts at 0 (never a truncated axis) and extends to the largest of the values and the reference lines.
- The trust average is passed in, not computed by the widget, so the API (or the mapping layer) decides whether it's a mean or pupil-weighted. If the frame returns a trust-level row (CohortID = trust), use that.
- The Data view is derived from the same rows — no second call.
- Hover is emitted, not kept: the page owns highlightId so the map, matrix and rankings highlight together.
- Formatting is the caller's job (format prop); the widget never parses numbers.
For the spec to decide
- Is a 'rows per organisation' frame a different kind of frame in EdCo's model, or the same frame queried for a trust? The spreadsheet's frames are all written from one organisation's point of view.
- Where do phase and pupils on roll come from for the Data view? They aren't in the Metrics shape; either add columns or let the widget look them up from the organisation record.
- Is the trust average supplied as a cohort row (CohortID = trust) or computed? Pupil-weighted versus mean matters for per-pupil measures.
- Should the per-row link go to the school's record in the CRM, or to the school's Education IQ dashboard?

