SHELLAPANDIANGANHUNGING commited on
Commit
939e83e
·
verified ·
1 Parent(s): c97fd8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -320,6 +320,10 @@ df_full_report = df.copy()
320
  # =================== FILTERS (Sidebar) =====================
321
  filter_dict = {}
322
 
 
 
 
 
323
  with st.sidebar.form("filters_form"):
324
  # ---------------- Date Range ----------------
325
  if 'date' in df.columns and not df['date'].isna().all():
@@ -449,7 +453,7 @@ def hour_range_label_full(hour):
449
  return 'Unknown'
450
 
451
  # ===================== MAIN VISUALIZATION =====================
452
- st.subheader("Objective 1: Visualizing Operator Fatigue Patterns by Shift Hours")
453
  if 'start' in df.columns and not df.empty:
454
  try:
455
  # --- Data Preparation ---
@@ -657,7 +661,7 @@ else:
657
  #Objective
658
  #
659
  #Objective 1
660
- st.subheader("OBJECTIVE 2: Identify Fatigue Patterns at the Start, Middle, and End of Shifts by Hourly Categories by Date")
661
  if 'start' in df.columns and not df.empty:
662
  try:
663
  df_local = df.copy()
@@ -753,7 +757,7 @@ else:
753
 
754
  # =================== OBJECTIVE 3: Daily Roster Insight per Week (Scatter Plot) =====================
755
  # =================== OBJECTIVE 3: Daily Roster Insight per Week (Scatter Plot) =====================
756
- st.subheader("OBJECTIVE 3: Daily Roster Insight per Week")
757
  if not df.empty and col_operator in df.columns and col_shift and col_shift in df.columns:
758
  try:
759
  df['date'] = pd.to_datetime(df['date'])
@@ -1058,7 +1062,7 @@ except Exception as e:
1058
  # ... (kode sebelumnya tetap sama) ...
1059
 
1060
  # =================== OBJECTIVE 5: Operator Fatigue Risk Gradient Dashboard =====================
1061
- st.subheader("OBJECTIVE 5: Operator Fatigue Risk Gradient Dashboard (Weekly Average Events & Trend Analysis)")
1062
  # Custom CSS untuk tampilan ala market saham yang sangat fancy dan profesional
1063
  st.markdown("""
1064
  <style>
@@ -1523,7 +1527,7 @@ else:
1523
  # AI RECOMMENDATIONS - JUGA BERSEBELAHAN
1524
  # ===============================================================
1525
  st.markdown("---")
1526
- st.subheader("AI Recommendations")
1527
 
1528
  # Gunakan kolom untuk menampilkan rekomendasi secara bersebelahan
1529
  col_rec1, col_rec2 = st.columns(2)
@@ -1597,7 +1601,7 @@ else:
1597
  # ... (kode setelah Objective 5 tetap sama) ...
1598
 
1599
  # =================== OBJECTIVE 6: Automated Insights & AI Recommendations =====================
1600
- st.subheader("OBJECTIVE 6: Automated Insight Summary & AI Recommendations")
1601
 
1602
  # Membagi tampilan menjadi dua kolom
1603
  col_insights, col_recs = st.columns(2)
@@ -1670,7 +1674,7 @@ with col_insights:
1670
 
1671
  # Kolom kanan: AI Recommendations
1672
  with col_recs:
1673
- st.subheader("AI Recommendations")
1674
  ai_recs = []
1675
  insights_found = [] # Untuk menyimpan insight yang ditemukan
1676
 
@@ -1783,9 +1787,4 @@ with col_recs:
1783
 
1784
  # ================= FOOTER ===========================
1785
  st.markdown("---")
1786
- st.markdown('<div class="footer">MineVision AI - Transforming Mining Safety with Intelligent Analytics | Contact: info@bukittechnology.com</div>', unsafe_allow_html=True)
1787
-
1788
-
1789
- # ================= FOOTER ===========================
1790
- st.markdown("---")
1791
- st.markdown('<div class="footer">MineVision AI - Transforming Mining Safety with Intelligent Analytics | Contact: info@bukittechnology.com</div>', unsafe_allow_html=True)
 
320
  # =================== FILTERS (Sidebar) =====================
321
  filter_dict = {}
322
 
323
+ # ✅ Tambahkan judul di sidebar
324
+ st.sidebar.markdown("### Filter IF Need Specific Conditions")
325
+ st.sidebar.markdown("---") # Opsional: garis pemisah untuk estetika
326
+
327
  with st.sidebar.form("filters_form"):
328
  # ---------------- Date Range ----------------
329
  if 'date' in df.columns and not df['date'].isna().all():
 
453
  return 'Unknown'
454
 
455
  # ===================== MAIN VISUALIZATION =====================
456
+ st.subheader("OBJECTIVE 1: Want to see fatigue patterns across different shifts?")
457
  if 'start' in df.columns and not df.empty:
458
  try:
459
  # --- Data Preparation ---
 
661
  #Objective
662
  #
663
  #Objective 1
664
+ st.subheader("OBJECTIVE 2: How does operator energy fluctuate from start to finish of each shift?")
665
  if 'start' in df.columns and not df.empty:
666
  try:
667
  df_local = df.copy()
 
757
 
758
  # =================== OBJECTIVE 3: Daily Roster Insight per Week (Scatter Plot) =====================
759
  # =================== OBJECTIVE 3: Daily Roster Insight per Week (Scatter Plot) =====================
760
+ st.subheader("OBJECTIVE 3: Looking for patterns in your team’s weekly roster?")
761
  if not df.empty and col_operator in df.columns and col_shift and col_shift in df.columns:
762
  try:
763
  df['date'] = pd.to_datetime(df['date'])
 
1062
  # ... (kode sebelumnya tetap sama) ...
1063
 
1064
  # =================== OBJECTIVE 5: Operator Fatigue Risk Gradient Dashboard =====================
1065
+ st.subheader("OBJECTIVE 5: See your team’s fatigue risk gradient at a glance!")
1066
  # Custom CSS untuk tampilan ala market saham yang sangat fancy dan profesional
1067
  st.markdown("""
1068
  <style>
 
1527
  # AI RECOMMENDATIONS - JUGA BERSEBELAHAN
1528
  # ===============================================================
1529
  st.markdown("---")
1530
+ st.subheader("Recommendations for Objective 5")
1531
 
1532
  # Gunakan kolom untuk menampilkan rekomendasi secara bersebelahan
1533
  col_rec1, col_rec2 = st.columns(2)
 
1601
  # ... (kode setelah Objective 5 tetap sama) ...
1602
 
1603
  # =================== OBJECTIVE 6: Automated Insights & AI Recommendations =====================
1604
+ st.subheader("OBJECTIVE 6: Instant Insights & Recommendations")
1605
 
1606
  # Membagi tampilan menjadi dua kolom
1607
  col_insights, col_recs = st.columns(2)
 
1674
 
1675
  # Kolom kanan: AI Recommendations
1676
  with col_recs:
1677
+ st.subheader("Recommendations")
1678
  ai_recs = []
1679
  insights_found = [] # Untuk menyimpan insight yang ditemukan
1680
 
 
1787
 
1788
  # ================= FOOTER ===========================
1789
  st.markdown("---")
1790
+ st.markdown('<div class="footer">FatigueAnalyzer - Transforming Mining Safety with Intelligent Analytics | Contact: info@bukittechnology.com</div>', unsafe_allow_html=True)