{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "0", "metadata": {}, "outputs": [], "source": [ "# %pip install leafmap" ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "import leafmap.maplibregl as leafmap\n", "import ipywidgets as widgets" ] }, { "cell_type": "code", "execution_count": null, "id": "2", "metadata": {}, "outputs": [], "source": [ "tw = leafmap.TabWidget(\n", " title=\"Interactive Dashboard\",\n", " tabs=(\"Home\", \"Map\", \"Population\", \"Settings\"),\n", " icons=(\"mdi-home\", \"mdi-airplane\", \"mdi-account-box\", \"mdi-cog\"),\n", " show_panel_titles=False,\n", ")\n", "\n", "# Customize dialog\n", "tw.set_help_title(\"About this dashboard\")\n", "tw.set_help_content(\n", " widgets.HTML(\n", " \"\"\"\n", "
User Guide
\n", "This is the home tab.
\n", "This is the settings tab.
\n", " \"\"\"\n", ")\n", "\n", "data = \"https://github.com/opengeos/datasets/releases/download/vector/countries.geojson\"\n", "\n", "m2 = leafmap.Map(style=\"liberty\", projection=\"globe\")\n", "first_symbol_id = m2.find_first_symbol_layer()[\"id\"]\n", "m2.add_data(\n", " data,\n", " column=\"POP_EST\",\n", " scheme=\"Quantiles\",\n", " cmap=\"Blues\",\n", " legend_title=\"Population\",\n", " name=\"population\",\n", " # before_id=first_symbol_id,\n", " extrude=True,\n", " scale_factor=1000,\n", ")\n", "container = m2.create_container()\n", "\n", "tw.set_tab_content(0, home_tab)\n", "tw.set_tab_content(1, m.container)\n", "tw.set_tab_content(3, settings_tab)\n", "tw.set_tab_content(2, m2.container)\n", "\n", "tw.widget" ] } ], "metadata": { "kernelspec": { "display_name": "geo", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 5 }