Spaces:
Sleeping
Sleeping
Download modules/visuals.py from dschandra/Pole_Managements_02: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/spaces/dschandra/Pole_Managements_02/resolve/main/modules/visuals.py
- Command line
-
hf download hf://spaces/dschandra/Pole_Managements_02/modules/visuals.py
-
curl -L -o visuals.py https://huggingface.co/spaces/dschandra/Pole_Managements_02/resolve/main/modules/visuals.py
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) | |