File size: 582 Bytes
ffac544
0d8780a
ffac544
0d8780a
 
 
 
 
8c737b3
0d8780a
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
import plotly.express as px

def display_dashboard(df):
    st.subheader("📊 System Summary")
    col1, col2 = st.columns(2)
    col1.metric("Total Poles", df.shape[0])
    col2.metric("🚨 Red Alerts", df[df['Alert Level'] == "Red"].shape[0])

def display_heatmap(df):
    st.subheader("🌡️ Fault Heatmap")
    # Grouping the data by area (simplified) and plotting the heatmap
    heatmap_data = df.groupby(['Pole ID', 'Alert Level']).size().unstack(fill_value=0)
    fig = px.imshow(heatmap_data, title="Fault Distribution")
    st.plotly_chart(fig)