forked from jupyter-widgets/ipyleaflet
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jupyter-widgets#1005 from jasongrout/legend
Add deprecation warnings for API changes
- Loading branch information
Showing
15 changed files
with
853 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Releases | ||
======== | ||
|
||
The changes for each release are listed in the `ChangeLog <https://github.com/jupyter-widgets/ipyleaflet/blob/master/CHANGELOG.md>`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ Table of Contents | |
controls/index | ||
api_reference/index | ||
related_projects/index | ||
changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "66760b63-9004-4d71-ada9-4060a22d14bf", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "f3b845f957084672976f01fff6e5796e", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"Map(center=[43, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"import ipyleaflet\n", | ||
"import json\n", | ||
"import pandas as pd\n", | ||
"from ipywidgets import link, FloatSlider\n", | ||
"from branca.colormap import linear\n", | ||
"import random\n", | ||
"\n", | ||
"center = (43, -100)\n", | ||
"zoom = 4\n", | ||
"geo_json_data = json.load(open(\"us-states.json\"))\n", | ||
"m = ipyleaflet.Map(center=center, zoom=zoom)\n", | ||
"unemployment = pd.read_csv(\"US_Unemployment_Oct2012.csv\")\n", | ||
"unemployment = dict(\n", | ||
" zip(unemployment[\"State\"].tolist(), unemployment[\"Unemployment\"].tolist())\n", | ||
")\n", | ||
"layer = ipyleaflet.Choropleth(\n", | ||
" caption ='Unemployment rate',\n", | ||
" geo_data=geo_json_data,\n", | ||
" choro_data=unemployment,\n", | ||
" colormap=linear.YlOrRd_04,\n", | ||
" style={\"fillOpacity\": 0.8, \"dashArray\": \"5, 5\"},\n", | ||
")\n", | ||
"marker = ipyleaflet.Marker(location=center, draggable=False)\n", | ||
"m.add(marker)\n", | ||
"m.add(layer)\n", | ||
"m.remove(layer)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b871daf0-f835-4136-a941-97885d99bbaf", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"m.add(layer)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.