- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.py
More file actions
Latest commit
58 lines (46 loc) · 1.36 KB
/
Copy pathquickstart.py
File metadata and controls
58 lines (46 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "marimo>=0.22",
# "geopandas>=1.0",
# "pyarrow",
# "polyplot",
# ]
# [tool.uv.sources]
# polyplot = { path = ".", editable = true }
# ///
importmarimo
__generated_with="0.23.1"
app=marimo.App(width="full")
@app.cell
def_():
importpathlib
importtextwrap
importgeopandasasgpd
importmarimoasmo
importpolyplotaspo
returngpd, mo, pathlib, po, textwrap
@app.cell
def_(gpd, mo, pathlib, po, textwrap):
intro=mo.md(
textwrap.dedent(
"""
# Polyplot quick start
This notebook uses the tracked `sample_data/liver_crop_sample.parquet`. From
the repository root (so paths resolve) run `uv run marimo edit quickstart.py`.
Tip: In `on_demand=True` mode, click a cell in the minimap to build a
on-demand tile view. The camera also clamps max zoom-out so you cannot
pull back far enough to frame the entire dataset at once (keeps big
datasets from loading everything).
"""
).strip()
)
gdf=gpd.read_parquet(
pathlib.Path(__file__).resolve().parent
/"sample_data"
/"liver_crop_sample.parquet"
)
viewer=po.plot(gdf, on_demand=True)
returnmo.vstack(intro, viewer)
if__name__=="__main__":
app.run()