Skip to content

Commit 28cc971

Browse files
authored
Merge pull request #1006 from jasongrout/examplesjlite
Update JupyterLite to include lots of examples
2 parents 8c101e6 + e118f74 commit 28cc971

35 files changed

+578
-71
lines changed

docs/environment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ dependencies:
1818

1919
- pip:
2020
- ..
21-
- jupyterlite-sphinx
21+
# Until jupyterlite-sphinx>0.4.9 is released, install from a commit hash to get the jupyterlite_contents config option
22+
# - jupyterlite-sphinx
23+
- https://github.com/jupyterlite/jupyterlite-sphinx/archive/944ccf4ee977627dbf75b5ae1994c08718566c76.zip
2224
- jupyterlite>=0.1.0b9

docs/source/conf.py

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,61 @@
77
templates_path = ['_templates']
88

99
jupyterlite_config = "jupyterlite_config.json"
10-
10+
jupyterlite_contents = [
11+
"../../examples/europe_110.geo.json",
12+
"../../examples/bars.json",
13+
"../../examples/demo.json",
14+
"../../examples/US_Unemployment_Oct2012.csv",
15+
"../../examples/US_Unemployment_Oct2012_with_NANS.csv",
16+
"../../examples/us-states.json",
17+
"../../examples/AntPath.ipynb",
18+
"../../examples/AwesomeIcons.ipynb",
19+
"../../examples/BaseMap.ipynb",
20+
# "../../examples/CanvasRenderer.ipynb", # no python wheel for shapely
21+
"../../examples/Choropleth.ipynb",
22+
"../../examples/Choropleth_with_NANS.ipynb",
23+
# "../../examples/CountriesGeoJSON.ipynb", # cannot access ./europe_110.geo.json
24+
"../../examples/CustomProjections.ipynb",
25+
"../../examples/CustomTMS.ipynb",
26+
# "../../examples/CustomTileServer.ipynb", # Some problem with flask: 'DummyMod' object has no attribute 'startswith'
27+
"../../examples/DrawControl.ipynb",
28+
"../../examples/DropdownControl.ipynb",
29+
"../../examples/Fullscreen.ipynb",
30+
# "../../examples/GPX.ipynb", # error installing geopandas (missing wheel for pyproj)
31+
# "../../examples/GeoData.ipynb", # error installing geopandas (missing wheel for pyproj)
32+
# "../../examples/GeoData_on_hover.ipynb", # error installing geopandas (missing wheel for pyproj)
33+
"../../examples/GeoJSON.ipynb",
34+
# "../../examples/GeoJson_EU_on_hover.ipynb", # cannot load file europe_110.geo.json
35+
"../../examples/Heatmap.ipynb",
36+
# "../../examples/Image_slider.ipynb", # error installing rasterio
37+
# "../../examples/KML.ipynb", # error installing geopandas
38+
"../../examples/LayerGroup.ipynb",
39+
"../../examples/LegendControl.ipynb",
40+
"../../examples/MagnifyingGlass.ipynb",
41+
"../../examples/MapContainer.ipynb",
42+
"../../examples/MapCursorStyle.ipynb",
43+
"../../examples/MapPanes.ipynb", # This works even though it also needs the europe_110.geo.json, so check example above again!
44+
# "../../examples/MarkerCluster-GeoJson.ipynb", # error installing geopandas
45+
# "../../examples/MarkerCluster.ipynb", #error install geopandas
46+
# "../../examples/Max_zoom.ipynb", # test again - not sure if localtileserver package has problems
47+
"../../examples/MeasureControl.ipynb",
48+
# "../../examples/Numpy.ipynb", # error installing reasterio
49+
"../../examples/Primitives.ipynb",
50+
"../../examples/Radiation.ipynb",
51+
"../../examples/ScaleControl.ipynb",
52+
# "../../examples/SearchControl.ipynb", # error installing shapely. Looks like reading a file works if it is readonly (opened with "r")
53+
"../../examples/Select-GeoJson.ipynb",
54+
"../../examples/SplitMap.ipynb",
55+
"../../examples/TileLayer-loading.ipynb",
56+
"../../examples/Transform.ipynb",
57+
"../../examples/VectorTiles.ipynb",
58+
# "../../examples/Velocity.ipynb", # seems like issues with downloading wind-global.nc dataset? Takes a long time
59+
# "../../examples/Video.ipynb", # error installing rasterio
60+
# "../../examples/WKTLayer.ipynb", #error importing shapely
61+
"../../examples/WMSLayer.ipynb",
62+
# "../../examples/WealthOfNations.ipynb", # did not install bqplot widget as a federated extension?
63+
"../../examples/WidgetControl.ipynb",
64+
]
1165
def setup(app):
1266
app.add_css_file("main_stylesheet.css")
1367

docs/source/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ Python or from the browser.
1212
Try it online
1313
-------------
1414

15-
You can try ipyleaflet below, or open the example in a new browser tab with
16-
`RetroLite <./lite/retro/notebooks?path=ipyleaflet.ipynb>`_ or
17-
`JupyterLite <./lite/lab?path=ipyleaflet.ipynb>`_.
15+
.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
16+
:target: ./lite/lab?path=ipyleaflet.ipynb
17+
18+
You can try ipyleaflet below, or open many other live examples in a new browser tab with
19+
`JupyterLite <./lite/lab?path=ipyleaflet.ipynb>`_ or `RetroLite <./lite/retro/tree>`_.
1820

1921
.. retrolite:: ipyleaflet.ipynb
2022

