LaurentTRIPIED commited on
Commit
6983fe3
1 Parent(s): b807d87

Pytorch V0.2

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -32,15 +32,26 @@ def display_organisations_engagees():
32
  df = df[["Nom", "Commune", "Section NAF", "Effectif", "Action RSE"]]
33
  st.dataframe(df, width=None, height=None)
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  def main():
36
  st.sidebar.title("Navigation")
37
- app_mode = st.sidebar.radio("Choose a page", ["Home", "Organisations Engagées"])
38
-
39
- if app_mode == "Home":
40
- st.header("Welcome to the RSE Data Explorer!")
41
- st.markdown("Please select a page on the left.")
42
- elif app_mode == "Organisations Engagées":
43
  display_organisations_engagees()
 
 
 
44
 
45
  if __name__ == "__main__":
46
  main()
 
32
  df = df[["Nom", "Commune", "Section NAF", "Effectif", "Action RSE"]]
33
  st.dataframe(df, width=None, height=None)
34
 
35
+ def display_map(data):
36
+ m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
37
+ for item in data:
38
+ if 'latitude' in item and 'longitude' in item:
39
+ folium.Marker(
40
+ location=[item['latitude'], item['longitude']],
41
+ popup=item.get('Nom', 'Sans nom'),
42
+ icon=folium.Icon(color="green", icon="leaf")
43
+ ).add_to(m)
44
+ folium_static(m)
45
+
46
  def main():
47
  st.sidebar.title("Navigation")
48
+ app_mode = st.sidebar.radio("Choisissez l'onglet", ["Organisations engagées", "Localisation des Entreprises"])
49
+
50
+ if app_mode == "Organisations engagées":
 
 
 
51
  display_organisations_engagees()
52
+ elif app_mode == "Localisation des Entreprises":
53
+ data, _ = get_data()
54
+ display_map(data)
55
 
56
  if __name__ == "__main__":
57
  main()