marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Scroll input not passed through to images

Open dchassin opened this issue 11 months ago • 4 comments

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 avatar Dec 22 '24 15:12 dchassin

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

dchassin avatar Dec 22 '24 15:12 dchassin

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.

Light2Dark avatar Dec 22 '24 15:12 Light2Dark

@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.

dchassin avatar Dec 22 '24 16:12 dchassin

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

mscolnick avatar Dec 22 '24 17:12 mscolnick

Going to close. Happy to re-open if we do feel this is a marimo issue.

mscolnick avatar Jan 18 '25 15:01 mscolnick