Two more metrics on the same chart, from the portal's new energy_wh and co2e_g
daily columns.
- Energy in watt-hours, carbon in grams CO2e, both for the day shown.
- Continuous metrics use the 1/2/5 axis rule (not the integer rule reserved for
counts), so energy ticks read 500 Wh rather than being rounded to whole
people-style numbers.
- Labels carry units, so a reader never has to guess what the axis measures.
- Same measured-vs-estimated provenance as the data layer: GreenPT models use
facts fitted from their own impact API, everyone else a labelled proxy. The
docs page on estimation is still to be written; the factor table and its
sources are in metrics_snapshot.py.
Harness extended: one bar per measured day for each, no NaN in markup, and axis
labels matching ^[\d,]+(\.\d+)? (Wh|g)$ so a unit prefix or a forced integer
axis fails the build.
Nathan: the disclaimers are not necessary, especially now that reporting is in
place going forward — and then, on the status line under it: remove that too.
Gone from both apps: the explanatory note paragraph, its per-metric config
strings, the status line ("55 days - 2 not measured"), the now-orphaned CSS for
both, and the gaps counter that only fed the status line. The period toggles
still say what range is on screen, so no information is lost.
The harness assertions that described the status line are replaced by stronger
ones: the rendered chart must contain no caveat text at all, and the 30-day view
must still end at the most recent measured day.
Members asked for charts to share with the co-op. This is the member-facing
half of it, in the view where co-op-wide data already lives.
- /api/metrics proxies the portal's new /broker/metrics (aggregate, non-personal:
co-op size, requests served, spend). No per-member figure is fetched.
- Same chart as the admin panel's Trends tab: inline SVG, no library, no CDN,
colours from the shared palette vars. Members / Requests / Spend, and
30 / 90 / all time, re-rendered client-side without refetching.
- Lazy: loads the first time someone opens the co-op view, so the dashboard's
initial load is unchanged.
- Gaps stay gaps. A day never measured breaks the line rather than reading as
zero members, with the sub-line saying how many days are missing.
- Integer y-axis for people and requests; 1/2/5 money ticks, per the panel fix.
Verified with the same node harness used for the panel (shared, so it asserts
the same invariants against the live series).
Replicates the admin-panel OIDC pattern: redirect/callback/token exchange
(client_secret_post) / JWKS validate / signed session cookie. get_user_identity()
prefers the OIDC session and falls back to the proxyAuth header. Adds /logout
route (was previously only a link). No manifest change yet.