Three Fiber–based anywidget for 2.5D polygons: preprocess stacked 2D outlines (per cell_id and ZIndex), build triangulated meshes, export spatial GLB tiles, and view them in the browser with a local tile server and WebGL widget.
Documentation (Zensical):ckmah.github.io/polyplot
- Python 3.12+
- uv recommended (see
pyproject.tomlfor dependencies)
From the repository root:
uv syncuv run marimo edit quickstart.pyimportpolyplotaspotiles_info=po.meshify(gdf) # default cache: ./.polyplot/<hash>/po.plot(gdf) # meshifies from cache if needed; wireframe / opacity / BG in the viewer UImeshify: preprocess a GeoDataFrame (cell_id,ZIndex,geometry), writetiles/andtiles.jsonunder.polyplot/<content hash>/by default (override without_dir=...). Usesmooth=Falsefor no Taubin smoothing,use_cache=Falseto force a rebuild.plot: callsmeshifywhen needed, starts or reuses a local tile server, and returns a marimoanywidgetviewer. Wireframe, opacity, and background are adjusted in the widget toolbar, not via Python.
The longer example is notebook.py (a marimo app):
uv run marimo edit notebook.pyThe repository tracks sample_data/liver_crop_sample.parquet, a small subset (~50 cells) for CI and quick starts. A full liver_crop.parquet and other large exports can live in sample_data/ locally; they are gitignored. To regenerate the subset from a local full file:
uv run python scripts/make_liver_subset.pyThe Python package lives in the polyplot/ directory. Optional: install gltfpack on your PATH for smaller GLB files (compression is enabled inside meshify).
To publish pre-rendered molab sessions, run from the repo root: uvx marimo export session quickstart.py (and similarly for notebook.py if desired).
