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 acf4994d authored by Samuël Weber's avatar Samuël Weber
Browse files

update table name

parent e8fd1fb6
......@@ -50,7 +50,7 @@ class SharedComponent():
"""
con = sqlite3.connect(settings.BDDPM)
dfmap = pd.read_sql(
"SELECT * FROM metadata_station WHERE abbreviation in ('{stations}');".format(
"SELECT * FROM metadata_station WHERE abbrv in ('{stations}');".format(
stations="', '".join(stations)
),
con=con
......@@ -67,17 +67,17 @@ class SharedComponent():
# for typo in dfmap["area type"].unique():
# idx = dfmap["area type"] == typo
color = dfmap.loc[:, "abbreviation"].to_frame()
color = dfmap.loc[:, "abbrv"].to_frame()
color["color"] = "black"
if selected is not None:
color.loc[color["abbreviation"].isin(selected), "color"] = "orange"
color.loc[color["abbrv"].isin(selected), "color"] = "orange"
traces.append(
dict(
type='scattergeo',
lon=dfmap.loc[:, 'longitude'],
lat=dfmap.loc[:, 'latitude'],
text=dfmap.loc[:, 'abbreviation'],
text=dfmap.loc[:, 'abbrv'],
mode='markers',
name='',
marker=dict(
......@@ -116,7 +116,7 @@ class SharedComponent():
# """
# con = sqlite3.connect(settings.BDDPM)
# dfmap = pd.read_sql(
# "SELECT * FROM metadata_station WHERE abbreviation in ('{stations}');".format(
# "SELECT * FROM metadata_station WHERE abbrv in ('{stations}');".format(
# stations="', '".join(stations)
# ),
# con=con
......@@ -127,7 +127,7 @@ class SharedComponent():
# type='scattergeo',
# lon=dfmap['longitude'],
# lat=dfmap['latitude'],
# text=dfmap['abbreviation'],
# text=dfmap['abbrv'],
# mode='markers',
# name=''
# )
......@@ -178,7 +178,7 @@ class SharedComponent():
def get_map_figure(self, stations, selected=None):
con = sqlite3.connect(settings.BDDPM)
dfmap = pd.read_sql(
"SELECT * FROM metadata_station WHERE abbreviation in ('{stations}');".format(
"SELECT * FROM metadata_station WHERE abbrv in ('{stations}');".format(
stations="', '".join(stations)
),
con=con
......@@ -193,12 +193,12 @@ class SharedComponent():
# dfmap["markers"] = dfmap["area type"].apply(lambda x: markers_typo[x])
dfmap["colors"] = "black"
if selected is not None:
dfmap.loc[dfmap["abbreviation"].isin(selected), "colors"] = "orange"
dfmap.loc[dfmap["abbrv"].isin(selected), "colors"] = "orange"
# fig = px.scatter_mapbox(
fig = px.scatter_geo(
dfmap, lat="latitude", lon="longitude",
text="abbreviation", color="colors",
text="abbrv", color="colors",
)
# fig.update_traces(
# # marker_symbol="square",
......
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