Spaces:
Sleeping
Sleeping
Update modules/visuals.py
Browse files- modules/visuals.py +0 -10
modules/visuals.py
CHANGED
|
@@ -52,14 +52,4 @@ def display_charts(df):
|
|
| 52 |
scatter_df = df.rename(columns={"Tilt (°)": "Tilt", "Vibration (g)": "Vibration"})
|
| 53 |
st.scatter_chart(scatter_df.set_index("Pole ID")[["Tilt", "Vibration"]])
|
| 54 |
|
| 55 |
-
def display_heatmap(df):
|
| 56 |
-
st.subheader("🌡️ Site-wise Pole Alert Heatmap")
|
| 57 |
-
|
| 58 |
-
alert_map = {"Green": 0, "Yellow": 1, "Red": 2}
|
| 59 |
-
df["Alert Code"] = df["Alert Level"].map(alert_map)
|
| 60 |
-
|
| 61 |
-
pivot = df.pivot(index="Site", columns="Pole ID", values="Alert Code")
|
| 62 |
|
| 63 |
-
fig, ax = plt.subplots(figsize=(14, 4))
|
| 64 |
-
sns.heatmap(pivot, annot=True, cmap="YlOrRd", linewidths=0.5, cbar_kws={'label': 'Alert Level (0=Green, 2=Red)'}, ax=ax)
|
| 65 |
-
st.pyplot(fig)
|
|
|
|
| 52 |
scatter_df = df.rename(columns={"Tilt (°)": "Tilt", "Vibration (g)": "Vibration"})
|
| 53 |
st.scatter_chart(scatter_df.set_index("Pole ID")[["Tilt", "Vibration"]])
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
|
|
|
|
|
|
|
|