Skip to content

Commit 541f3e6

Browse files
Update map code, blacken
Co-authored-by: gahjelle <[email protected]>
1 parent b4ac327 commit 541f3e6

File tree

2 files changed

+58
-57
lines changed

2 files changed

+58
-57
lines changed

folium-web-maps/footprint.html

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

folium-web-maps/footprint.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,24 @@
33

44
eco_footprints = pd.read_csv("footprint.csv")
55
max_eco_footprint = eco_footprints["Ecological footprint"].max()
6-
political_countries_url = "https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_admin_0_countries.geojson" # noqa: E501
6+
political_countries_url = (
7+
"http://geojson.xyz/naturalearth-3.3.0/ne_50m_admin_0_countries.geojson"
8+
)
79

8-
m = folium.Map(location=(30, 0), zoom_start=3, tiles="cartodb positron")
10+
m = folium.Map(location=(30, 10), zoom_start=3, tiles="cartodb positron")
911
folium.Choropleth(
1012
geo_data=political_countries_url,
1113
data=eco_footprints,
1214
columns=("Country/region", "Ecological footprint"),
1315
key_on="feature.properties.name",
1416
bins=(0, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, max_eco_footprint),
15-
fill_color="YlOrRd",
17+
fill_color="RdYlGn_r",
1618
fill_opacity=0.8,
1719
line_opacity=0.3,
1820
nan_fill_color="white",
19-
legend_name="Ecological footprint",
20-
name="Ecological footprint by country",
21+
legend_name="Ecological footprint per capita",
22+
name="Countries by ecological footprint per capita",
2123
).add_to(m)
22-
2324
folium.LayerControl().add_to(m)
2425

2526
m.save("footprint.html")

0 commit comments

Comments
 (0)