Sanjayraju30 commited on
Commit
b80f5d2
·
verified ·
1 Parent(s): 9156c8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -97,10 +97,9 @@ if selected_site in SITES:
97
  st.subheader("📈 Tilt vs. Vibration")
98
  st.scatter_chart(site_df[['Tilt Angle (°)', 'Vibration (g)']])
99
 
100
- # ---- Updated Map Section with Alert Level Color Coding ----
101
  st.subheader("📍 Pole Alert Levels (Green, Yellow, Red)")
102
 
103
- # Define color mapping
104
  def alert_level_to_color(alert_level):
105
  if alert_level == 'Red':
106
  return [255, 0, 0, 160] # Red
@@ -127,14 +126,27 @@ if selected_site in SITES:
127
  get_position='[Longitude, Latitude]',
128
  get_color='Color',
129
  get_radius=100,
 
130
  )
131
- ]
 
 
 
 
 
 
 
 
 
 
 
 
132
  ))
133
 
134
- st.markdown("<h3 style='text-align: center;'>Poles Color-coded by Alert Level</h3>", unsafe_allow_html=True)
135
  else:
136
  st.info("No poles data available for this site.")
137
-
138
  else:
139
  st.warning("Invalid site. Please enter one of: Hyderabad, Gadwal, Kurnool, Ballari")
140
 
 
 
97
  st.subheader("📈 Tilt vs. Vibration")
98
  st.scatter_chart(site_df[['Tilt Angle (°)', 'Vibration (g)']])
99
 
100
+ # ---- Map Section with Tooltip ----
101
  st.subheader("📍 Pole Alert Levels (Green, Yellow, Red)")
102
 
 
103
  def alert_level_to_color(alert_level):
104
  if alert_level == 'Red':
105
  return [255, 0, 0, 160] # Red
 
126
  get_position='[Longitude, Latitude]',
127
  get_color='Color',
128
  get_radius=100,
129
+ pickable=True
130
  )
131
+ ],
132
+ tooltip={
133
+ "html": "<b>Pole ID:</b> {Pole ID}<br/>"
134
+ "<b>Health Score:</b> {Health Score}<br/>"
135
+ "<b>Alert Level:</b> {Alert Level}<br/>"
136
+ "<b>Power Status:</b> {Power Status}<br/>"
137
+ "<b>Camera Status:</b> {Camera Status}<br/>"
138
+ "<b>Last Checked:</b> {Last Checked}",
139
+ "style": {
140
+ "backgroundColor": "black",
141
+ "color": "white"
142
+ }
143
+ }
144
  ))
145
 
146
+ st.markdown("<h3 style='text-align: center;'>Click on a pole to view details</h3>", unsafe_allow_html=True)
147
  else:
148
  st.info("No poles data available for this site.")
 
149
  else:
150
  st.warning("Invalid site. Please enter one of: Hyderabad, Gadwal, Kurnool, Ballari")
151
 
152
+