Spaces:
Build error
Build error
Create modules/visuals.py
Browse files- 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 |
+
)
|