Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit d3655ff4 authored by Samuël Weber's avatar Samuël Weber
Browse files

fix color stations map

parent 55d16e13
......@@ -151,10 +151,11 @@ class SharedComponent():
# for typo in dfmap["area type"].unique():
# idx = dfmap["area type"] == typo
color = dfmap.loc[:, "abbrv"].to_frame()
color = dfmap.loc[:, ["name", "abbrv"]]#.to_frame()
color["color"] = "black"
if selected is not None:
color.loc[color["abbrv"].isin(selected), "color"] = "orange"
idx_selected = color["abbrv"].isin(selected) | color["name"].isin(selected)
color.loc[idx_selected, "color"] = "orange"
traces.append(
dict(
......@@ -608,7 +609,7 @@ class SOURCESComponents():
"""
con = sqlite3.connect(settings.BDDSOURCES)
dfmap = pd.read_sql(
"SELECT * FROM metadata_station WHERE abbrv in ('{stations}');".format(
"SELECT * FROM metadata_station WHERE abbrv in ('{stations}') OR name in ('{stations}');".format(
stations="', '".join(stations)
),
con=con
......@@ -627,10 +628,11 @@ class SOURCESComponents():
for typo in dfmap["area type"].unique():
idx = dfmap["area type"] == typo
color = dfmap.loc[idx, "abbrv"].to_frame()
color = dfmap.loc[idx, ["abbrv", "name"]]#.to_frame()
color["color"] = "black"
if selected is not None:
color.loc[color["abbrv"].isin(selected), "color"] = "orange"
idx_selected = color["abbrv"].isin(selected) | color["name"].isin(selected)
color.loc[idx_selected, "color"] = "orange"
traces.append(
dict(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment