Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RangeTool does not respect target max_interval #13483

Closed
droumis opened this issue Oct 25, 2023 · 3 comments · Fixed by #13561
Closed

[BUG] RangeTool does not respect target max_interval #13483

droumis opened this issue Oct 25, 2023 · 3 comments · Fixed by #13561
Assignees
Labels
grant: CZI R5 Funded by CZI Round 5 grant reso: completed tag: component: bokehjs tag: tools Related to the toolbar and individual tools type: bug
Milestone

Comments

@droumis
Copy link
Member

droumis commented Oct 25, 2023

Software versions

Python version : 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:41:52) [Clang 15.0.7 ]
IPython version : 8.16.1
Tornado version : 6.3.3
Bokeh version : 3.3.0
BokehJS static path : /Users/droumis/opt/miniconda3/envs/bokeh3.3/lib/python3.10/site-packages/bokeh/server/static
node.js version : v20.4.0
npm version : 9.7.2
Operating system : macOS-13.5.2-arm64-arm-64bit

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

The RangeTool should respect the constraints imposed by the max_interval on the target plot and not allow for expanding the range beyond this interval. Depending on the intended behavior, this may be somewhere between a bug and a feature request.

Observed behavior

The RangeTool ignores the max_interval constraint.

Example code

import numpy as np
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, RangeTool
from bokeh.plotting import figure, show

n_points = 3000
x_values = np.linspace(0, 100, n_points) 
y_values = np.random.randn(n_points).cumsum()

source = ColumnDataSource(data=dict(x=x_values, y=y_values))

p = figure(height=300, width=800, tools=["xpan", "xzoom_in", "xzoom_out", "reset"],
           background_fill_color="#efefef", x_range=(22, 30))
p.line('x', 'y', source=source)
p.yaxis.axis_label = 'Value'
p.x_range.max_interval = 10  # Set max zoom interval

select = figure(height=130, width=800, y_range=p.y_range,
                tools="", toolbar_location=None, background_fill_color="#efefef")
range_tool = RangeTool(x_range=p.x_range)
range_tool.overlay.fill_color = "navy"
range_tool.overlay.fill_alpha = 0.2
select.line('x', 'y', source=source)
select.ygrid.grid_line_color = None
select.add_tools(range_tool)

show(column(p, select))

Stack traceback or browser console output

No response

Screenshots

Screen.Recording.2023-10-24.at.5.01.43.PM.mov
@droumis
Copy link
Member Author

droumis commented Oct 25, 2023

Also, the RangeTool ignores max_interval set on the source plot (its own), in addition to the target plot.

@bryevdv
Copy link
Member

bryevdv commented Oct 25, 2023

Also, the RangeTool ignores max_interval set on the source plot (its own), in addition to the target plot.

The range configuration of the plot that contains the range tool is not relevant, the range tool should only care about the range that it is configured with.

@bryevdv bryevdv added type: bug tag: component: bokehjs tag: tools Related to the toolbar and individual tools and removed TRIAGE labels Oct 25, 2023
@bryevdv bryevdv added this to the 3.x milestone Oct 25, 2023
@droumis droumis added the grant: CZI R5 Funded by CZI Round 5 grant label Oct 26, 2023
@mattpap mattpap modified the milestones: 3.x, 3.4 Nov 29, 2023
@droumis droumis moved this to WIP in CZI R5 neuro Jan 4, 2024
@droumis droumis moved this from WIP to Done in CZI R5 neuro Mar 19, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grant: CZI R5 Funded by CZI Round 5 grant reso: completed tag: component: bokehjs tag: tools Related to the toolbar and individual tools type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants