SHELLAPANDIANGANHUNGING commited on
Commit
f5200ba
·
verified ·
1 Parent(s): 9b6d50b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +105 -50
app.py CHANGED
@@ -1384,57 +1384,112 @@ else:
1384
  # LEGEND — UPDATED: Stable → One Time Event, Gray → Yellow
1385
  # ===============================================================
1386
  st.subheader("Hazard Gradient Legend")
1387
- st.markdown("""
1388
- <div class="legend-container">
1389
- <div class="legend-box">
1390
- <div class="legend-title">Worsening Trends (Positive Slope):</div>
1391
- <div class="legend-item">
1392
- <div class="legend-color" style="background-color: #d32f2f;"></div>
1393
- <span>Very High Worsening (≥1.5)</span>
1394
- </div>
1395
- <div class="legend-item">
1396
- <div class="legend-color" style="background-color: #e57373;"></div>
1397
- <span>High Worsening (1.0–1.5)</span>
1398
- </div>
1399
- <div class="legend-item">
1400
- <div class="legend-color" style="background-color: #ef9a9a;"></div>
1401
- <span>Moderate Worsening (0.5–1.0)</span>
1402
- </div>
1403
- <div class="legend-item">
1404
- <div class="legend-color" style="background-color: #ffcdd2;"></div>
1405
- <span>Slight Worsening (0–0.5)</span>
1406
- </div>
1407
- </div>
1408
- <div class="legend-box">
1409
- <div class="legend-title">Improving Trends (Negative Slope):</div>
1410
- <div class="legend-item">
1411
- <div class="legend-color" style="background-color: #388e3c;"></div>
1412
- <span>Excellent Improvement (≤−1.5)</span>
1413
- </div>
1414
- <div class="legend-item">
1415
- <div class="legend-color" style="background-color: #81c784;"></div>
1416
- <span>Great Improvement (−1.5 to −1.0)</span>
1417
- </div>
1418
- <div class="legend-item">
1419
- <div class="legend-color" style="background-color: #a5d6a7;"></div>
1420
- <span>Good Improvement (−1.0 to −0.5)</span>
1421
- </div>
1422
- <div class="legend-item">
1423
- <div class="legend-color" style="background-color: #c8e6c9;"></div>
1424
- <span>Slight Improvement (−0.5 to 0)</span>
1425
- </div>
1426
- </div>
1427
- <div class="legend-box">
1428
- <div class="legend-title">One-Time Events (Zero Slope):</div>
1429
- <div class="legend-item">
1430
- <div class="legend-color" style="background-color: #FFD700;"></div>
1431
- <span>One Time Event (0)</span>
1432
- </div>
1433
- <br>
1434
- <i>Note: Applies when an operator has data in only one week — slope is set to 0 by definition.</i>
1435
- </div>
1436
  </div>
1437
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1438
 
1439
  # ===============================================================
1440
  # PLOT FUNCTION — UPDATED: color for slope=0 is now #FFD700
 
1384
  # LEGEND — UPDATED: Stable → One Time Event, Gray → Yellow
1385
  # ===============================================================
1386
  st.subheader("Hazard Gradient Legend")
1387
+ st.markdown("""
1388
+ <style>
1389
+ .legend-container {
1390
+ display: flex;
1391
+ gap: 20px;
1392
+ flex-wrap: wrap;
1393
+ }
1394
+ .legend-box {
1395
+ background: #f9f9f9;
1396
+ padding: 12px;
1397
+ border-radius: 10px;
1398
+ border: 1px solid #ddd;
1399
+ width: 300px;
1400
+ }
1401
+ .legend-title {
1402
+ font-weight: 700;
1403
+ margin-bottom: 10px;
1404
+ font-size: 14px;
1405
+ }
1406
+ .legend-item {
1407
+ display: flex;
1408
+ align-items: center;
1409
+ margin-bottom: 6px;
1410
+ }
1411
+ .legend-color {
1412
+ width: 18px;
1413
+ height: 18px;
1414
+ border-radius: 4px;
1415
+ margin-right: 10px;
1416
+ }
1417
+ </style>
1418
+
1419
+ <div class="legend-container">
1420
+
1421
+ <!-- Worsening Trends -->
1422
+ <div class="legend-box">
1423
+ <div class="legend-title">Worsening Trends (Positive Slope):</div>
1424
+
1425
+ <div class="legend-item">
1426
+ <div class="legend-color" style="background-color: #d32f2f;"></div>
1427
+ <span>Very High Worsening (≥ 1.5)</span>
 
 
 
 
 
 
 
 
1428
  </div>
1429
+
1430
+ <div class="legend-item">
1431
+ <div class="legend-color" style="background-color: #e57373;"></div>
1432
+ <span>High Worsening (1.0 – 1.5)</span>
1433
+ </div>
1434
+
1435
+ <div class="legend-item">
1436
+ <div class="legend-color" style="background-color: #ef9a9a;"></div>
1437
+ <span>Moderate Worsening (0.5 – 1.0)</span>
1438
+ </div>
1439
+
1440
+ <div class="legend-item">
1441
+ <div class="legend-color" style="background-color: #ffcdd2;"></div>
1442
+ <span>Slight Worsening (0 – 0.5)</span>
1443
+ </div>
1444
+
1445
+ <br>
1446
+ <i>Note: Worsening trends indicate increasing fatigue frequency over weeks.</i>
1447
+ </div>
1448
+
1449
+ <!-- Improving Trends -->
1450
+ <div class="legend-box">
1451
+ <div class="legend-title">Improving Trends (Negative Slope):</div>
1452
+
1453
+ <div class="legend-item">
1454
+ <div class="legend-color" style="background-color: #388e3c;"></div>
1455
+ <span>Excellent Improvement (≤ -1.5)</span>
1456
+ </div>
1457
+
1458
+ <div class="legend-item">
1459
+ <div class="legend-color" style="background-color: #81c784;"></div>
1460
+ <span>Great Improvement (-1.5 to -1.0)</span>
1461
+ </div>
1462
+
1463
+ <div class="legend-item">
1464
+ <div class="legend-color" style="background-color: #a5d6a7;"></div>
1465
+ <span>Good Improvement (-1.0 to -0.5)</span>
1466
+ </div>
1467
+
1468
+ <div class="legend-item">
1469
+ <div class="legend-color" style="background-color: #c8e6c9;"></div>
1470
+ <span>Slight Improvement (-0.5 to 0)</span>
1471
+ </div>
1472
+
1473
+ <br>
1474
+ <i>Note: Improving trends indicate decreasing fatigue frequency over weeks.</i>
1475
+ </div>
1476
+
1477
+ <!-- One-Time Events -->
1478
+ <div class="legend-box">
1479
+ <div class="legend-title">One-Time Events (Zero Slope):</div>
1480
+
1481
+ <div class="legend-item">
1482
+ <div class="legend-color" style="background-color: #FFD700;"></div>
1483
+ <span>One Time Event (0)</span>
1484
+ </div>
1485
+
1486
+ <br>
1487
+ <i>Note: Applies when an operator has data in only one week (slope = 0).</i>
1488
+ </div>
1489
+
1490
+ </div>
1491
+ """, unsafe_allow_html=True)
1492
+
1493
 
1494
  # ===============================================================
1495
  # PLOT FUNCTION — UPDATED: color for slope=0 is now #FFD700