{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-04-05T22:38:12.529444Z", "start_time": "2019-04-05T22:38:10.709541Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.8.3+52.g2758dc7.dirty\n" ] } ], "source": [ "import os\n", "import folium\n", "\n", "print(folium.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load GeoJSON as in [GeoJSON_and_choropleth.ipynb](https://github.com/python-visualization/folium/blob/master/examples/GeoJSON_and_choropleth.ipynb)." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-04-05T22:38:12.549432Z", "start_time": "2019-04-05T22:38:12.533446Z" } }, "outputs": [], "source": [ "import json\n", "import requests\n", "\n", "url = 'https://raw.githubusercontent.com/python-visualization/folium/master/examples/data'\n", "us_states = f'{url}/us-states.json'\n", "geo_json_data = json.loads(requests.get(us_states).text)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Using CustomPane to place labels above choropleth" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Map without custom pane" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-04-05T22:38:12.758314Z", "start_time": "2019-04-05T22:38:12.555438Z" } }, "outputs": [ { "data": { "text/html": [ "