marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Leafmap map does not rerender after code changes

Open diehl opened this issue 2 months ago • 4 comments

Describe the bug

When writing Leafmap code to design maps in Marimo, I'm not able to get an updated version of the map rendered in the notebook without reloading the entire notebook. After making a code change, I rerun the cell and no update occurs. Needing to reload the entire notebook obviously makes the map development process even slower than a Jupyter notebook. I'd love to see this fixed as being able to run the notebook as an app straightaway makes the process of sharing maps extremely easy!

A simple code snippet that helps highlight the issue is the following. If you make changes to the viz height and rerun the cell, the resulting map does not change.

m = leafmap.Map(
    center=(-98.5795,39.8283),  # Center of the US
    zoom=3,                     # Initial zoom level
    height='500px'
)
m

Running this code with leafmap==0.39.2.

Environment

{ "marimo": "0.9.31", "OS": "Darwin", "OS Version": "23.6.0", "Processor": "i386", "Python Version": "3.11.10", "Binaries": { "Browser": "131.0.6778.109", "Node": "v23.2.0" }, "Dependencies": { "click": "8.1.7", "docutils": "0.21.2", "itsdangerous": "2.2.0", "jedi": "0.19.2", "markdown": "3.6", "narwhals": "1.13.5", "packaging": "24.2", "psutil": "6.1.0", "pygments": "2.18.0", "pymdown-extensions": "10.12", "pyyaml": "6.0.2", "ruff": "0.7.4", "starlette": "0.41.2", "tomlkit": "0.13.2", "typing-extensions": "4.12.2", "uvicorn": "0.32.0", "websockets": "12.0" }, "Optional Dependencies": { "anywidget": "0.9.13", "duckdb": "1.1.3", "pandas": "2.2.3", "pyarrow": "18.0.0" } }

Code to reproduce

import leafmap

# Making updates to the viz height and rerunning the cell leads to no update in the map
m = leafmap.Map(center=(-98.5795,39.8283), zoom=3, height='500px')
m

diehl avatar Dec 07 '24 19:12 diehl