bokeh / bokeh

Interactive Data Visualization in the browser, from Python

Home Page:https://bokeh.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Lack of range expansion when there remains unbounded directions, even when `maintain_focus=False`

droumis opened this issue · comments

Software versions

Python version : 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:49:36) [Clang 16.0.6 ]
IPython version : 8.22.2
Tornado version : 6.4
Bokeh version : 3.4.0
BokehJS static path : /Users/droumis/opt/miniconda3/envs/holoviews-6056/lib/python3.11/site-packages/bokeh/server/static
node.js version : v21.7.1
npm version : 10.5.0
jupyter_bokeh version : 4.0.1
Operating system : macOS-13.5.2-arm64-arm-64bit

Browser name and version

chrome Version 123.0.6312.105

Jupyter notebook / Jupyter Lab version

jupyterlab 4.1.6

Expected behavior

If maintain_focus is False, and so you don't care about keeping the cursor point consistent, then the wheel zoom out should be like a flood fill, expanding in every remaining unbounded direction.

The example below is not quite 'zooming' in this particular view... but just to demo the behavior of x-upper-range expanding even when the left, upper, lower bounds are reached:

Screen.Recording.2024-04-15.at.4.58.20.PM.mov

Observed behavior

In the video below, when the left, top, and bottom bounds are hit, the wheel zoom no longer continues to adjust in the x-upper-direction (right). Alternatively, one cannot zoom out at all in the y-dim if the x-dim bounds are fully reached from the start, such with x_range=Range1d(bounds=(1, 5), start=1, end=5).

Example code

from bokeh.models import Range1d, WheelZoomTool
from bokeh.plotting import figure, show

x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]

p = figure(x_range=Range1d(bounds=(1, 5), start=1, end=2),
           y_range=Range1d(bounds=(2, 7), start=4, end=6.5),tools="reset,pan,")
p.line(x, y)
wheel_zoom = WheelZoomTool(maintain_focus=False) 
p.add_tools(wheel_zoom)
p.toolbar.active_scroll = wheel_zoom
show(p)

Stack traceback or browser console output

No response

Screenshots

Screen.Recording.2024-04-15.at.4.39.16.PM.mov