import streamlit as st import plotly.express as px def display_dashboard(df): st.subheader("📊 System Summary") col1, col2, col3 = st.columns(3) col1.metric("Total Poles", df.shape[0]) col2.metric("🚨 Red Alerts", df[df["Alert Level"] == "Red"].shape[0]) col3.metric("⚡ Power Issues", df[df["Power Sufficient"] == "No"].shape[0]) def display_map_with_alerts(df): fig = px.scatter_mapbox( df, lat="Latitude", lon="Longitude", color="Alert Level", hover_name="Pole ID", zoom=6.2, mapbox_style="carto-positron", height=500 ) st.plotly_chart(fig, use_container_width=True) # Blinking red poles (HTML) red_df = df[df["Alert Level"] == "Red"] if not red_df.empty: st.markdown("### 🔴 Blinking Red Alerts (Hub Notification)") for _, row in red_df.iterrows(): st.markdown( f"