diff --git a/examples/internet-speeds.ipynb b/examples/internet-speeds.ipynb index e0a52adc..a344aaa7 100644 --- a/examples/internet-speeds.ipynb +++ b/examples/internet-speeds.ipynb @@ -365,20 +365,22 @@ "cell_type": "code", "execution_count": 10, "id": "326f5f4e-a8f7-425b-8e9f-6744ba65cf62", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "30ba30dd2b9f4d47b307fa98ea9bf896", + "model_id": "cd6f767934bd451bb8f89088039e7af5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "ScatterplotLayer(table=pyarrow.Table\n", - "avg_d_kbps: int64\n", "__index_level_0__: int64\n", - "geometry: fixed_size_list[2]\n", + " chi…" ] }, "execution_count": 10, @@ -387,7 +389,7 @@ } ], "source": [ - "map_ = viz(gdf)\n", + "map_ = viz(gdf.geometry)\n", "map_" ] }, @@ -396,7 +398,8 @@ "id": "91af2a88-9363-4c00-8e54-f06a635ff991", "metadata": {}, "source": [ - "This map object is a `ScatterplotLayer` type. You could have created the same map by using\n", + "This map object is a [`ScatterplotLayer`](https://developmentseed.org/lonboard/api/layers/scatterplot-layer/) type. You could have created the same map by using\n", + "\n", "```py\n", "map_ = lonboard.ScatterplotLayer.from_geopandas(gdf)\n", "```" @@ -531,7 +534,7 @@ "
BrBG
\"BrBG
under
bad
over
" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, diff --git a/examples/north-america-roads.ipynb b/examples/north-america-roads.ipynb index cfb45b40..9894f4f3 100644 --- a/examples/north-america-roads.ipynb +++ b/examples/north-america-roads.ipynb @@ -39,7 +39,7 @@ "import geopandas as gpd\n", "import palettable.colorbrewer.diverging\n", "\n", - "from lonboard import PathLayer\n", + "from lonboard import PathLayer, viz\n", "from lonboard.colormap import apply_continuous_cmap" ] }, @@ -101,7 +101,9 @@ "cell_type": "code", "execution_count": 4, "id": "14d60ee4-4006-48b3-8ddb-52e3ae6002da", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "data": { @@ -277,7 +279,7 @@ "metadata": {}, "outputs": [], "source": [ - "gdf = gdf[(gdf['country'] == 'United States') & (~gdf['state'].isin(['Hawaii', 'Alaska']))]" + "gdf = gdf[gdf[\"state\"] == \"California\"]" ] }, { @@ -297,17 +299,14 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ab1597e0dde74743a143d1b4f35247a7", + "model_id": "8b473d8dd0c640d09b2f7b1163785f8d", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "PathLayer(get_color=[0, 0, 0], table=pyarrow.Table\n", - "prefix: string\n", - "number: string\n", - "class: string\n", - "type: string\n", - "di…" + "PathLayer(table=pyarrow.Table\n", + "__index_level_0__: int64\n", + "geometry: listPuOr
\"PuOr
under
bad
over
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 11, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -460,41 +509,23 @@ "id": "74d9d749-4222-4aa8-bf12-ded79187a616", "metadata": {}, "source": [ - "Now we'll use `apply_continuous_cmap` onto this array to generate colors for our data:" + "Now we'll use `apply_continuous_cmap` onto this array to generate colors for our data. Just set this new array onto the existing map, and you'll see the map update with the new colors!" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "id": "7288a2d7-3190-4f9e-b29e-bbba32109024", "metadata": {}, "outputs": [], "source": [ - "get_color = apply_continuous_cmap(normalized_scale_rank, palettable.colorbrewer.diverging.PuOr_10, alpha=0.8)" - ] - }, - { - "cell_type": "markdown", - "id": "efbe28aa-c004-41cd-90c9-d12c310b5d95", - "metadata": {}, - "source": [ - "Just set this new array onto the existing map, and you'll see the map update with the new colors!" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "0173cced-68fa-4966-9bb8-42f44f35e74b", - "metadata": {}, - "outputs": [], - "source": [ - "map_.get_color = get_color" + "map_.get_color = apply_continuous_cmap(normalized_scale_rank, palettable.colorbrewer.diverging.PuOr_10, alpha=0.8)" ] }, { "cell_type": "code", "execution_count": null, - "id": "82e50385-137d-46e5-91cc-558b252fd757", + "id": "72807632-f5de-4dcc-9c8e-f4e0c8495e2b", "metadata": {}, "outputs": [], "source": [] @@ -502,9 +533,9 @@ ], "metadata": { "kernelspec": { - "display_name": "lonboard", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "lonboard" + "name": "python3" }, "language_info": { "codemirror_mode": {