Skip to content

Commit

Permalink
Update notebook 83 (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Nov 6, 2023
1 parent 0ece5f8 commit 9f1b089
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 7 deletions.
54 changes: 51 additions & 3 deletions docs/notebooks/83_vector_viz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"outputs": [],
"source": [
"import leafmap.deckgl as leafmap\n",
"import geopandas as gpd"
"import geopandas as gpd\n",
"import ipywidgets as widgets"
]
},
{
Expand Down Expand Up @@ -128,7 +129,54 @@
},
"outputs": [],
"source": [
"m.layers[-1].get_fill_color = [0, 0, 255, 255]"
"layer = m.layers[-1]\n",
"layer.get_fill_color = [0, 0, 255, 255]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Interactive widgets."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"color = widgets.ColorPicker(value='red', description='Color')\n",
"width = widgets.IntSlider(min=1, max=100, value=10, description='Radius')\n",
"hbox = widgets.HBox([color, width])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"widgets.dlink((color, 'value'), (layer, 'get_fill_color'))\n",
"widgets.dlink((width, 'value'), (layer, 'get_radius'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hbox"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m"
]
}
],
Expand All @@ -148,7 +196,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
54 changes: 51 additions & 3 deletions examples/notebooks/83_vector_viz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"outputs": [],
"source": [
"import leafmap.deckgl as leafmap\n",
"import geopandas as gpd"
"import geopandas as gpd\n",
"import ipywidgets as widgets"
]
},
{
Expand Down Expand Up @@ -128,7 +129,54 @@
},
"outputs": [],
"source": [
"m.layers[-1].get_fill_color = [0, 0, 255, 255]"
"layer = m.layers[-1]\n",
"layer.get_fill_color = [0, 0, 255, 255]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Interactive widgets."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"color = widgets.ColorPicker(value='red', description='Color')\n",
"width = widgets.IntSlider(min=1, max=100, value=10, description='Radius')\n",
"hbox = widgets.HBox([color, width])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"widgets.dlink((color, 'value'), (layer, 'get_fill_color'))\n",
"widgets.dlink((width, 'value'), (layer, 'get_radius'))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hbox"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m"
]
}
],
Expand All @@ -148,7 +196,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion leafmap/deckgl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import geopandas as gpd

except ImportError:
raise (
raise Exception(
"lonboard needs to be installed to use this module. Use 'pip install lonboard' to install the package."
)

Expand Down

0 comments on commit 9f1b089

Please sign in to comment.