Skip to content

Commit

Permalink
Merge pull request jupyter-widgets#1006 from jasongrout/examplesjlite
Browse files Browse the repository at this point in the history
Update JupyterLite to include lots of examples
  • Loading branch information
martinRenou committed Jun 24, 2022
2 parents 8c101e6 + e118f74 commit 28cc971
Show file tree
Hide file tree
Showing 35 changed files with 578 additions and 71 deletions.
4 changes: 3 additions & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ dependencies:

- pip:
- ..
- jupyterlite-sphinx
# Until jupyterlite-sphinx>0.4.9 is released, install from a commit hash to get the jupyterlite_contents config option
# - jupyterlite-sphinx
- https://github.com/jupyterlite/jupyterlite-sphinx/archive/944ccf4ee977627dbf75b5ae1994c08718566c76.zip
- jupyterlite>=0.1.0b9
56 changes: 55 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,61 @@
templates_path = ['_templates']

jupyterlite_config = "jupyterlite_config.json"

jupyterlite_contents = [
"../../examples/europe_110.geo.json",
"../../examples/bars.json",
"../../examples/demo.json",
"../../examples/US_Unemployment_Oct2012.csv",
"../../examples/US_Unemployment_Oct2012_with_NANS.csv",
"../../examples/us-states.json",
"../../examples/AntPath.ipynb",
"../../examples/AwesomeIcons.ipynb",
"../../examples/BaseMap.ipynb",
# "../../examples/CanvasRenderer.ipynb", # no python wheel for shapely
"../../examples/Choropleth.ipynb",
"../../examples/Choropleth_with_NANS.ipynb",
# "../../examples/CountriesGeoJSON.ipynb", # cannot access ./europe_110.geo.json
"../../examples/CustomProjections.ipynb",
"../../examples/CustomTMS.ipynb",
# "../../examples/CustomTileServer.ipynb", # Some problem with flask: 'DummyMod' object has no attribute 'startswith'
"../../examples/DrawControl.ipynb",
"../../examples/DropdownControl.ipynb",
"../../examples/Fullscreen.ipynb",
# "../../examples/GPX.ipynb", # error installing geopandas (missing wheel for pyproj)
# "../../examples/GeoData.ipynb", # error installing geopandas (missing wheel for pyproj)
# "../../examples/GeoData_on_hover.ipynb", # error installing geopandas (missing wheel for pyproj)
"../../examples/GeoJSON.ipynb",
# "../../examples/GeoJson_EU_on_hover.ipynb", # cannot load file europe_110.geo.json
"../../examples/Heatmap.ipynb",
# "../../examples/Image_slider.ipynb", # error installing rasterio
# "../../examples/KML.ipynb", # error installing geopandas
"../../examples/LayerGroup.ipynb",
"../../examples/LegendControl.ipynb",
"../../examples/MagnifyingGlass.ipynb",
"../../examples/MapContainer.ipynb",
"../../examples/MapCursorStyle.ipynb",
"../../examples/MapPanes.ipynb", # This works even though it also needs the europe_110.geo.json, so check example above again!
# "../../examples/MarkerCluster-GeoJson.ipynb", # error installing geopandas
# "../../examples/MarkerCluster.ipynb", #error install geopandas
# "../../examples/Max_zoom.ipynb", # test again - not sure if localtileserver package has problems
"../../examples/MeasureControl.ipynb",
# "../../examples/Numpy.ipynb", # error installing reasterio
"../../examples/Primitives.ipynb",
"../../examples/Radiation.ipynb",
"../../examples/ScaleControl.ipynb",
# "../../examples/SearchControl.ipynb", # error installing shapely. Looks like reading a file works if it is readonly (opened with "r")
"../../examples/Select-GeoJson.ipynb",
"../../examples/SplitMap.ipynb",
"../../examples/TileLayer-loading.ipynb",
"../../examples/Transform.ipynb",
"../../examples/VectorTiles.ipynb",
# "../../examples/Velocity.ipynb", # seems like issues with downloading wind-global.nc dataset? Takes a long time
# "../../examples/Video.ipynb", # error installing rasterio
# "../../examples/WKTLayer.ipynb", #error importing shapely
"../../examples/WMSLayer.ipynb",
# "../../examples/WealthOfNations.ipynb", # did not install bqplot widget as a federated extension?
"../../examples/WidgetControl.ipynb",
]
def setup(app):
app.add_css_file("main_stylesheet.css")

Expand Down
8 changes: 5 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ Python or from the browser.
Try it online
-------------

You can try ipyleaflet below, or open the example in a new browser tab with
`RetroLite <./lite/retro/notebooks?path=ipyleaflet.ipynb>`_ or
`JupyterLite <./lite/lab?path=ipyleaflet.ipynb>`_.
.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
:target: ./lite/lab?path=ipyleaflet.ipynb

You can try ipyleaflet below, or open many other live examples in a new browser tab with
`JupyterLite <./lite/lab?path=ipyleaflet.ipynb>`_ or `RetroLite <./lite/retro/tree>`_.

.. retrolite:: ipyleaflet.ipynb

Expand Down
18 changes: 16 additions & 2 deletions examples/AntPath.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -117,7 +131,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -131,7 +145,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
18 changes: 16 additions & 2 deletions examples/AwesomeIcons.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass# Set up for JupyterLite"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -72,7 +86,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -86,7 +100,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
16 changes: 15 additions & 1 deletion examples/BaseMap.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -151,7 +165,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
17 changes: 16 additions & 1 deletion examples/CanvasRenderer.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "64f20cfc-a3c8-437a-8c64-a0264afdde0d",
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -70,7 +85,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
16 changes: 15 additions & 1 deletion examples/Choropleth.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install(['ipyleaflet', 'branca'])\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -191,7 +205,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
16 changes: 15 additions & 1 deletion examples/Choropleth_with_NANS.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install(['ipyleaflet', 'branca'])\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -90,7 +104,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
18 changes: 16 additions & 2 deletions examples/CustomProjections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
"NASA's Next GenerationBlue Marble 500m for the Arctic and Antarctic regions."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -100,7 +114,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -114,7 +128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.10.5"
}
},
"nbformat": 4,
Expand Down
20 changes: 17 additions & 3 deletions examples/CustomTMS.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Set up for JupyterLite\n",
"try:\n",
" import piplite\n",
" await piplite.install('ipyleaflet')\n",
"except ImportError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -65,7 +79,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -79,9 +93,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.10.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit 28cc971

Please sign in to comment.