examples/AntPath.ipynb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Set up for JupyterLite\n",
10+
"try:\n",
11+
" import piplite\n",
12+
" await piplite.install('ipyleaflet')\n",
13+
"except ImportError:\n",
14+
" pass"
15+
]
16+
},
317
{
418
"cell_type": "code",
519
"execution_count": null,
@@ -117,7 +131,7 @@
117131
],
118132
"metadata": {
119133
"kernelspec": {
120-
"display_name": "Python 3",
134+
"display_name": "Python 3 (ipykernel)",
121135
"language": "python",
122136
"name": "python3"
123137
},
@@ -131,7 +145,7 @@
131145
"name": "python",
132146
"nbconvert_exporter": "python",
133147
"pygments_lexer": "ipython3",
134-
"version": "3.7.3"
148+
"version": "3.10.5"
135149
}
136150
},
137151
"nbformat": 4,

examples/AwesomeIcons.ipynb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Set up for JupyterLite\n",
10+
"try:\n",
11+
" import piplite\n",
12+
" await piplite.install('ipyleaflet')\n",
13+
"except ImportError:\n",
14+
" pass# Set up for JupyterLite"
15+
]
16+
},
317
{
418
"cell_type": "code",
519
"execution_count": null,
@@ -72,7 +86,7 @@
7286
],
7387
"metadata": {
7488
"kernelspec": {
75-
"display_name": "Python 3",
89+
"display_name": "Python 3 (ipykernel)",
7690
"language": "python",
7791
"name": "python3"
7892
},
@@ -86,7 +100,7 @@
86100
"name": "python",
87101
"nbconvert_exporter": "python",
88102
"pygments_lexer": "ipython3",
89-
"version": "3.8.1"
103+
"version": "3.10.5"
90104
}
91105
},
92106
"nbformat": 4,

examples/BaseMap.ipynb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Set up for JupyterLite\n",
10+
"try:\n",
11+
" import piplite\n",
12+
" await piplite.install('ipyleaflet')\n",
13+
"except ImportError:\n",
14+
" pass"
15+
]
16+
},
317
{
418
"cell_type": "code",
519
"execution_count": 1,
@@ -151,7 +165,7 @@
151165
"name": "python",
152166
"nbconvert_exporter": "python",
153167
"pygments_lexer": "ipython3",
154-
"version": "3.9.13"
168+
"version": "3.10.5"
155169
}
156170
},
157171
"nbformat": 4,

examples/CanvasRenderer.ipynb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "64f20cfc-a3c8-437a-8c64-a0264afdde0d",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"# Set up for JupyterLite\n",
11+
"try:\n",
12+
" import piplite\n",
13+
" await piplite.install('ipyleaflet')\n",
14+
"except ImportError:\n",
15+
" pass"
16+
]
17+
},
318
{
419
"cell_type": "code",
520
"execution_count": null,
@@ -70,7 +85,7 @@
7085
"name": "python",
7186
"nbconvert_exporter": "python",
7287
"pygments_lexer": "ipython3",
73-
"version": "3.9.6"
88+
"version": "3.10.5"
7489
}
7590
},
7691
"nbformat": 4,

examples/Choropleth.ipynb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Set up for JupyterLite\n",
10+
"try:\n",
11+
" import piplite\n",
12+
" await piplite.install(['ipyleaflet', 'branca'])\n",
13+
"except ImportError:\n",
14+
" pass"
15+
]
16+
},
317
{
418
"cell_type": "code",
519
"execution_count": 1,
@@ -191,7 +205,7 @@
191205
"name": "python",
192206
"nbconvert_exporter": "python",
193207
"pygments_lexer": "ipython3",
194-
"version": "3.9.12"
208+
"version": "3.10.5"
195209
}
196210
},
197211
"nbformat": 4,

examples/Choropleth_with_NANS.ipynb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Set up for JupyterLite\n",
10+
"try:\n",
11+
" import piplite\n",
12+
" await piplite.install(['ipyleaflet', 'branca'])\n",
13+
"except ImportError:\n",
14+
" pass"
15+
]
16+
},
317
{
418
"cell_type": "code",
519
"execution_count": null,
@@ -90,7 +104,7 @@
90104
"name": "python",
91105
"nbconvert_exporter": "python",
92106
"pygments_lexer": "ipython3",
93-
"version": "3.9.12"
107+
"version": "3.10.5"
94108
}
95109
},
96110
"nbformat": 4,

examples/CustomProjections.ipynb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
"NASA's Next GenerationBlue Marble 500m for the Arctic and Antarctic regions."
1111
]
1212
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": null,
16+
"metadata": {},
17+
"outputs": [],
18+
"source": [
19+
"# Set up for JupyterLite\n",
20+
"try:\n",
21+
" import piplite\n",
22+
" await piplite.install('ipyleaflet')\n",
23+
"except ImportError:\n",
24+
" pass"
25+
]
26+
},
1327
{
1428
"cell_type": "code",
1529
"execution_count": null,
@@ -100,7 +114,7 @@
100114
],
101115
"metadata": {
102116
"kernelspec": {
103-
"display_name": "Python 3",
117+
"display_name": "Python 3 (ipykernel)",
104118
"language": "python",
105119
"name": "python3"
106120
},
@@ -114,7 +128,7 @@
114128
"name": "python",
115129
"nbconvert_exporter": "python",
116130
"pygments_lexer": "ipython3",
117-
"version": "3.7.4"
131+
"version": "3.10.5"
118132
}
119133
},
120134
"nbformat": 4,

0 commit comments

Comments
 (0)