Skip to content

Commit a27ceb6

Browse files
Add a try with JupyterLite in ipyleaflet documentation
1 parent f65f98e commit a27ceb6

File tree

7 files changed

+124
-2
lines changed

7 files changed

+124
-2
lines changed

docs/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ dependencies:
1515
- branca
1616
- shapely
1717
- pydata-sphinx-theme
18+
- jupyterlite-sphinx
1819
- pip:
1920
- ..
2021

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -*- coding: utf-8 -*-
22

33
extensions = [
4-
'jupyter_sphinx','sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.napoleon','sphinx.ext.todo', 'sphinx.ext.viewcode'
4+
'jupyter_sphinx', 'jupyterlite_sphinx', 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.napoleon','sphinx.ext.todo', 'sphinx.ext.viewcode'
55
]
66

77
templates_path = ['_templates']
88

9-
9+
jupyterlite_config = "jupyterlite_config.json"
1010

1111
def setup(app):
1212
app.add_css_file("main_stylesheet.css")

docs/source/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
ipyleaflet: Interactive maps in the Jupyter notebook
22
====================================================
33

4+
5+
Try it online
6+
-------------
7+
8+
You can try ipyleaflet directly in this documentation page thanks to JupyterLite!
9+
10+
.. retrolite:: ipyleaflet.ipynb
11+
12+
Index
13+
-----
14+
415
.. toctree::
516
:maxdepth: 2
617

docs/source/ipyleaflet.ipynb

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "8eee1995-a52b-4eae-8898-047746e57b19",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"data": {
11+
"application/vnd.jupyter.widget-view+json": {
12+
"model_id": "96d863f5de674932843d341778cf17b2",
13+
"version_major": 2,
14+
"version_minor": 0
15+
},
16+
"text/plain": [
17+
"Map(center=[48.204793, 350.121558], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title'…"
18+
]
19+
},
20+
"metadata": {},
21+
"output_type": "display_data"
22+
}
23+
],
24+
"source": [
25+
"from ipyleaflet import Map, basemaps, basemap_to_tiles\n",
26+
"\n",
27+
"m = Map(\n",
28+
" basemap=basemap_to_tiles(basemaps.OpenStreetMap.Mapnik),\n",
29+
" center=(48.204793, 350.121558),\n",
30+
" zoom=3\n",
31+
" )\n",
32+
"\n",
33+
"m"
34+
]
35+
}
36+
],
37+
"metadata": {
38+
"kernelspec": {
39+
"display_name": "Python 3 (ipykernel)",
40+
"language": "python",
41+
"name": "python3"
42+
},
43+
"language_info": {
44+
"codemirror_mode": {
45+
"name": "ipython",
46+
"version": 3
47+
},
48+
"file_extension": ".py",
49+
"mimetype": "text/x-python",
50+
"name": "python",
51+
"nbconvert_exporter": "python",
52+
"pygments_lexer": "ipython3",
53+
"version": "3.9.12"
54+
}
55+
},
56+
"nbformat": 4,
57+
"nbformat_minor": 5
58+
}

docs/source/jupyterlite_config.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"LiteBuildConfig": {
3+
"federated_extensions": [
4+
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab_widgets-1.0.2-pyhd8ed1ab_0.tar.bz2/jupyterlab_widgets-1.0.2-pyhd8ed1ab_0.tar.bz2",
5+
"https://github.com/conda-forge/releases/releases/download/noarch/ipycanvas-0.11.0-pyhd8ed1ab_0.tar.bz2/ipycanvas-0.11.0-pyhd8ed1ab_0.tar.bz2"
6+
],
7+
"ignore_sys_prefix": true,
8+
"piplite_urls": [
9+
"https://files.pythonhosted.org/packages/py2.py3/i/ipycanvas/ipycanvas-0.11.0-py2.py3-none-any.whl",
10+
"https://files.pythonhosted.org/packages/py2.py3/i/ipython-genutils/ipython_genutils-0.2.0-py2.py3-none-any.whl",
11+
"https://files.pythonhosted.org/packages/py2.py3/i/ipywidgets/ipywidgets-7.6.5-py2.py3-none-any.whl",
12+
"https://files.pythonhosted.org/packages/py2.py3/r/requests/requests-2.27.1-py2.py3-none-any.whl",
13+
"https://files.pythonhosted.org/packages/py2.py3/t/traittypes/traittypes-0.2.1-py2.py3-none-any.whl",
14+
"https://files.pythonhosted.org/packages/py2.py3/u/urllib3/urllib3-1.26.8-py2.py3-none-any.whl",
15+
"https://files.pythonhosted.org/packages/py3/b/branca/branca-0.4.2-py3-none-any.whl",
16+
"https://files.pythonhosted.org/packages/py3/i/ipython/ipython-8.0.1-py3-none-any.whl",
17+
"https://files.pythonhosted.org/packages/py3/j/jupyter-client/jupyter_client-7.1.2-py3-none-any.whl",
18+
"https://files.pythonhosted.org/packages/py3/j/jupyter-core/jupyter_core-4.9.2-py3-none-any.whl",
19+
"https://files.pythonhosted.org/packages/py3/j/jupyterlab-widgets/jupyterlab_widgets-1.0.2-py3-none-any.whl",
20+
"https://files.pythonhosted.org/packages/py3/n/nest-asyncio/nest_asyncio-1.5.4-py3-none-any.whl",
21+
"https://files.pythonhosted.org/packages/py3/n/notebook/notebook-6.4.8-py3-none-any.whl",
22+
"https://files.pythonhosted.org/packages/py3/t/traitlets/traitlets-5.1.1-py3-none-any.whl"
23+
]
24+
}
25+
}

docs/source/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ipyleaflet
2+
sphinx===4.4.0
3+
jupyterlite-sphinx
4+
pydata-sphinx-theme

docs/test.wkt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
MULTIPOLYGON(((-71.1031880899493 42.3152774590236,
2+
-71.1031627617667 42.3152960829043,-71.102923838298 42.3149156848307,
3+
-71.1023097974109 42.3151969047397,-71.1019285062273 42.3147384934248,
4+
-71.102505233663 42.3144722937587,-71.10277487471 42.3141658254797,
5+
-71.103113945163 42.3142739188902,-71.10324876416 42.31402489987,
6+
-71.1033002961013 42.3140393340215,-71.1033488797549 42.3139495090772,
7+
-71.103396240451 42.3138632439557,-71.1041521907712 42.3141153348029,
8+
-71.1041411411543 42.3141545014533,-71.1041287795912 42.3142114839058,
9+
-71.1041188134329 42.3142693656241,-71.1041112482575 42.3143272556118,
10+
-71.1041072845732 42.3143851580048,-71.1041057218871 42.3144430686681,
11+
-71.1041065602059 42.3145009876017,-71.1041097995362 42.3145589148055,
12+
-71.1041166403905 42.3146168544148,-71.1041258822717 42.3146748022936,
13+
-71.1041375307579 42.3147318674446,-71.1041492906949 42.3147711126569,
14+
-71.1041598612795 42.314808571739,-71.1042515013869 42.3151287620809,
15+
-71.1041173835118 42.3150739481917,-71.1040809891419 42.3151344119048,
16+
-71.1040438678912 42.3151191367447,-71.1040194562988 42.3151832057859,
17+
-71.1038734225584 42.3151140942995,-71.1038446938243 42.3151006300338,
18+
-71.1038315271889 42.315094347535,-71.1037393329282 42.315054824985,
19+
-71.1035447555574 42.3152608696313,-71.1033436658644 42.3151648370544,
20+
-71.1032580383161 42.3152269126061,-71.103223066939 42.3152517403219,
21+
-71.1031880899493 42.3152774590236)),
22+
((-71.1043632495873 42.315113108546,-71.1043583974082 42.3151211109857,
23+
-71.1043443253471 42.3150676015829,-71.1043850704575 42.3150793250568,-71.1043632495873 42.315113108546)))

0 commit comments

Comments
 (0)