Skip to content

SeriesChart: tooltip and window dates print at the series cadence - #581

Open
BhattaraiSijan wants to merge 1 commit into
developmentfrom
feat/timeseries-cadence-chart
Open

BhattaraiSijan wants to merge 1 commit into
developmentfrom
feat/timeseries-cadence-chart

Conversation

@BhattaraiSijan

Copy link
Copy Markdown
Collaborator

Summary

Second half of the series cadence (#579). That PR declares the cadence in the layer's timeseries block and makes the range pickers step at it. The chart still printed every time as a date only, hardcoded in #569 for the daily Air4US series, so an hourly series lost its clock and a monthly one showed a day that meant nothing.

The cadence now travels on the chart-series payload, and the chart prints the tooltip title and the zoom window's end dates at that precision: Feb 28, 2026, 14:00 for hour, Feb 28, 2026 for day, Feb 2026 for month, 2026 for year. A payload without one prints the date, today's behavior. Axis ticks are untouched.

FetchTimeseries sends cadence only when the layer declares a readable one. An unset layer keeps both of today's defaults, hourly pickers and a date-only chart, rather than switching the chart to clocks.

What's in the diff

  • _shared/types/chartSeries.ts: ChartCadence and cadence? on the payload; the guard rejects a value outside the four words, like any other malformed payload.
  • FetchTimeseries/lib/timeseries.ts: buildPayload copies the parsed config cadence onto the payload, lowercased, when there is one.
  • SeriesChart/lib/chartData.ts: formatTooltipTime(ms, cadence) over one formatter per cadence; buildChart and buildChartOption take the cadence and hand it to the tooltip and the window labels.
  • SeriesChart/lib/components/SeriesChartPanel.tsx: the canvas receives payload.cadence.
  • READMEs for both plugins.
  • Tests: chartSeries.spec.js (accepted word, rejected word), seriesChartData.spec.js (each cadence's format, the hourly tooltip title, window dates by month and by hour), fetchTimeseries.spec.js (declared cadence rides, unreadable or absent is not sent), fetchTimeseriesTool.spec.js (the emitted payload carries it, and nothing when unset).

Merge order

Stacked on #579 and targets its branch; retarget to development once #579 merges. Independent of the CSV name PR, though both touch chartData.ts and the panel on nearby lines, so whichever lands second gets a small rebase.

Testing

  • npm run test:unit green (210 files, 3602 tests) and tsc --noEmit clean.
  • Manual, on the Air4US mission: with the PM2.5 layer's Cadence set to "day" (from FetchTimeseries: a series cadence, and range pickers that step at it #579), click a site and press the time series action. Expect the tooltip titled Feb 28, 2026 and date-only window labels, as today. Set Cadence to "hour", save, reload, press again: the tooltip reads Feb 28, 2026, 00:00 and the window labels carry the clock. Set it to "month": Feb 2026.

Not in this PR

  • Axis ticks still pick their own format from the visible span.
  • Other fetchers (the AOI statistics chart) send no cadence and keep the date-only chart until they set one.

🤖 Generated with Claude Code

@BhattaraiSijan
BhattaraiSijan force-pushed the feat/timeseries-cadence-chart branch from 4d15778 to 7aa3e2a Compare October 19, 2026 16:15
@BhattaraiSijan
BhattaraiSijan changed the base branch from feat/timeseries-cadence to development October 19, 2026 16:15

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