Education IQ
Embedded in Northwind CRM
N
Northwind CRM
Widget info
Widget info Β· developer handover

Metric Insight (Value Highlight)

One headline metric with its count qualifier, plus a lens ranking (home), cohort distribution and data-table view, switched by the footer toggle.

Live example

the Pupil Premium metric from VALUE_METRICS β€” fully interactive, try the 🏠 / Distribution / Data toggle
Student Demographics +1.8pp

Pupil Premium Students

The percentage of pupils eligible for Pupil Premium funding β€” a marker of a more disadvantaged intake.
39.4%99 of 251 students
Complexity rankingHigher = more challenging context. A higher percentile ranks this organisation nearer "More complex" within the comparison cohort.
64thpercentile

Higher = more challenging context.

EdCo data mapping β€” shape A (Metrics) β†’ this widget

From the Metric Insight Widget : Home / Cohort Comparison / Distribution Element slides in the Build Requirements deck and the 21-column Metrics shape (Data Shape - Metrics sheet). All three elements consume shape A; which columns each reads is fixed in the widget, and the chosen frame decides the rows (which metric, which cohorts). β€œRow” says which returned row supplies the value.

VisualShape A columnValueMetric fieldRowNotes
Topic iconDefaultIconfamily β†’ iconnational cohortThe prototype derives the icon from the family key; the API supplies it directly.
Data family labelDataFamilyfamilynational cohort
TitleDataCategorynamenational cohortThe metric. A frame returns one DataCategory, which is how the widget knows which metric to show.
Headline valueAbsoluteValue (or PercOfPupils / PerPupilValue, per ValueDataType)valuenational cohortPre-formatted by the mapping layer.
Count qualifier ("99 of 251 students")ContextMessagequalifiernational cohort
Change chipChangePPdelta + trendnational cohortSign gives trend; the lens decides whether that's favourable.
Lens (ranking colour)DataLenselensnational cohort
Lens description ("Higher = more challenging context")implied from DataLenseLENSES[lens].interpretationβ€”App configuration, not payload.
Percentile (ranking panel, histogram marker, table)Percentileneighbourhoods[].percentileone per cohort
Histogram barsPercentileDistributionneighbourhoods[].distone per cohortThe deck's example is "5,5,7,3,7,3,6,3 …" β€” bucket weights, any scale.
Cohort rows in the Data viewCohortIDneighbourhoods[].key / labelone per cohortThe deck shows the school's value repeated per row with the cohort's percentile; the contract keeps value at the top level.

Which frame feeds each element

The deck and JP's database agree on two of the three. Settings: none defined for this widget (tblWidgetProperties is empty).

ElementFrame per the deckFrame per JP's databaseNotes
HomePupil Premium StudentPupil Premium Students (77d88d4e…)Agree. One row: the school against the national cohort.
Cohort ComparisonsPupil Premium Students with cohort comparisons…Cohorts Comparisons (6e5b4216…)Agree. One row per CohortID; header figures from the national row.
DistributionPupil Premium Student…Cohorts Comparisons (6e5b4216…)Disagree. One frame is enough if the histogram is always national; the cohorts frame is needed if it changes with the section's cohort filter, as this prototype does. Open with EdCo.

Dependencies

Component: app/components/widgets/ValueHighlight.vue

Explicit imports

Imported at the top of the component.

  • LENSES β€” ~/data/widgetsApp-level config: lens colour and the interpretation line ('Higher = more challenging context') shown on every view. Stays in the app β€” not API data.
  • ValueMetric (type) β€” ~/data/widgetsThe input contract β€” the shape the API response must be mapped into.
  • SemanticColor, WidgetMode (types) β€” ~/utils/typesColour-token union and the "desktop" | "distribution" | "data" mode union.
  • valenceColor, trendTone β€” ~/utils/identityLens-aware colouring: variant mode colours by valence (good/bad), and the delta chip colours by whether the trend direction is favourable for this lens.

Auto-imported components (Nuxt)

No import lines β€” Nuxt resolves these from app/components/widgets/parts/ (flat names, pathPrefix: false). A port to another stack must import them explicitly.

  • WidgetShell β€” widgets/parts/WidgetShell.vueShared chrome: family header, definition tooltip, delta chip, and the home/Distribution/Data mode toggle in the footer.
  • Headline β€” widgets/parts/Headline.vueThe big value plus its qualifier β€” renders "99 of 251 students" (or a per-pupil figure) beside the headline.
  • RankingPanel β€” widgets/parts/RankingPanel.vueHome view: the tinted '64th percentile' lens ranking panel.
  • PercentileLine β€” widgets/parts/PercentileLine.vueDistribution view: the percentile read-out line above the histogram.
  • Histogram β€” widgets/parts/Histogram.vueDistribution view: the cohort distribution bars with this organisation's position marked.
  • DataGrid β€” widgets/parts/DataGrid.vueData view: the cohort / value / percentile table (also renders the interpretation line on that view).

Framework APIs

Auto-imported by Nuxt; from 'vue' in a plain Vue build.

  • ref, computed β€” vueInternal state only β€” the active mode and the resolved comparison cohort. None of it needs the API.

Input contract β€” metric: ValueMetric

Defined in app/data/widgets.ts. The API response for this widget maps to exactly this shape.

FieldTypeNotes
idstringStable id so a page-config slot can reference this metric.
namestringWidget title, e.g. "Pupil Premium Students".
familyFamilyKeyData family ("demographics", "financial"…) β€” drives the header identity and colours.
lensLensKeyHow to read a high value ("complexity", "success"…) β€” drives the ranking colour, interpretation line and trend valence.
definitionstringPlain-English definition shown in the header tooltip.
valuestringThe headline figure, pre-formatted: "39.4%", "Β£7.42m", "+0.31".
qualifierstring?Count-of-cohort sub-text beside the value, per client feedback: "99 of 251 students", "6 of 54 staff". The first token renders emphasised.
perPupilstring?Alternative qualifier for money metrics β€” renders as "Β£6.84k / pupil". Takes precedence over qualifier.
trend"up" | "down" | "flat"Direction of travel β€” the arrow in the header chip.
deltastringFormatted change, e.g. "+1.8pp". Coloured by whether the direction is favourable for the lens.
neighbourhoods[].keystringCohort key, e.g. "national-all" β€” matched against the page's section-level cohort filter.
neighbourhoods[].labelstringCohort label, e.g. "National Β· All schools".
neighbourhoods[].percentilenumberThis organisation's percentile within that cohort (0–100) β€” drives the ranking panel, distribution marker and data table.
neighbourhoods[].distnumber[]The cohort's distribution as 10 bucket weights (relative heights, any scale) for the histogram.

Props & events

PropTypeNotes
metricValueMetricThe payload (required) β€” see the contract.
neighbourhoodstring?Key of the cohort to show, usually from a section-level "Compared with" filter shared by every widget in the row. Defaults to the metric's first neighbourhood.
advancedboolean?Default true. False = the simplified card: headline only, no ranking panel, no mode toggle.
variantboolean?Default false. True = hide the lens identity and colour by valence instead (used in the Widget Lab's simplified row).
drillableboolean?Default false. Marks the widget as having a drill-through; it emits "drill" when triggered. (The footer "More" link was removed per client feedback, so currently nothing triggers it.)

Wiring it to the API

  • Replace the mock payload β€” the widget takes one `metric: ValueMetric` prop. In the prototype it's fed from VALUE_METRICS in ~/data/widgets.ts; the API should return one ValueMetric object per card.
  • All figures arrive pre-formatted as strings (value "39.4%", delta "+1.8pp", qualifier "99 of 251 students") β€” the component renders them verbatim and never parses them. Formatting is the API/mapping layer's job.
  • neighbourhoods carries one entry per comparison cohort, each with the organisation's percentile and the cohort's 10-bucket distribution. The three views (ranking, distribution, data) are all derived client-side from this one array β€” no further API calls after load.
  • The neighbourhood prop selects which cohort is displayed; pages share one section-level filter across a row of these widgets, so the API should return the same cohort keys for every metric on a page.
  • LENSES is app configuration, not API data β€” the payload only names its family and lens keys.
  • The widget emits a single optional "drill" event (only when drillable is set); there is currently no visible trigger for it.