From 701573ead122a3a111ee23f50602b1992d98684f Mon Sep 17 00:00:00 2001 From: Robin Wimmers Date: Mon, 15 Jul 2024 13:33:18 +0200 Subject: [PATCH] chore(SBR): update notebook add matplotlib widget --- notebooks/NBxxxxx_SBR.ipynb | 57 ++++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/notebooks/NBxxxxx_SBR.ipynb b/notebooks/NBxxxxx_SBR.ipynb index 72c1132..0210fa4 100644 --- a/notebooks/NBxxxxx_SBR.ipynb +++ b/notebooks/NBxxxxx_SBR.ipynb @@ -31,6 +31,8 @@ "metadata": {}, "outputs": [], "source": [ + "# %matplotlib widget\n", + "\n", "import os\n", "from typing import Dict\n", "import io\n", @@ -460,7 +462,23 @@ " index_parts=False\n", " )\n", "\n", - "fig = map_payload(buildings, location)\n", + "fig = map_payload(\n", + " buildings,\n", + " location,\n", + " settings={\n", + " \"source_location\": {\"label\": \"Trillingsbron\", \"color\": \"black\"},\n", + " \"sensitive_cat1\": {\n", + " \"label\": \"Monumentaal/ gevoelig - Cat.1\",\n", + " \"color\": \"blue\",\n", + " },\n", + " \"sensitive_cat2\": {\n", + " \"label\": \"Monumentaal/ gevoelig - Cat.2\",\n", + " \"color\": \"cyan\",\n", + " },\n", + " \"normal_cat1\": {\"label\": \"Normaal - Cat.1\", \"color\": \"orange\"},\n", + " \"normal_cat2\": {\"label\": \"Normaal - Cat.2\", \"color\": \"olive\"},\n", + " },\n", + ")\n", "\n", "# add basemap\n", "ctx.add_basemap(fig.axes[0], crs=\"EPSG:28992\", source=ctx.providers.Esri.WorldTopoMap)\n", @@ -562,7 +580,18 @@ "metadata": {}, "outputs": [], "source": [ - "fig = results.map(location)\n", + "fig = results.map(\n", + " location,\n", + " settings={\n", + " \"source_location\": {\"label\": \"Trillingsbron\", \"color\": \"black\"},\n", + " \"insufficient_cat1\": {\n", + " \"label\": \"Voldoet Niet - Cat.1\",\n", + " \"color\": \"orange\",\n", + " },\n", + " \"insufficient_cat2\": {\"label\": \"Voldoet Niet - Cat.2\", \"color\": \"red\"},\n", + " \"sufficient\": {\"label\": \"Voldoet\", \"color\": \"green\"},\n", + " },\n", + ")\n", "\n", "# add basemap\n", "ctx.add_basemap(fig.axes[0], crs=\"EPSG:28992\", source=ctx.providers.Esri.WorldTopoMap)" @@ -644,35 +673,43 @@ " \"source_location\": {\"label\": \"Trillingsbron\", \"color\": \"blue\"},\n", " \"levels\": [\n", " {\n", - " \"label\": \"<= 1 day\",\n", + " \"key\": \"<= 1 day\",\n", + " \"label\": \"<= 1 dag\",\n", " \"color\": \"darkred\",\n", " },\n", " # {\n", - " # \"label\": \"2 days\",\n", + " # \"key\": \"2 days\",\n", + " # \"label\": \"2 dagen\",\n", " # \"color\": \"red\",\n", " # },\n", " # {\n", - " # \"label\": \"3 days\",\n", + " # \"key\": \"3 days\",\n", + " # \"label\": \"3 dagen\",\n", " # \"color\": \"red\",\n", " # },\n", " # {\n", - " # \"label\": \"4 days\",\n", + " # \"key\": \"4 days\",\n", + " # \"label\": \"4 dagen\",\n", " # \"color\": \"red\",\n", " # },\n", " # {\n", - " # \"label\": \"5 days\",\n", + " # \"key\": \"5 days\",\n", + " # \"label\": \"5 dagen\",\n", " # \"color\": \"red\",\n", " # },\n", " {\n", - " \"label\": \">= 6 days; <26 days\",\n", + " \"key\": \">= 6 days; <26 days\",\n", + " \"label\": \">= 6 dagen; <26 dagen\",\n", " \"color\": \"orange\",\n", " },\n", " {\n", - " \"label\": \">= 26 days; <78 days\",\n", + " \"key\": \">= 26 days; <78 days\",\n", + " \"label\": \">= 26 dagen; <78 dagen\",\n", " \"color\": \"green\",\n", " },\n", " {\n", - " \"label\": \"Unlimited\",\n", + " \"key\": \"Unlimited\",\n", + " \"label\": \"Onbeperkt\",\n", " \"color\": \"black\",\n", " },\n", " ],\n",