Skip to content

[BUG] Toggling widget visibility triggers zoom in for unrelated figure #14207

Open
@muendlein

Description

Software versions

Python version : 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]
IPython version : 8.12.0
Tornado version : 6.2
NumPy version : 1.24.2
Bokeh version : 3.6.2
node.js version : (not installed)
npm version : (not installed)
jupyter_bokeh version : (not installed)
Operating system : Windows-10-10.0.19045-SP0

Browser name and version

No response

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

Layout changes shall not trigger any zoom.

Observed behavior

When toggling the visibility of a widget an unrelated figure will zoom in at the same time. Note: So far only observed in case of geo tiles.

Example code

from bokeh.io import curdoc
from bokeh.layouts import column, row, layout
from bokeh.models import ColumnDataSource, Select, Switch
from bokeh.plotting import figure

import xyzservices.providers as xyz

doc = curdoc()


geo_map = figure(x_range=(-2000000, 6000000), y_range=(-1000000, 7000000),
                 x_axis_type="mercator", y_axis_type="mercator", sizing_mode="stretch_height")
geo_map.add_tile(xyz.OpenStreetMap.Mapnik)

switch = Switch(active=False)
select_1 = Select(value="foo", options=["foo", "bar", "baz", "quux"], sizing_mode="fixed", visible=False)

s1 = figure(x_axis_type="datetime")
s1.line(x="t", y="y", source=ColumnDataSource())

# make a grid
grid = layout([[select_1, s1]],
              sizing_mode="stretch_both")

layout = row(
    column(geo_map,
           sizing_mode="stretch_height"),
    column(row(switch), grid, sizing_mode="stretch_both"),
    sizing_mode="stretch_both"
)


def toggle(attr, old, new):
    if new:
        select_1.visible = True
    else:
        select_1.visible = False


switch.on_change("active", toggle)

doc.add_root(layout)

Stack traceback or browser console output

No response

Screenshots

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions