mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-30 20:34:04 +02:00
Update generate_map.py
This commit is contained in:
10
.github/generate_map.py
vendored
10
.github/generate_map.py
vendored
@@ -93,7 +93,6 @@ def username_to_country(login):
|
|||||||
|
|
||||||
|
|
||||||
def build_choropleth(percent_by_iso):
|
def build_choropleth(percent_by_iso):
|
||||||
# build dataframe-like structure for plotly
|
|
||||||
iso, vals = zip(*percent_by_iso.items())
|
iso, vals = zip(*percent_by_iso.items())
|
||||||
fig = px.choropleth(
|
fig = px.choropleth(
|
||||||
locations=list(iso),
|
locations=list(iso),
|
||||||
@@ -105,10 +104,13 @@ def build_choropleth(percent_by_iso):
|
|||||||
fig.update_layout(
|
fig.update_layout(
|
||||||
coloraxis_colorbar=dict(
|
coloraxis_colorbar=dict(
|
||||||
title="% stargazers",
|
title="% stargazers",
|
||||||
len=0.5,
|
orientation="h", # <-- échelle horizontale
|
||||||
|
x=0.5, # <-- centré
|
||||||
|
y=0, # <-- tout en bas
|
||||||
|
xanchor="center",
|
||||||
|
yanchor="bottom",
|
||||||
thickness=15,
|
thickness=15,
|
||||||
x=0.95,
|
len=0.7, # <-- longueur de l'échelle, ajustable
|
||||||
y=0.5,
|
|
||||||
),
|
),
|
||||||
margin=dict(l=0, r=0, t=0, b=0),
|
margin=dict(l=0, r=0, t=0, b=0),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user