From 19d86b263c7334561cfd27b44deb84feef3c9069 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 21 Feb 2025 12:43:34 +0000 Subject: [PATCH 1/5] Use pyodide kernel in JupyterLite to deploy tutorial --- .github/workflows/deploy.yml | 47 ++++++++++++++++++ .gitignore | 4 ++ README.md | 19 +++++++ environment.yml | 16 ------ data/__init__.py => notebooks/.nojekyll | 0 notebooks/01_introduction.ipynb | 6 ++- notebooks/02_installation_and_setup.ipynb | 2 +- notebooks/03_basic_concepts.ipynb | 2 +- notebooks/04_basic_plots.ipynb | 4 +- notebooks/05_styling.ipynb | 4 +- notebooks/06_data_sources.ipynb | 4 +- notebooks/07_annotations.ipynb | 4 +- notebooks/08_plot_tools.ipynb | 4 +- notebooks/09_more_plot_types.ipynb | 10 ++-- notebooks/10_layouts.ipynb | 4 +- notebooks/11_widgets_interactivity.ipynb | 6 ++- notebooks/12_demo_dashboard.ipynb | 14 ++++-- notebooks/13_exporting_embedding.ipynb | 2 +- ...MARKET_US_CARRIER_ONLY_20220506_205137.zip | Bin notebooks/data/__init__.py | 0 {data => notebooks/data}/carriers_data.py | 0 {data => notebooks/data}/us-states.geojson | 0 notebooks/tutorial_dashboard.py | 4 +- notebooks/tutorial_data.py | 4 +- requirements.txt | 3 ++ 25 files changed, 123 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 environment.yml rename data/__init__.py => notebooks/.nojekyll (100%) rename {data => notebooks/data}/T_T100D_MARKET_US_CARRIER_ONLY_20220506_205137.zip (100%) create mode 100644 notebooks/data/__init__.py rename {data => notebooks/data}/carriers_data.py (100%) rename {data => notebooks/data}/us-states.geojson (100%) create mode 100644 requirements.txt diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..217c36d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: Build and deploy to github pages + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + - name: Install the dependencies + run: | + python -m pip install -r requirements.txt + - name: Build the JupyterLite site + run: | + jupyter lite build --contents notebooks --output-dir dist + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + needs: build + if: github.ref == 'refs/heads/main' + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 1f565fd..c26e4c6 100644 --- a/.gitignore +++ b/.gitignore @@ -134,3 +134,7 @@ dmypy.json # Pyre type checker .pyre/ + +# JupyterLite deployment +.jupyterlite.doit.db +_output/ diff --git a/README.md b/README.md index 37894bc..6ad075c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ +# Work in progress to use pyodide kernel in JupyterLite for tutorial + +Deployed to github pages at https://bokeh.github.io/tutorial + +To try out locally, create a python virtual environment of your choice (`venv`, `pyenv`, +'mamba', `conda`, etc) and follow these steps: + +```bash +python -m pip install -r requirements.txt +jupyter lite build --contents notebooks +jupyter lite serve +``` + +and open a web browser at the URL specified. + +------------------------ + + + # Bokeh tutorial notebooks ## Setup and run the tutorials diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 7c123f5..0000000 --- a/environment.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: bk-tutorial -channels: - - conda-forge -dependencies: - - python>=3.12 - - pip - - geojson - - geopandas - - jupyter_client<8 - - notebook - - pandas - - pyshp - - ipykernel - - pip: - - bokeh==3.5 - - bokeh_sampledata diff --git a/data/__init__.py b/notebooks/.nojekyll similarity index 100% rename from data/__init__.py rename to notebooks/.nojekyll diff --git a/notebooks/01_introduction.ipynb b/notebooks/01_introduction.ipynb index 646473b..d0ffe02 100644 --- a/notebooks/01_introduction.ipynb +++ b/notebooks/01_introduction.ipynb @@ -127,6 +127,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q geopandas\n", + "\n", "# load and display tutorial dashboard\n", "from tutorial_dashboard import dashboard_layout\n", "\n", @@ -245,7 +247,7 @@ "Python script.\n", "This tutorial will reference the data preparation script but will not go into detail\n", "about the data preparation itself.\n", - "You can find the data processing code in [`carriers_data.py`](../data/carriers_data.py).\n", + "You can find the data processing code in [`carriers_data.py`](./data/carriers_data.py).\n", "\n", "This tutorial is designed to run on [mybinder.org](https://mybinder.readthedocs.io/en/latest/).\n", "You can also run this tutorial locally on your computer.\n", @@ -286,7 +288,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/02_installation_and_setup.ipynb b/notebooks/02_installation_and_setup.ipynb index 4c78c47..a1e2ee9 100644 --- a/notebooks/02_installation_and_setup.ipynb +++ b/notebooks/02_installation_and_setup.ipynb @@ -117,7 +117,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/03_basic_concepts.ipynb b/notebooks/03_basic_concepts.ipynb index 6c8cb7d..865b451 100644 --- a/notebooks/03_basic_concepts.ipynb +++ b/notebooks/03_basic_concepts.ipynb @@ -256,7 +256,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/04_basic_plots.ipynb b/notebooks/04_basic_plots.ipynb index db22639..a568d6d 100644 --- a/notebooks/04_basic_plots.ipynb +++ b/notebooks/04_basic_plots.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -525,7 +527,7 @@ "This is an example of how you can customize the appearance of the different\n", "elements of your plot.\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/05_styling.ipynb b/notebooks/05_styling.ipynb index 20905cc..e17e948 100644 --- a/notebooks/05_styling.ipynb +++ b/notebooks/05_styling.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -749,7 +751,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/06_data_sources.ipynb b/notebooks/06_data_sources.ipynb index 9b6de1f..9f26a5e 100644 --- a/notebooks/06_data_sources.ipynb +++ b/notebooks/06_data_sources.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -456,7 +458,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/07_annotations.ipynb b/notebooks/07_annotations.ipynb index df90c38..fe1bc08 100644 --- a/notebooks/07_annotations.ipynb +++ b/notebooks/07_annotations.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -613,7 +615,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/08_plot_tools.ipynb b/notebooks/08_plot_tools.ipynb index dd001d4..a8f71ca 100644 --- a/notebooks/08_plot_tools.ipynb +++ b/notebooks/08_plot_tools.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -543,7 +545,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/09_more_plot_types.ipynb b/notebooks/09_more_plot_types.ipynb index 0d6e293..50e11eb 100644 --- a/notebooks/09_more_plot_types.ipynb +++ b/notebooks/09_more_plot_types.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -173,6 +175,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q geojson geopandas shapely\n", + "\n", "from shapely.geometry import Point\n", "from pyproj import CRS, Transformer\n", "import geojson\n", @@ -309,7 +313,7 @@ "metadata": {}, "outputs": [], "source": [ - "states_gdf = gpd.read_file(\"../data/us-states.geojson\")\n", + "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", "states_gdf.plot() # use geopandas to plot the state shapes" ] }, @@ -376,7 +380,7 @@ "from bokeh.transform import linear_cmap\n", "\n", "# read the GeoJSON file containing the state shapes\n", - "states_gdf = gpd.read_file(\"../data/us-states.geojson\")\n", + "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", "# read the pre-processed data frame from the demo data set and join it to the state shapes\n", "states_gdf = states_gdf.join(data.get_states_routes_df(), on=states_gdf[\"Name\"])\n", "# create the GeoJSONDataSource\n", @@ -852,7 +856,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/10_layouts.ipynb b/notebooks/10_layouts.ipynb index 3c2e0bd..89570c0 100644 --- a/notebooks/10_layouts.ipynb +++ b/notebooks/10_layouts.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -405,7 +407,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/11_widgets_interactivity.ipynb b/notebooks/11_widgets_interactivity.ipynb index 81f4db7..064ba36 100644 --- a/notebooks/11_widgets_interactivity.ipynb +++ b/notebooks/11_widgets_interactivity.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -287,6 +289,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q bokeh-sampledata\n", + "\n", "import pandas as pd\n", "\n", "from bokeh.palettes import Spectral4\n", @@ -1206,7 +1210,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/12_demo_dashboard.ipynb b/notebooks/12_demo_dashboard.ipynb index cb6f79e..55151b3 100644 --- a/notebooks/12_demo_dashboard.ipynb +++ b/notebooks/12_demo_dashboard.ipynb @@ -29,6 +29,8 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q pandas\n", + "\n", "# load tutorial data\n", "from tutorial_data import data" ] @@ -1218,9 +1220,11 @@ "metadata": {}, "outputs": [], "source": [ + "%pip install -q geopandas\n", "import geopandas as gpd\n", + "import matplotlib\n", "\n", - "states_gdf = gpd.read_file(\"../data/us-states.geojson\")\n", + "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", "states_gdf.plot() # use geopandas to plot the state shapes" ] }, @@ -1316,7 +1320,7 @@ "outputs": [], "source": [ "# read the geojson file containing the state shapes\n", - "states_gdf = gpd.read_file(\"../data/us-states.geojson\")\n", + "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", "# read the pre-processed data frame from the demo data set and join it to the state shapes\n", "states_gdf = states_gdf.join(data.get_states_routes_df(), on=states_gdf[\"Name\"])\n", "# create the GeoJSONDataSource\n", @@ -1483,7 +1487,7 @@ "from bokeh.transform import linear_cmap\n", "\n", "# read the geojson file containing the state shapes\n", - "states_gdf = gpd.read_file(\"../data/us-states.geojson\")\n", + "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", "# read the pre-processed data frame from the demo data set and join it to the state shapes\n", "states_gdf = states_gdf.join(data.get_states_routes_df(), on=states_gdf[\"Name\"])\n", "# create the GeoJSONDataSource\n", @@ -1578,7 +1582,7 @@ "For details about how to compute the angles, see the detailed example in the\n", "[Wedge plots section](09_more_plot_types.ipynb#Wedge-plots).\n", "For the specific code generating these DataFrames, see the function\n", - "``get_top_carriers_by_metrics`` in [carriers_data.py](../data/carriers_data.py)." + "``get_top_carriers_by_metrics`` in [carriers_data.py](./data/carriers_data.py)." ] }, { @@ -1898,7 +1902,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/notebooks/13_exporting_embedding.ipynb b/notebooks/13_exporting_embedding.ipynb index 3d3ceb0..a6e1a0d 100644 --- a/notebooks/13_exporting_embedding.ipynb +++ b/notebooks/13_exporting_embedding.ipynb @@ -334,7 +334,7 @@ "source": [ "# Next section\n", "\n", - "\n", + "\n", " \"Next\n", "\n", "\n", diff --git a/data/T_T100D_MARKET_US_CARRIER_ONLY_20220506_205137.zip b/notebooks/data/T_T100D_MARKET_US_CARRIER_ONLY_20220506_205137.zip similarity index 100% rename from data/T_T100D_MARKET_US_CARRIER_ONLY_20220506_205137.zip rename to notebooks/data/T_T100D_MARKET_US_CARRIER_ONLY_20220506_205137.zip diff --git a/notebooks/data/__init__.py b/notebooks/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/data/carriers_data.py b/notebooks/data/carriers_data.py similarity index 100% rename from data/carriers_data.py rename to notebooks/data/carriers_data.py diff --git a/data/us-states.geojson b/notebooks/data/us-states.geojson similarity index 100% rename from data/us-states.geojson rename to notebooks/data/us-states.geojson diff --git a/notebooks/tutorial_dashboard.py b/notebooks/tutorial_dashboard.py index 2094daa..a9ad995 100644 --- a/notebooks/tutorial_dashboard.py +++ b/notebooks/tutorial_dashboard.py @@ -20,7 +20,7 @@ from bokeh.transform import cumsum, linear_cmap # Load data set object -sys.path.append("../data") +sys.path.append("./data") from carriers_data import CarrierDataSet data = CarrierDataSet() @@ -208,7 +208,7 @@ def distance_plot(): def departures_map(): # read the geojson file containing the state shapes - states_gdf = gpd.read_file("../data/us-states.geojson") + states_gdf = gpd.read_file("./data/us-states.geojson") # read the pre-processed data frame from the demo data set and join it to the state shapes states_gdf = states_gdf.join(data.get_states_routes_df(), on=states_gdf["Name"]) # create the GeoJSONDataSource diff --git a/notebooks/tutorial_data.py b/notebooks/tutorial_data.py index 7489cb4..d185d12 100644 --- a/notebooks/tutorial_data.py +++ b/notebooks/tutorial_data.py @@ -1,9 +1,9 @@ -""" Shortcut for loading data from the ../data folder """ +""" Shortcut for loading data from the ./data folder """ import sys # Load data set object -sys.path.append("../data") +sys.path.append("./data") from carriers_data import CarrierDataSet data = CarrierDataSet() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..92135b3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +jupyterlite-core +jupyterlite-pyodide-kernel +jupyter-server From 74435a3151b3c4f8ecc40225bd21912365f43e4a Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 21 Feb 2025 13:04:27 +0000 Subject: [PATCH 2/5] Allow deployment via workflow dispatch --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 217c36d..b12c38d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - '*' + workflow_dispatch: jobs: build: From 16806fb140c230525aff21d0194782f0e5ec611f Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 21 Feb 2025 13:06:33 +0000 Subject: [PATCH 3/5] Temporarily allow deployment from PR not just main branch --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b12c38d..eccabec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: deploy: needs: build - if: github.ref == 'refs/heads/main' + #if: github.ref == 'refs/heads/main' permissions: pages: write id-token: write From a1ac33042edd8014ce6cac0ad96810d4975b951b Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 21 Feb 2025 13:12:34 +0000 Subject: [PATCH 4/5] .nojekyll file in top-level directory --- notebooks/.nojekyll => .nojekyll | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename notebooks/.nojekyll => .nojekyll (100%) diff --git a/notebooks/.nojekyll b/.nojekyll similarity index 100% rename from notebooks/.nojekyll rename to .nojekyll From 0a56ab86165602b5ded661ce5d01c3c9335f9359 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Wed, 5 Mar 2025 08:23:00 +0000 Subject: [PATCH 5/5] Better pip install and remove matplotlib plots --- notebooks/01_introduction.ipynb | 2 +- notebooks/04_basic_plots.ipynb | 3 +-- notebooks/05_styling.ipynb | 3 +-- notebooks/06_data_sources.ipynb | 3 +-- notebooks/07_annotations.ipynb | 3 +-- notebooks/08_plot_tools.ipynb | 3 +-- notebooks/09_more_plot_types.ipynb | 5 ++--- notebooks/10_layouts.ipynb | 3 +-- notebooks/11_widgets_interactivity.ipynb | 3 +-- notebooks/12_demo_dashboard.ipynb | 6 ++---- notebooks/13_exporting_embedding.ipynb | 12 +++--------- 11 files changed, 15 insertions(+), 31 deletions(-) diff --git a/notebooks/01_introduction.ipynb b/notebooks/01_introduction.ipynb index d0ffe02..d13d6ef 100644 --- a/notebooks/01_introduction.ipynb +++ b/notebooks/01_introduction.ipynb @@ -127,9 +127,9 @@ "metadata": {}, "outputs": [], "source": [ + "# Install geopandas into pyodide environment running in browser\n", "%pip install -q geopandas\n", "\n", - "# load and display tutorial dashboard\n", "from tutorial_dashboard import dashboard_layout\n", "\n", "show(dashboard_layout)" diff --git a/notebooks/04_basic_plots.ipynb b/notebooks/04_basic_plots.ipynb index a568d6d..16ae546 100644 --- a/notebooks/04_basic_plots.ipynb +++ b/notebooks/04_basic_plots.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/05_styling.ipynb b/notebooks/05_styling.ipynb index e17e948..d261cc5 100644 --- a/notebooks/05_styling.ipynb +++ b/notebooks/05_styling.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/06_data_sources.ipynb b/notebooks/06_data_sources.ipynb index 9f26a5e..55a2f58 100644 --- a/notebooks/06_data_sources.ipynb +++ b/notebooks/06_data_sources.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/07_annotations.ipynb b/notebooks/07_annotations.ipynb index fe1bc08..f0ac1ab 100644 --- a/notebooks/07_annotations.ipynb +++ b/notebooks/07_annotations.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/08_plot_tools.ipynb b/notebooks/08_plot_tools.ipynb index a8f71ca..bd9b806 100644 --- a/notebooks/08_plot_tools.ipynb +++ b/notebooks/08_plot_tools.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/09_more_plot_types.ipynb b/notebooks/09_more_plot_types.ipynb index 50e11eb..97a65b1 100644 --- a/notebooks/09_more_plot_types.ipynb +++ b/notebooks/09_more_plot_types.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, @@ -314,7 +313,7 @@ "outputs": [], "source": [ "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", - "states_gdf.plot() # use geopandas to plot the state shapes" + "states_gdf.head()" ] }, { diff --git a/notebooks/10_layouts.ipynb b/notebooks/10_layouts.ipynb index 89570c0..8e6d6b9 100644 --- a/notebooks/10_layouts.ipynb +++ b/notebooks/10_layouts.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/11_widgets_interactivity.ipynb b/notebooks/11_widgets_interactivity.ipynb index 064ba36..59a986b 100644 --- a/notebooks/11_widgets_interactivity.ipynb +++ b/notebooks/11_widgets_interactivity.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, diff --git a/notebooks/12_demo_dashboard.ipynb b/notebooks/12_demo_dashboard.ipynb index 55151b3..549d376 100644 --- a/notebooks/12_demo_dashboard.ipynb +++ b/notebooks/12_demo_dashboard.ipynb @@ -29,9 +29,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -q pandas\n", - "\n", "# load tutorial data\n", + "%pip install -q pandas\n", "from tutorial_data import data" ] }, @@ -1222,10 +1221,9 @@ "source": [ "%pip install -q geopandas\n", "import geopandas as gpd\n", - "import matplotlib\n", "\n", "states_gdf = gpd.read_file(\"./data/us-states.geojson\")\n", - "states_gdf.plot() # use geopandas to plot the state shapes" + "states_gdf.head(2)" ] }, { diff --git a/notebooks/13_exporting_embedding.ipynb b/notebooks/13_exporting_embedding.ipynb index a6e1a0d..10cd14b 100644 --- a/notebooks/13_exporting_embedding.ipynb +++ b/notebooks/13_exporting_embedding.ipynb @@ -91,15 +91,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "

\n", - " ✨ The HTML output file of the complete dashboard is hosted at: bokeh.github.io/tutorial ↗️\n", - "

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ + "The HTML file is saved with the name `custom_filename.html` and appears in the file browser on the left.\n", + "Double-click it to open it; you may have to confirm that you trust the file contents depending on your browser and privacy settings.\n", + "\n", "Calling `output_file` **switches Bokeh to file output mode persistently**.\n", "This means that all subsequent calls to `show` will generate output to the specified file.\n", "\n",