Nawinkumar15 commited on
Commit
4ca91b2
·
verified ·
1 Parent(s): c0a6e47

Update modules/visuals.py

Browse files
Files changed (1) hide show
  1. modules/visuals.py +26 -2
modules/visuals.py CHANGED
@@ -1,6 +1,30 @@
1
  import streamlit as st
2
- import matplotlib.pyplot as plt
3
- import seaborn as sns
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  def display_dashboard(df):
6
  st.subheader("📊 System Summary")
 
1
  import streamlit as st
2
+ import pandas as pd
3
+ import streamlit as st
4
+ import pydeck as pdk
5
+
6
+ def display_map(df):
7
+ st.subheader("🗺️ Smart Pole Locations Map")
8
+
9
+ st.map(df[["Latitude", "Longitude"]])
10
+
11
+ # Optional: Fancy map with colored points
12
+ layer = pdk.Layer(
13
+ "ScatterplotLayer",
14
+ data=df,
15
+ get_position='[Longitude, Latitude]',
16
+ get_color='[200, 30, 0, 160]' if "Red" else '[0, 100, 200, 160]',
17
+ get_radius=50,
18
+ )
19
+
20
+ view_state = pdk.ViewState(
21
+ latitude=df["Latitude"].mean(),
22
+ longitude=df["Longitude"].mean(),
23
+ zoom=6,
24
+ pitch=0,
25
+ )
26
+
27
+ st.pydeck_chart(pdk.Deck(layers=[layer], initial_view_state=view_state))
28
 
29
  def display_dashboard(df):
30
  st.subheader("📊 System Summary")