Skip to content

Add "Zoom plot to map extent" button to Time Series tab#1078

Merged
cugarteblair merged 3 commits into
mainfrom
issue-1077-timeseries-zoom-to-map-extent
Jun 9, 2026
Merged

Add "Zoom plot to map extent" button to Time Series tab#1078
cugarteblair merged 3 commits into
mainfrom
issue-1077-timeseries-zoom-to-map-extent

Conversation

@cugarteblair

Copy link
Copy Markdown
Member

Summary

Closes #1077.

Adds the "Zoom plot to match visible map extent" control to the Time Series tab of the Analysis view. This is the mirror of the button that already exists on the Elevation Plot tab — it lets a user pan/zoom the map and then snap the time-series plot's x-axis to just the data inside the current map extent, streamlining the back-and-forth between map and profile.

Background

The reverse-direction feature ("zoom plot to map extent") was added for the Elevation Plot tab in #848, but the Time Series tab is a separate component (SrTimeSeries.vue) with its own hand-maintained toolbar, so the button was never carried over. There was no deliberate guard excluding it — just an oversight. For the common atl06/atl03 repeat-track case the time-series x-axis is along-track distance (x_atc), so the same map-extent → x-range mapping applies identically.

Changes (web-client/src/components/SrTimeSeries.vue)

  • pi pi-map toolbar button (aria-label="Zoom Plot to Map Extent"), disabled until a request is selected and the map has reported an extent
  • handleZoomPlotToMapExtent() handler, hasMapExtentData + zoomPlotToMapTooltip computeds — ported verbatim from SrElevationPlot.vue
  • New imports: getXRangeFromLatLonExtent (SrDuckDbUtils) and useSrToastStore. All other machinery (atlChartFilterStore, globalChartStore, callPlotUpdateDebounced) was already imported by the component.

Verification

Drove the production build through Playwright (Chromium) using the importFile fixture (atl03x, multi-cycle):

  • Button renders on the Time Series tab (accessibility snapshot + locator), enabled when a map extent is available — parity with the Elevation Plot tab.
  • Click → handleZoomPlotToMapExtentgetXRangeFromLatLonExtent (confirmed xField: x_atc) → sets zoom → callPlotUpdateDebounced → plot refresh. Verified via captured debug logs.
  • Empty-result path: clicking with the map zoomed off-track shows the graceful "No Data in Visible Map Area" toast — same behavior as the Elevation Plot tab.

Note

The button is also present for atl13x time series, whose x-axis is genuinely time. It remains wired there but its usefulness is less obvious; if we want to hide it for atl13x, the existing notAtl13xTimeSeries computed in the component can gate it.

🤖 Generated with Claude Code

cugarteblair and others added 3 commits June 9, 2026 07:21
Port the existing Elevation Plot control into SrTimeSeries.vue so users
can update the time-series x-axis to match the current map extent, the
mirror of the button already on the Elevation Plot tab.

Adds the pi pi-map toolbar button, the handleZoomPlotToMapExtent handler,
the hasMapExtentData / zoomPlotToMapTooltip computeds, and the
getXRangeFromLatLonExtent + srToast imports. All other machinery
(atlChartFilterStore, globalChartStore, callPlotUpdateDebounced) was
already imported by the component.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cugarteblair
cugarteblair merged commit 0558e90 into main Jun 9, 2026
1 check passed
@cugarteblair
cugarteblair deleted the issue-1077-timeseries-zoom-to-map-extent branch June 9, 2026 12:23
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.

Add zoom plot to map extent to the Time Series tab of the Analysis view

1 participant