eaglelandsonce commited on
Commit
7556c05
·
verified ·
1 Parent(s): d680ff8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -120,6 +120,14 @@ def main():
120
  fig = draw_grid(data)
121
  st.pyplot(fig)
122
 
 
 
 
 
 
 
 
 
123
 
124
  with col3:
125
  st.header("Check Your HIN Number")
 
120
  fig = draw_grid(data)
121
  st.pyplot(fig)
122
 
123
+ # Interactivity: Selecting a building to display sensor data
124
+ building_options = [f"{bld['type']} at ({bld['coords'][0]}, {bld['coords'][1]})" for bld in data['buildings']]
125
+ selected_building = st.selectbox("Select a building to view sensors:", options=building_options)
126
+ selected_index = building_options.index(selected_building)
127
+ sensors = data['buildings'][selected_index]['sensors']
128
+ st.write(f"Sensors in selected building: {', '.join(sensors)}")
129
+
130
+
131
 
132
  with col3:
133
  st.header("Check Your HIN Number")