Compositions · Preview · requirements · design · tasks

Quake counts - Design

Approach

Same shape as feature-felt-reports@1: a server-rendered intensity table the

module patches in place. The differences that matter are the data source (quake

feed, not intensity), the marker shape (circles, matching beta), and the need to

filter a one-hour window client-side because /quake?MMI=3 returns more history

than an hour.

Slots used

SlotFragmentWhy
heroslots/hero.htmlPage title and callout to the full earthquake list
bodyslots/body.htmlSummary and intensity table

Config

KeyDefaultWhy it is a knob
headingQuakes in the last hourWording shifts when the block sits under a shared "Shaking" heading
endpointhttps://api.geonet.org.nz/quake?MMI=3Point a preview at a stand-in host without editing JavaScript

Markup

Follows the Quakes half of the beta home felttable:

Data flow

1. Module looks for script[type="application/json"][data-strata-fixture="feature-quake-counts"].

2. If present, summarise(fixture, { now: fixtureNow(fixture) }) and paint. No fetch (R7).

3. If absent, fetch data-endpoint, then summarise(collection) with Date.now().

4. summarise() skips quality: deleted, skips times outside the hour window, skips

MMI below 3, clamps MMI 9+ into 8 (R3–R5).

5. paint() writes counts, toggles .-empty, fills the summary (R2, R6).

6. setStatus() writes one message into the live region (R8).

fixtureNow() returns one millisecond after the newest feature time so a fixture's

internal timeline stays coherent forever. An empty fixture falls back to Date.now().

Tokens and styling

Only base tokens. Circle fills come from beta marker.css / the base fallback MMI

palette. Counts use font-variant-numeric: tabular-nums.

Accessibility

Handoff notes

the hour filter and deleted exclusion already happen server-side in home.go;

the Go template would range over pre-bucketed counts.

felt reports.

own slice, or lift both halves into one template.

Rejected alternatives

rollup, so five-figure counts would mean a multi-megabyte fixture. Layout stress

for large numbers is already covered by feature-felt-reports@1's overflow

state; this slice uses a lean busy fixture instead.

days of history; without the filter the table would not match the home page.