Spaces:
Sleeping
Sleeping
Create visuals.py
Browse files- modules/visuals.py +14 -0
modules/visuals.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
st.subheader("📉 Tilt vs Vibration")
|
14 |
+
st.scatter_chart(df.rename(columns={"Tilt (°)": "Tilt", "Vibration (g)": "Vibration"}).set_index("Pole ID")[["Tilt", "Vibration"]])
|