Skip to content

Notebook scrolls when zooming #1359

@Installka

Description

@Installka

Describe the bug
Notebook scrolls when using PanZoom after clicking any buttons on Toolbar.

To Reproduce
When I run code cell with plot for the first time, everything works fine. But when I click on any button from Toolbar and then click again on PanZoom button, notebook starts scrolling when zooming plot.

You can use this code to reproduce the bug:

from bqplot import *
from IPython.display import display

x_data = range(10)
y_data = [i ** 2 for i in x_data]

x_sc = LinearScale()
y_sc = LinearScale()

ax_x = Axis(label='Test X', scale=x_sc, tick_format='0.0f')
ax_y = Axis(label='Test Y', scale=y_sc,
            orientation='vertical', tick_format='0.2f')

line = Lines(x=x_data,
             y=y_data,
             scales={'x': x_sc, 'y': y_sc},
             colors=['red', 'yellow'])

fig = Figure(axes=[ax_x, ax_y], marks=[line])

tb = Toolbar(figure=fig)

display(fig)
display(tb)

Expected behavior
Only plot should scroll when mouse hovers it.

Additional context
Bug was reproduced with next setups:

  1. Jupyter Lab 3.0.16 running on Windows 7 with bqplot 0.12.27 and Python 3.8.10. I tried to use it with:
    Edge 91.0.864.37 (Official build) (64-bit) from Win 7 PC and remotely from Win 10 and macOS 11.4;
    Chrome 91.0.4472.77 (Official Build) (64-bit) from Win 7 PC;
    Chrome 90.0.4430.0 (Developer Build) (64-bit) remotely from Win 10;
    Safari 14.1.1 (16611.2.7.1.4) remotely from macOS 11.4.
  2. Jupyter Lab 3.0.10 running on Windows 10 with bqplot 0.12.27 and Python 3.9.5. I tried to use it with Edge 91.0.864.37 (Official build) (64-bit) from Win 10;

I've already seen Pull request #1347, but I don't think it fixed this problem, because I tried to use bqplot 0.12.25, 0.12.26 and 0.12.27.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions