-
-
Notifications
You must be signed in to change notification settings - Fork 445
Description
Hi there,
I'm using uPlot with cursor.drag enabled for both axes:
uPlot.options.cursor.drag = { x: true, y: true }
While it works as expected within the chart area, I noticed that the drag/zoom box stops updating as soon as the mouse cursor leaves the u-over / chart area.
The Goal:
I would like the zoom box to continue updating based on the mouse position, even when the cursor is outside the chart, by clamping the coordinates to the chart boundaries.
Expected Behavior:
- Horizontal Exit: If I drag to the left/right edge and then move the cursor vertically outside the chart, the zoom box should stay clamped to the horizontal boundary but continue to expand/contract vertically.
- Vertical Exit: If I drag to the top/bottom edge and then move horizontally outside, the zoom box should stay clamped vertically but continue extending horizontally.
Current Behavior:
The mousemove listener (or the internal logic) seems to stop updating the selection box once the cursor is no longer over the chart element.
Question:
Is there a native configuration or a specific hook to enable this "clamping" behavior? Or does this require a custom implementation to override the default drag logic?
uPlot Version: 1.6.32