File size: 868 Bytes
23bf7c3
 
 
 
 
adc2118
23bf7c3
 
 
 
 
adc2118
 
 
 
23bf7c3
 
 
 
 
 
adc2118
23bf7c3
 
 
 
 
 
 
 
adc2118
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pandas as pd

def display_dashboard(df: pd.DataFrame):
    st.subheader("πŸ“Š System Summary")
    col1, col2, col3, col4 = st.columns(4)
    
    col1.metric("Total Poles", df.shape[0])
    col2.metric("🚨 Red Alerts", df[df["Alert_Level__c"] == "Red"].shape[0])
    col3.metric("⚑ Power Issues", df[df["Power_Sufficient__c"] == "No"].shape[0])
    col4.metric("πŸ“· Offline Cameras", df[df["Camera_Status__c"] == "Offline"].shape[0])

import streamlit as st
import plotly.express as px


def display_charts(df: pd.DataFrame):
    fig_energy = px.bar(
        df,
        x="Name",
        y=["Solar_Generation__c", "Wind_Generation__c"],
    )
    

    st.subheader("🚨 Alert Level Breakdown")
    fig_alerts = px.histogram(
        df,
        x="Alert_Level__c",
        title="Number of Poles by Alert Level"
    )
    st.plotly_chart(fig_alerts)