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

Scroll input not passed through to images #3277

Open
dchassin opened this issue Dec 22, 2024 · 4 comments
Open

Scroll input not passed through to images #3277

dchassin opened this issue Dec 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dchassin
Copy link

dchassin commented Dec 22, 2024

Describe the bug

The scroll action used to zoom in and out of mapbox images isn't working anymore (it used to). Instead the scroll action is now passed to the parent browser window and scrolls the entire page up and down.

Environment

{
  "marimo": "0.10.6",
  "OS": "Darwin",
  "OS Version": "23.5.0",
  "Processor": "i386",
  "Python Version": "3.10.16",
  "Binaries": {
    "Browser": "131.0.6778.205",
    "Node": "v23.3.0"
  },
  "Dependencies": {
    "click": "8.1.7",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.7",
    "narwhals": "1.19.0",
    "packaging": "24.2",
    "psutil": "6.1.1",
    "pygments": "2.18.0",
    "pymdown-extensions": "10.12",
    "pyyaml": "6.0.2",
    "ruff": "0.8.4",
    "starlette": "0.42.0",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.34.0",
    "websockets": "14.1"
  },
  "Optional Dependencies": {
    "pandas": "2.2.2"
  }
}

Code to reproduce

import marimo as mo
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio

_data = pd.DataFrame({"latitude":[],"longitude":[]})
_params = {"lat":"latitude","lon":"longitude"}
_view = {"zoom":2.75,"center":{"lat":40,"lon":-96}}
map = px.scatter_mapbox(_data,**_params,**_view)
map.update_layout(mapbox_style="open-street-map")
@dchassin dchassin added the bug Something isn't working label Dec 22, 2024
@dchassin
Copy link
Author

Note that if you use px.scatter_map() instead of px.scatter_mapbox() the pass through of scrolling works ok.

@Light2Dark
Copy link
Contributor

Light2Dark commented Dec 22, 2024

hey! I'm not from the team, but does plotly support this now? I couldn't make the examples mentioned here zoom-in too: https://plotly.com/python/tile-scatter-maps/#mapbox-maps

Fyi, plotly is slowly deprecating mapbox in favour of map (mapbox uses a different map library) and we recently updated the plotly library to better support the new map library used.

@dchassin
Copy link
Author

@Light2Dark, that probably explains the difference. I wasn't aware of the imminent deprecation. I just noticed that in an older marimo notebook I had zoom wasn't working. The switch to map is mostly ok, esp. if zoom doesn't work in mapbox anymore. If @mscolnick thinks this is a mapbox vs. map issue and not a marimo issue, then I think we ought to close this issue and leave these comments for the record if anyone runs into this problem again.

@mscolnick
Copy link
Contributor

Yes, I'm fairly certain this is an upstream issue and marimo is not intercepting any scroll behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants