Spaces:
Build error
Build error
Download modules/visuals.py from Tigernawin/Pole_data_: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/Tigernawin/Pole_data_/resolve/main/modules/visuals.py
- Command line
-
hf download hf://spaces/Tigernawin/Pole_data_/modules/visuals.py
-
curl -L -o visuals.py https://huggingface.co/spaces/Tigernawin/Pole_data_/resolve/main/modules/visuals.py
666 Bytes
| import streamlit as st | |
| 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_charts(df): | |
| st.subheader("⚙️ Energy Generation Trends") | |
| st.bar_chart(df.set_index("Pole ID")[["Solar Gen (kWh)", "Wind Gen (kWh)"]]) | |
| st.subheader("📉 Tilt vs Vibration") | |
| st.scatter_chart(df.rename(columns={"Tilt (°)": "Tilt", "Vibration (g)": "Vibration"}).set_index("Pole ID")[["Tilt", "Vibration"]]) |