Skip to content

FetchTimeseries: date-range card, CQL2 range filter, one event out - #493

Open
BhattaraiSijan wants to merge 5 commits into
feat/fetch-timeseriesfrom
feat/fetch-timeseries-range
Open

BhattaraiSijan wants to merge 5 commits into
feat/fetch-timeseriesfrom
feat/fetch-timeseries-range

Conversation

@BhattaraiSijan

Copy link
Copy Markdown
Collaborator

Summary

FetchTimeseries gets a card: Start and End dates, over the fetch it already does. Stacked on #294; merge that first.

Why. The viewer needs to choose the period a station's series covers, and the fetcher was a no-UI tool that could only fetch whatever the URL returned.

What changes

  • A card. The tool starts hidden. When a station's Timeseries button is pressed it shows itself, titled with the feature and the layer, with Start and End dates seeded from the mission time window, or the past year when the mission has none. Changing a date refetches the same feature over the new range and the chart replaces its card. A start past the end drags the end along, and the reverse.
  • The range on the URL. Appended as a CQL2 text filter on the layer's time property (xKey, default datetime), inclusive of both days: filter=datetime >= '2018-01-01T00:00:00' AND datetime <= '2019-12-31T23:59:59'&filter-lang=cql2-text. The standard datetime=start/end parameter is not used: every collection on the dev features API stores its date columns as text and refuses it ("Must have timestamp typed column"), while the string comparison works on all of them. Verified against the AQS collection: 8 of 24 rows for 2018–2019.
  • One event out. Loading and failure now show on the card, so the fetcher emits only seriesReady (and seriesCleared on teardown). SeriesChart is untouched and keeps accepting all four events, so any other fetcher still works.

Place FetchTimeseries in the same panel as SeriesChart, listed just before it, so the card sits above the chart. Tool metadata gains an icon and a width, which the runtime reads from the mission config's tool entry.

Testing

tests/unit/fetchTimeseries.spec.js gains withDateRange cases (clause, encoding, ? vs &, custom time key without the properties. prefix). tests/unit/fetchTimeseriesTool.spec.js is rewritten around the card: the fetch event shows the tool and fetches with the past-year filter; time-enabled missions seed from the time window; the filter uses the configured time property; a date change refetches and emits again; reversed dates clamp; a change before any pick fetches nothing; HTTP error, bad template and timeout show on the card and emit nothing; abort on supersede; destroy clears. Full unit suite and TypeScript check green.

Manual, on the Air4US mission: click a station, press Timeseries; the card appears with the dates, the chart under it; set 2018-01-01 to 2019-12-31 and the network tab shows the filter= clause while the chart redraws with two points per parameter.

🤖 Generated with Claude Code

@BhattaraiSijan
BhattaraiSijan marked this pull request as draft September 24, 2026 19:38
@BhattaraiSijan
BhattaraiSijan force-pushed the feat/fetch-timeseries-range branch from 3f80146 to 2b04412 Compare September 24, 2026 20:19
@BhattaraiSijan
BhattaraiSijan marked this pull request as ready for review September 24, 2026 20:42
@slesaad
slesaad added this pull request to stack #295 September 25, 2026 21:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant