DSatishchandra's picture
Update modules/visuals.py
0d8780a verified
raw
history blame contribute delete
582 Bytes
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)