Prasanna1622 commited on
Commit
c6d872b
·
verified ·
1 Parent(s): fc30135

Update modules/visuals.py

Browse files
Files changed (1) hide show
  1. modules/visuals.py +13 -1
modules/visuals.py CHANGED
@@ -1 +1,13 @@
1
- import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ def display_dashboard(df):
3
+ st.subheader("📊 System Summary")
4
+ col1, col2, col3 = st.columns(3)
5
+ col1.metric("Total Poles", df.shape[0])
6
+ col2.metric("🚨 Red Alerts", df[df['Alert Level'] == "Red"].shape[0])
7
+ col3.metric("⚡ Power Issues", df[df['Power Sufficient'] == "No"].shape[0])
8
+
9
+ def display_charts(df):
10
+ st.subheader("⚙️ Energy Generation Trends")
11
+ st.bar_chart(df.set_index("Pole ID")[["Solar Gen (kWh)", "Wind Gen (kWh)"]])
12
+ st.subheader("📉 Tilt vs Vibration")
13
+ st.scatter_chart(df.rename(columns={"Tilt (°)": "Tilt", "Vibration (g)": "Vibration"}).set_index("Pole ID")[["Tilt", "Vibration"]])