Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 21, 2024
1 parent a3608ab commit 5c7983e
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/examples/3d_indoor_mapping/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<a href="app.html" target="_blank">See example in action</a>

```python
-8<-- "3d_indoor_mapping/app.py"
```

<a href="app.html" target="_blank">See example in action</a>

Run example:

``` bash
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/geopandas/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<a href="app.html" target="_blank">See example in action</a>

```python
-8<-- "geopandas/app.py"
```

<a href="app.html" target="_blank">See example in action</a>

Run example:

``` bash
Expand Down
167 changes: 167 additions & 0 deletions docs/examples/road_safety/app.html

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/examples/road_safety/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import webbrowser

import h3
Expand All @@ -15,7 +16,7 @@
from maplibre.utils import df_to_geojson
from shiny import App, reactive, ui

RESOLUTION = 6
RESOLUTION = 7
COLORS = (
"lightblue",
"turquoise",
Expand Down Expand Up @@ -94,9 +95,9 @@ async def resolution():
app = App(app_ui, server)

if __name__ == "__main__":
filename = "/tmp/road_safety.html"
filename = sys.argv[1] if len(sys.argv) == 2 else "/tmp/road_safety.html"
with open(filename, "w") as f:
m = create_map()
f.write(m.to_html())
f.write(m.to_html(style="height: 700px;"))

webbrowser.open(filename)
2 changes: 2 additions & 0 deletions docs/examples/road_safety/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<a href="app.html" target="_blank">See example in action (without reactive effects)</a>

```python
-8<-- "road_safety/app.py"
```
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/vancouver_blocks/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<a href="app.html" target="_blank">See example in action (without reactive effects)</a>

```python
-8<-- "vancouver_blocks/app.py"
```

<a href="app.html" target="_blank">See example in action (without reactive effects)</a>

Run example:

```bash
Expand Down

0 comments on commit 5c7983e

Please sign in to comment.