SHELLAPANDIANGANHUNGING commited on
Commit
0fed22a
·
verified ·
1 Parent(s): c7426c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -497,10 +497,13 @@ with col_a:
497
  if alarm_hour_pos.empty:
498
  st.warning("No alarm data to display.")
499
  else:
 
 
 
500
  # Hitung alarm per jam & posisi
501
  hourly_pos_counts = alarm_hour_pos.groupby(['hour', 'Position']).size().unstack(fill_value=0)
502
- positions = sorted([p for p in [1, 2, 3, 4] if p in hourly_pos_counts.columns]) # enforce 1-4 order
503
- color_map = {1: '#d50000', 2: '#ff6d00', 3: '', 4: ''}
504
 
505
  fig_polar = go.Figure()
506
  max_r = max(hourly_pos_counts.sum(axis=1)) * 1.05 if not hourly_pos_counts.empty else 10
@@ -537,7 +540,7 @@ with col_a:
537
  x=1.02,
538
  bgcolor="rgba(255,255,255,0.7)",
539
  borderwidth=0.5,
540
- itemclick=False, # prevent accidental legend toggle
541
  itemdoubleclick=False
542
  ),
543
  margin=dict(t=40, b=20, l=20, r=120),
 
497
  if alarm_hour_pos.empty:
498
  st.warning("No alarm data to display.")
499
  else:
500
+ # Filter hanya Position 1 & 2
501
+ alarm_hour_pos = alarm_hour_pos[alarm_hour_pos['Position'].isin([1, 2])]
502
+
503
  # Hitung alarm per jam & posisi
504
  hourly_pos_counts = alarm_hour_pos.groupby(['hour', 'Position']).size().unstack(fill_value=0)
505
+ positions = sorted([p for p in [1, 2] if p in hourly_pos_counts.columns]) # hanya 1 & 2
506
+ color_map = {1: '#d50000', 2: '#ff6d00'}
507
 
508
  fig_polar = go.Figure()
509
  max_r = max(hourly_pos_counts.sum(axis=1)) * 1.05 if not hourly_pos_counts.empty else 10
 
540
  x=1.02,
541
  bgcolor="rgba(255,255,255,0.7)",
542
  borderwidth=0.5,
543
+ itemclick=False,
544
  itemdoubleclick=False
545
  ),
546
  margin=dict(t=40, b=20, l=20, r=120),