SHELLAPANDIANGANHUNGING commited on
Commit
b088bab
Β·
verified Β·
1 Parent(s): b684e8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -722,7 +722,7 @@ st.markdown(f"""
722
  # {insight_text.strip()}
723
  # </div>
724
  # </div>
725
- # """, unsafe_allow_html=True)
726
  st.markdown("""
727
  <h3 class="objective-title">OBJECTIVE 3: Alarm Frequency Analysis β€” Shift-Based Radial Charts</h3>
728
  <small>*Showing alarm types by shift: Normal (Green), Amber (Yellow), Red (Red)</small>
@@ -811,7 +811,7 @@ def create_radial_chart(pos_data, title, shift_hours, shift_type):
811
  # =============== ROW 1: Position 1 & 2 (Pagi & Sore) ===============
812
  with col1:
813
  # Position 1 Pagi (06:00–18:00)
814
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 1 (06:00–18:00)</h6>', unsafe_allow_html=True)
815
  pos1_data = alarm_data[alarm_data['Position'] == 1].copy()
816
  pos1_data = pos1_data[pos1_data['hour'].between(6, 17, inclusive='both')]
817
  fig1 = create_radial_chart(pos1_data, "Position 1 (06:00–18:00)", list(range(6, 18)), 'pagi')
@@ -822,7 +822,7 @@ with col1:
822
 
823
  with col2:
824
  # Position 1 Sore (18:00–06:00)
825
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 1 (18:00–06:00)</h6>', unsafe_allow_html=True)
826
  pos1_data = alarm_data[alarm_data['Position'] == 1].copy()
827
  pos1_data = pos1_data[~pos1_data['hour'].between(6, 17, inclusive='both')]
828
  fig2 = create_radial_chart(pos1_data, "Position 1 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
@@ -833,7 +833,7 @@ with col2:
833
 
834
  with col3:
835
  # Position 2 Pagi (06:00–18:00)
836
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 2 (06:00–18:00)</h6>', unsafe_allow_html=True)
837
  pos2_data = alarm_data[alarm_data['Position'] == 2].copy()
838
  pos2_data = pos2_data[pos2_data['hour'].between(6, 17, inclusive='both')]
839
  fig3 = create_radial_chart(pos2_data, "Position 2 (06:00–18:00)", list(range(6, 18)), 'pagi')
@@ -844,7 +844,7 @@ with col3:
844
 
845
  with col4:
846
  # Position 2 Sore (18:00–06:00)
847
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 2 (18:00–06:00)</h6>', unsafe_allow_html=True)
848
  pos2_data = alarm_data[alarm_data['Position'] == 2].copy()
849
  pos2_data = pos2_data[~pos2_data['hour'].between(6, 17, inclusive='both')]
850
  fig4 = create_radial_chart(pos2_data, "Position 2 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
@@ -856,7 +856,7 @@ with col4:
856
  # =============== ROW 2: Position 3 & 4 (Pagi & Sore) ===============
857
  with col5:
858
  # Position 3 Pagi (06:00–18:00)
859
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 3 (06:00–18:00)</h6>', unsafe_allow_html=True)
860
  pos3_data = alarm_data[alarm_data['Position'] == 3].copy()
861
  pos3_data = pos3_data[pos3_data['hour'].between(6, 17, inclusive='both')]
862
  fig5 = create_radial_chart(pos3_data, "Position 3 (06:00–18:00)", list(range(6, 18)), 'pagi')
@@ -867,7 +867,7 @@ with col5:
867
 
868
  with col6:
869
  # Position 3 Sore (18:00–06:00)
870
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 3 (18:00–06:00)</h6>', unsafe_allow_html=True)
871
  pos3_data = alarm_data[alarm_data['Position'] == 3].copy()
872
  pos3_data = pos3_data[~pos3_data['hour'].between(6, 17, inclusive='both')]
873
  fig6 = create_radial_chart(pos3_data, "Position 3 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
@@ -878,7 +878,7 @@ with col6:
878
 
879
  with col7:
880
  # Position 4 Pagi (06:00–18:00)
881
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 4 (06:00–18:00)</h6>', unsafe_allow_html=True)
882
  pos4_data = alarm_data[alarm_data['Position'] == 4].copy()
883
  pos4_data = pos4_data[pos4_data['hour'].between(6, 17, inclusive='both')]
884
  fig7 = create_radial_chart(pos4_data, "Position 4 (06:00–18:00)", list(range(6, 18)), 'pagi')
@@ -889,7 +889,7 @@ with col7:
889
 
890
  with col8:
891
  # Position 4 Sore (18:00–06:00)
892
- st.markdown('<h6 style="text-align:center; margin-top: 0; margin-bottom: 8px;">Position 4 (18:00–06:00)</h6>', unsafe_allow_html=True)
893
  pos4_data = alarm_data[alarm_data['Position'] == 4].copy()
894
  pos4_data = pos4_data[~pos4_data['hour'].between(6, 17, inclusive='both')]
895
  fig8 = create_radial_chart(pos4_data, "Position 4 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
@@ -942,7 +942,6 @@ st.markdown(f"""
942
  </div>
943
  </div>
944
  """, unsafe_allow_html=True)
945
-
946
  # ================= OBJECTIVE 3 =================
947
  st.markdown('<h3 class="objective-title">OBJECTIVE 4: Correlation β€” How Does Heat Influence Pressure and Which Tyres Trigger Red Alarms?</h3>', unsafe_allow_html=True)
948
 
 
722
  # {insight_text.strip()}
723
  # </div>
724
  # </div>
725
+ # "
726
  st.markdown("""
727
  <h3 class="objective-title">OBJECTIVE 3: Alarm Frequency Analysis β€” Shift-Based Radial Charts</h3>
728
  <small>*Showing alarm types by shift: Normal (Green), Amber (Yellow), Red (Red)</small>
 
811
  # =============== ROW 1: Position 1 & 2 (Pagi & Sore) ===============
812
  with col1:
813
  # Position 1 Pagi (06:00–18:00)
814
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 1 (06:00–18:00)</div>', unsafe_allow_html=True)
815
  pos1_data = alarm_data[alarm_data['Position'] == 1].copy()
816
  pos1_data = pos1_data[pos1_data['hour'].between(6, 17, inclusive='both')]
817
  fig1 = create_radial_chart(pos1_data, "Position 1 (06:00–18:00)", list(range(6, 18)), 'pagi')
 
822
 
823
  with col2:
824
  # Position 1 Sore (18:00–06:00)
825
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 1 (18:00–06:00)</div>', unsafe_allow_html=True)
826
  pos1_data = alarm_data[alarm_data['Position'] == 1].copy()
827
  pos1_data = pos1_data[~pos1_data['hour'].between(6, 17, inclusive='both')]
828
  fig2 = create_radial_chart(pos1_data, "Position 1 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
 
833
 
834
  with col3:
835
  # Position 2 Pagi (06:00–18:00)
836
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 2 (06:00–18:00)</div>', unsafe_allow_html=True)
837
  pos2_data = alarm_data[alarm_data['Position'] == 2].copy()
838
  pos2_data = pos2_data[pos2_data['hour'].between(6, 17, inclusive='both')]
839
  fig3 = create_radial_chart(pos2_data, "Position 2 (06:00–18:00)", list(range(6, 18)), 'pagi')
 
844
 
845
  with col4:
846
  # Position 2 Sore (18:00–06:00)
847
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 2 (18:00–06:00)</div>', unsafe_allow_html=True)
848
  pos2_data = alarm_data[alarm_data['Position'] == 2].copy()
849
  pos2_data = pos2_data[~pos2_data['hour'].between(6, 17, inclusive='both')]
850
  fig4 = create_radial_chart(pos2_data, "Position 2 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
 
856
  # =============== ROW 2: Position 3 & 4 (Pagi & Sore) ===============
857
  with col5:
858
  # Position 3 Pagi (06:00–18:00)
859
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 3 (06:00–18:00)</div>', unsafe_allow_html=True)
860
  pos3_data = alarm_data[alarm_data['Position'] == 3].copy()
861
  pos3_data = pos3_data[pos3_data['hour'].between(6, 17, inclusive='both')]
862
  fig5 = create_radial_chart(pos3_data, "Position 3 (06:00–18:00)", list(range(6, 18)), 'pagi')
 
867
 
868
  with col6:
869
  # Position 3 Sore (18:00–06:00)
870
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 3 (18:00–06:00)</div>', unsafe_allow_html=True)
871
  pos3_data = alarm_data[alarm_data['Position'] == 3].copy()
872
  pos3_data = pos3_data[~pos3_data['hour'].between(6, 17, inclusive='both')]
873
  fig6 = create_radial_chart(pos3_data, "Position 3 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
 
878
 
879
  with col7:
880
  # Position 4 Pagi (06:00–18:00)
881
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 4 (06:00–18:00)</div>', unsafe_allow_html=True)
882
  pos4_data = alarm_data[alarm_data['Position'] == 4].copy()
883
  pos4_data = pos4_data[pos4_data['hour'].between(6, 17, inclusive='both')]
884
  fig7 = create_radial_chart(pos4_data, "Position 4 (06:00–18:00)", list(range(6, 18)), 'pagi')
 
889
 
890
  with col8:
891
  # Position 4 Sore (18:00–06:00)
892
+ st.markdown('<div style="text-align:center; font-weight:bold; margin-bottom: 8px;">Position 4 (18:00–06:00)</div>', unsafe_allow_html=True)
893
  pos4_data = alarm_data[alarm_data['Position'] == 4].copy()
894
  pos4_data = pos4_data[~pos4_data['hour'].between(6, 17, inclusive='both')]
895
  fig8 = create_radial_chart(pos4_data, "Position 4 (18:00–06:00)", list(range(18, 24)) + list(range(0, 6)), 'sore')
 
942
  </div>
943
  </div>
944
  """, unsafe_allow_html=True)
 
945
  # ================= OBJECTIVE 3 =================
946
  st.markdown('<h3 class="objective-title">OBJECTIVE 4: Correlation β€” How Does Heat Influence Pressure and Which Tyres Trigger Red Alarms?</h3>', unsafe_allow_html=True)
947