feat: add uZoomRanger() — interactive range-selector below uPlot charts#2
Open
feat: add uZoomRanger() — interactive range-selector below uPlot charts#2
Conversation
… uPlot charts Agent-Logs-Url: https://github.com/dreamRs/uPlot-r/sessions/8221e34a-37a8-4b6a-b979-d80fd9a01ce0 Co-authored-by: pvictor <4415580+pvictor@users.noreply.github.com>
pvictor
approved these changes
May 5, 2026
…stomization Agent-Logs-Url: https://github.com/dreamRs/uPlot-r/sessions/8221e34a-37a8-4b6a-b979-d80fd9a01ce0 Co-authored-by: pvictor <4415580+pvictor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add zoom ranger feature for uPlot graphs
feat: add uZoomRanger() — interactive range-selector below uPlot charts
May 5, 2026
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.
Adds a range-selector navigator widget (à la
zoom-ranger-grips.htmldemo) to the R package API, letting users pan/zoom the main chart by dragging a selection window on a compact overview chart rendered below it.New R API
Changes
R
R/zoom_ranger.R—uZoomRanger(uplot, height, stroke, grip_color, grip_width)setsx$config$zoomRangeron the widget; follows existing pipe-chain idiomNAMESPACE/man/uZoomRanger.Rd— export + roxygen docsexamples/ex-uZoomRanger.R— runnable exampleJavaScript
srcjs/modules/zoomRangerPlugin.js—createZoomRanger()encapsulates the full two-chart pattern: DOM wiring, CSS injection (once per page), bidirectional sync viasetScale/setSelecthooks, left/right grip handles withmousemove/mouseupdrag logic, and aResizeObserverthat keeps both charts sized togethersrcjs/widgets/uPlot.js— whenx.config.zoomRangeris present, delegates tocreateZoomRangerinstead of the normal single-chart path; properly destroys both charts and removes the wrapper div on re-render (Shiny-safe)inst/htmlwidgets/uPlot.js— rebuilt webpack bundleBehaviour
Original prompt
This pull request was created from Copilot chat.