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

Zoom and pan not working on Linux/Gnome/Wayland #3812

Open
q-wertz opened this issue Feb 16, 2025 · 1 comment
Open

Zoom and pan not working on Linux/Gnome/Wayland #3812

q-wertz opened this issue Feb 16, 2025 · 1 comment
Labels
bug Something isn't working good first issue (typescript) Good first issue on the frontend/typescript help wanted Extra attention is needed

Comments

@q-wertz
Copy link

q-wertz commented Feb 16, 2025

Describe the bug

It looks like on some OS/desktop environments/display servers (not sure what's causing the issue) it is not possible to use the Altair zoom and pan functionality that was introduced in #1855.

I'm on Manjaro with Gnome (Wayland) and on none of the tested browsers (Firefox, Chromium, Vivaldi) I can zoom into plots or pan. Unsure which key is the meta key I tried:

  • Shift:
    • Shift + Scrolling: Nothing
    • Shift + Drag: Nothing
    • Multi legend item selection: Working
  • Strg:
    • Strg + Scrolling: Browser scroll is triggered
    • Strg + click & drag: Interval selection
  • Windows key:
    • Windows + Scrolling: Workspace is changed
    • Windows + dragging: Browser window goes into window mode

Also tried Alt Gr, and combination of keys...

This is a follow up on discussion #250 (comment)

Environment

{
  "marimo": "0.11.4",
  "OS": "Linux",
  "OS Version": "6.6.74-1-MANJARO",
  "Processor": "",
  "Python Version": "3.12.8",
  "Binaries": {
    "Browser": "--",
    "Node": "v23.7.0"
  },
  "Dependencies": {
    "click": "8.1.8",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.7",
    "narwhals": "1.26.0",
    "packaging": "24.2",
    "psutil": "7.0.0",
    "pygments": "2.19.1",
    "pymdown-extensions": "10.14.3",
    "pyyaml": "6.0.2",
    "ruff": "0.9.6",
    "starlette": "0.45.3",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.34.0",
    "websockets": "14.2"
  },
  "Optional Dependencies": {
    "altair": "5.5.0",
    "pandas": "2.2.3",
    "pyarrow": "19.0.0"
  },
  "Experimental Flags": {}
}

Also tried on https://marimo.app

Code to reproduce

import marimo as mo
import altair as alt

from vega_datasets import data
cars = data.cars()

mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(
x='Horsepower',
y='Miles_per_Gallon',
color='Origin'
))

@q-wertz q-wertz added the bug Something isn't working label Feb 16, 2025
@mscolnick mscolnick added help wanted Extra attention is needed good first issue (typescript) Good first issue on the frontend/typescript labels Feb 16, 2025
@q-wertz
Copy link
Author

q-wertz commented Feb 18, 2025

Found a solution/workaround...

I need to add .interactive() and then I can zoom (scrolling, no extra key required) and pan (Alt + drag):

import marimo as mo
import altair as alt

from vega_datasets import data
cars = data.cars()

mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(
    x='Horsepower',
    y='Miles_per_Gallon',
    color='Origin'
).interactive())

Not sure if this is intended behavior or I am missing something...
As far as I understand #870 (comment) it should work without and there is a difference between the two things...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue (typescript) Good first issue on the frontend/typescript help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants