Skip to content

Commit 2beda86

Browse files
author
Stefan Kuethe
committed
Add marimo notebooks
1 parent e221059 commit 2beda86

File tree

4 files changed

+101
-74
lines changed

4 files changed

+101
-74
lines changed

marimo/export-notebooks.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
files=("getting-started.py", "pmtiles-vector.py")
3+
4+
for file in "${files[@]}"; do
5+
without_extension="${file%.*}"
6+
marimo export html-wasm "$file" -o dist/"$without_extension".html --mode edit
7+
done
8+

marimo/getting-started.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
import marimo
4+
5+
__generated_with = "0.13.2"
6+
app = marimo.App(width="medium")
7+
8+
9+
@app.cell
10+
def _():
11+
import openlayers as ol
12+
return (ol,)
13+
14+
15+
@app.cell
16+
def _(ol):
17+
m = ol.MapWidget()
18+
return (m,)
19+
20+
21+
@app.cell
22+
def _(m):
23+
m
24+
return
25+
26+
27+
@app.cell
28+
def _():
29+
return
30+
31+
32+
if __name__ == "__main__":
33+
app.run()

marimo/pmtiles-vector.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
3+
import marimo
4+
5+
__generated_with = "0.13.2"
6+
app = marimo.App(width="medium")
7+
8+
9+
@app.cell
10+
def _():
11+
import openlayers as ol
12+
from openlayers.sources import PMTilesVectorSource
13+
from openlayers.styles import default_style
14+
return PMTilesVectorSource, default_style, ol
15+
16+
17+
@app.cell
18+
def _():
19+
data = "https://r2-public.protomaps.com/protomaps-sample-datasets/nz-buildings-v3.pmtiles"
20+
return (data,)
21+
22+
23+
@app.cell
24+
def _(PMTilesVectorSource, data, default_style, ol):
25+
pmtiles = ol.layers.VectorTileLayer(
26+
id="pmtiles-vector",
27+
style=default_style(stroke_color="green", stroke_width=2),
28+
source=PMTilesVectorSource(
29+
url=data, attributions=["© Land Information New Zealand"]
30+
),
31+
)
32+
return (pmtiles,)
33+
34+
35+
@app.cell
36+
def _(ol):
37+
view = ol.View(center=(172.606201, -43.556510), zoom=12)
38+
return (view,)
39+
40+
41+
@app.cell
42+
def _(ol, pmtiles, view):
43+
m = ol.MapWidget(view, layers=[pmtiles])
44+
m.add_tooltip()
45+
return (m,)
46+
47+
48+
@app.cell
49+
def _(m):
50+
m
51+
return
52+
53+
54+
@app.cell
55+
def _():
56+
return
57+
58+
59+
if __name__ == "__main__":
60+
app.run()

marimo_notebooks/ma_geopandas.py

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)