Skip to content

Commit

Permalink
chore(SBR): update notebook add matplotlib widget
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Jul 15, 2024
1 parent 731ee77 commit 701573e
Showing 1 changed file with 47 additions and 10 deletions.
57 changes: 47 additions & 10 deletions notebooks/NBxxxxx_SBR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"metadata": {},
"outputs": [],
"source": [
"# %matplotlib widget\n",
"\n",
"import os\n",
"from typing import Dict\n",
"import io\n",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 701573e

Please sign in to comment.