Compositions · Preview · requirements · design · tasks

Quake counts - Requirements

Problem

Someone opens GeoNet after feeling a shake, or after hearing that something

happened. They want to know whether an earthquake was recorded and how strong it

was. The beta home page answers this in the Quakes column of a combined intensity

table. This slice isolates that column so it can be reviewed and reused on its

own.

Quake counts are instrument detections, not public felt reports. The design must

not blur that line: circles for quakes, squares for reports.

In scope

Intensity.

Out of scope

composition owns that assembly.

Data

Source: https://api.geonet.org.nz/quake?MMI=3, a GeoJSON FeatureCollection.

Unlike the intensity feed, this endpoint returns more than an hour of history, so

aggregation filters in the module.

FieldSourceNotes
Per-intensity countsderivedFeatures in the last hour, quality not deleted, MMI ≥ 3
Total quakesderivedSum of those counts
StrongestderivedHighest MMI with a non-zero count
Time windowproperties.timeLive: last hour from Date.now(). Fixture: last hour from newest feature + 1ms

Requirements

1. R1 Show one row per intensity from Extreme (MMI 8) down to Weak (MMI 3),

with the GeoNet label and a circle swatch (not a square).

2. R2 Rows with zero quakes stay visible and de-emphasised.

3. R3 Exclude MMI below 3 and events with quality: deleted.

4. R4 Fold MMI 9 and above into Extreme, matching the home page clamp.

5. R5 Count only events whose time falls in the last hour.

6. R6 Show total quakes and strongest intensity as a summary above the table.

7. R7 Use live API data on the default preview; use inlined fixture data on a

state preview, with no network call. Fixture time windows are relative to the

newest event in the payload so fixtures stay reviewable.

8. R8 Announce the outcome once through a polite live region, including a

distinct message for the empty case.

9. R9 Never rely on colour alone to convey intensity.

10. R10 Reuse the beta felttable / geonet-table markup and circle

marker-mmi sizes so the fragment can be lifted into a Go template unchanged.

States

StateTriggerExpected
LoadingInitial render before fetch resolvesTable present with em-dash placeholders; status reads "Loading quakes…"
PopulatedLive fetch returns quakes in the last hourCounts filled, summary filled, status names the total
Emptyempty fixture, or a quiet hourAll rows zero; status reads no-quakes message; strongest reads "None"
Busybusy fixtureSeveral rows filled; deleted and out-of-window events ignored
Extremeextreme fixtureMMI 9 folded into Extreme; MMI 2 excluded; total is 3
ErrorFetch rejects or non-2xxStatus explains the failure; placeholders remain

Acceptance

npm run build emits the live preview and all three fixture previews

Aggregation verified against fixtures (empty, busy, extreme)

MMI 9 clamp and deleted/out-of-window exclusion verified

Reviewed on the preview URL by a second person

Checked at 320px wide and 400% zoom