Tigernawin commited on
Commit
d09358d
·
verified ·
1 Parent(s): e2e8281

Create modules/visuals.py

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