Update modules/visuals.py
Browse files- modules/visuals.py +9 -0
modules/visuals.py
CHANGED
|
@@ -11,6 +11,15 @@ def display_dashboard(df: pd.DataFrame):
|
|
| 11 |
col2.metric("🚨 Red Alerts", df[df["Alert_Level__c"] == "Red"].shape[0])
|
| 12 |
col3.metric("⚡ Power Issues", df[df["Power_Sufficient__c"] == "No"].shape[0])
|
| 13 |
col4.metric("📷 Offline Cameras", df[df["Camera_Status__c"] == "Offline"].shape[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
st.subheader("🚨 Alert Level Breakdown")
|
|
|
|
| 11 |
col2.metric("🚨 Red Alerts", df[df["Alert_Level__c"] == "Red"].shape[0])
|
| 12 |
col3.metric("⚡ Power Issues", df[df["Power_Sufficient__c"] == "No"].shape[0])
|
| 13 |
col4.metric("📷 Offline Cameras", df[df["Camera_Status__c"] == "Offline"].shape[0])
|
| 14 |
+
|
| 15 |
+
def display_charts(df: pd.DataFrame):
|
| 16 |
+
st.subheader("⚙ Energy Generation")
|
| 17 |
+
fig_energy = px.bar(
|
| 18 |
+
df,
|
| 19 |
+
x="Name",
|
| 20 |
+
y=["Solar_Generation__c", "Wind_Generation__c"]
|
| 21 |
+
title="Solar vs Wind Generation"
|
| 22 |
+
)
|
| 23 |
|
| 24 |
|
| 25 |
st.subheader("🚨 Alert Level Breakdown")
|