eaglelandsonce commited on
Commit
6f59340
1 Parent(s): 21e744a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -20
app.py CHANGED
@@ -1,26 +1,25 @@
 
1
  import streamlit as st
 
2
 
3
- # Mock data for demonstration
4
- data_points = {
5
- 'Residential Area': ['Energy Consumption', 'Water Usage'],
6
- 'Park': ['Air Quality', 'Noise Levels'],
7
- 'Main Street': ['Traffic Flow', 'Streetlight Activity'],
8
- 'Community Garden': ['Soil Moisture'],
9
- 'Local Business District': ['Retail Analytics', 'EV Charging Stations Usage']
10
- }
11
 
12
- # Simulate user location selection
13
- user_location = st.selectbox('Select Your Current Location:', list(data_points.keys()))
14
 
15
- # Display data being collected
16
- st.write(f"Data being collected at {user_location}:")
17
- for data_point in data_points[user_location]:
18
- st.write(f"- {data_point}")
19
 
20
- # User feedback on accuracy
21
- st.text_area("Feedback on Data Accuracy:", "Enter your feedback here...")
 
 
 
 
 
 
22
 
23
- # Suggestions for additional data collection
24
- st.text_area("Suggestions for Additional Data Collection:", "Enter your suggestions here...")
25
-
26
- st.button("Submit Feedback")
 
1
+ import json
2
  import streamlit as st
3
+ import matplotlib.pyplot as plt
4
 
5
+ # Page config
6
+ st.set_page_config(layout="wide")
 
 
 
 
 
 
7
 
8
+ # Load grid data
9
+ grid_data = json.load(open('grid.json'))
10
 
11
+ # Extract coordinates
12
+ buildings = [[b['coords'][0], b['coords'][1]] for b in grid_data['buildings']]
13
+ stores = [[s['coords'][0], s['coords'][1]] for s in grid_data['stores']]
 
14
 
15
+ # Plot map
16
+ fig, ax = plt.subplots()
17
+ ax.axis([0, 10, 0, 10])
18
+ ax.set_xticks([i for i in range(11)])
19
+ ax.set_yticks([i for i in range(11)])
20
+ ax.grid(color='grey', linestyle='-', linewidth=0.25)
21
+ ax.scatter(*zip(*buildings), color='red')
22
+ ax.scatter(*zip(*stores), color='green')
23
 
24
+ # Show figure in Streamlit
25
+ st.pyplot(fig)