marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
6.17k stars 201 forks source link

ipyleaflet support #605

Open akshayka opened 8 months ago

akshayka commented 8 months ago

Originally posted by @misolietavec in https://github.com/marimo-team/marimo/issues/503#issuecomment-1892592187

I am building small application with panel, plotly, ipyleaflet. The ipywidgets ecosystem has already many modules, I can use. Especially, I need the functionality of ipyleaflet, because altair has limited functionality in this area. Is there any hope, that marimo will have, in future, equally rich, or better ecosystem as ipywidgets? I understand, this is not the short-time priority.

akshayka commented 8 months ago

Hi @misolietavec, yes, we certainly do plan to create a rich ecosystem of interactive plugins.

We have basic integration with leafmap, to at least let you display interactive maps. You can see this example: https://github.com/marimo-team/marimo/blob/main/examples/third_party/leafmap.py

What features from ipyleaflet do you need in particular.

misolietavec commented 8 months ago

I think, leafmap has too many dependencies. I like the simplicity of marimo and that it is not such heavyweight guy as jupyterlab. It was a breeze to rewrite my panel application (NYC taxi plots and map) to marimo. I used scatter_mapbox from plotly.express, liked the ability to select data in marimo.ui.plotly. Maybe, you can make interface to leaflet.js without using ipywidgets and ipyleaflet - it would be great.

See my repository https://github.com/misolietavec/nyc_taxi_marimo. It uses plotly and polars. If you like, you can adapt the files taxi_marimo_en.py, data_functions_en.py as examples (maybe with smaller dataset).

misolietavec commented 8 months ago

For comparison, the same application in panel, you can see at http://feelmath.eu:2022/taxi_panel (texts are in slovak). Especially, the (ipy)leaflet's MarkerCluster is what I like to see in marimo, sometimes in future.