Add "Zoom plot to map extent" button to Time Series tab#1078
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-maptoolbar button (aria-label="Zoom Plot to Map Extent"), disabled until a request is selected and the map has reported an extenthandleZoomPlotToMapExtent()handler,hasMapExtentData+zoomPlotToMapTooltipcomputeds — ported verbatim fromSrElevationPlot.vuegetXRangeFromLatLonExtent(SrDuckDbUtils) anduseSrToastStore. All other machinery (atlChartFilterStore,globalChartStore,callPlotUpdateDebounced) was already imported by the component.Verification
Drove the production build through Playwright (Chromium) using the
importFilefixture (atl03x, multi-cycle):handleZoomPlotToMapExtent→getXRangeFromLatLonExtent(confirmedxField: x_atc) → sets zoom →callPlotUpdateDebounced→ plot refresh. Verified via captured debug logs.Note
The button is also present for
atl13xtime 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 existingnotAtl13xTimeSeriescomputed in the component can gate it.🤖 Generated with Claude Code