Spaces:
Sleeping
Sleeping
| 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) | |