Sanjayraju30 commited on
Commit
efd017d
Β·
verified Β·
1 Parent(s): 85a696e

Create modules/visuals.py

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