Nawinkumar15 commited on
Commit
3d04f0c
·
verified ·
1 Parent(s): 7558a0a

Update modules/visuals.py

Browse files
Files changed (1) hide show
  1. modules/visuals.py +5 -3
modules/visuals.py CHANGED
@@ -7,15 +7,16 @@ import pydeck as pdk
7
  def display_map(df):
8
  st.subheader("🗺️ Smart Pole Locations Map")
9
 
 
10
  st.map(df[["Latitude", "Longitude"]])
11
 
12
- # Optional: Fancy map with colored points
13
  layer = pdk.Layer(
14
  "ScatterplotLayer",
15
  data=df,
16
  get_position='[Longitude, Latitude]',
17
- get_color='[200, 30, 0, 160]' if "Red" else '[0, 100, 200, 160]',
18
- get_radius=50,
19
  )
20
 
21
  view_state = pdk.ViewState(
@@ -27,6 +28,7 @@ def display_map(df):
27
 
28
  st.pydeck_chart(pdk.Deck(layers=[layer], initial_view_state=view_state))
29
 
 
30
  def display_dashboard(df):
31
  st.subheader("📊 System Summary")
32
  col1, col2, col3 = st.columns(3)
 
7
  def display_map(df):
8
  st.subheader("🗺️ Smart Pole Locations Map")
9
 
10
+ # Basic map using st.map()
11
  st.map(df[["Latitude", "Longitude"]])
12
 
13
+ # Optional: More detailed map using pydeck
14
  layer = pdk.Layer(
15
  "ScatterplotLayer",
16
  data=df,
17
  get_position='[Longitude, Latitude]',
18
+ get_color='[255, 0, 0, 160]', # Red circles
19
+ get_radius=100,
20
  )
21
 
22
  view_state = pdk.ViewState(
 
28
 
29
  st.pydeck_chart(pdk.Deck(layers=[layer], initial_view_state=view_state))
30
 
31
+
32
  def display_dashboard(df):
33
  st.subheader("📊 System Summary")
34
  col1, col2, col3 = st.columns(3)