Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1390,64 +1390,72 @@ else:
|
|
| 1390 |
# LEGEND — UPDATED: Stable → One Time Event, Gray → Yellow
|
| 1391 |
# ===============================================================
|
| 1392 |
st.subheader("Hazard Gradient Legend")
|
| 1393 |
-
|
| 1394 |
-
|
| 1395 |
-
|
| 1396 |
-
|
| 1397 |
-
|
| 1398 |
-
|
| 1399 |
-
|
| 1400 |
-
|
| 1401 |
-
|
| 1402 |
-
<div class="legend-color" style="background-color: #e57373;"></div>
|
| 1403 |
-
<span>High Worsening (1.0–1.5)</span>
|
| 1404 |
-
</div>
|
| 1405 |
-
<div class="legend-item">
|
| 1406 |
-
<div class="legend-color" style="background-color: #ef9a9a;"></div>
|
| 1407 |
-
<span>Moderate Worsening (0.5–1.0)</span>
|
| 1408 |
-
</div>
|
| 1409 |
-
<div class="legend-item">
|
| 1410 |
-
<div class="legend-color" style="background-color: #ffcdd2;"></div>
|
| 1411 |
-
<span>Slight Worsening (0–0.5)</span>
|
| 1412 |
-
</div>
|
| 1413 |
-
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1414 |
-
Note: Positive slope indicates increasing fatigue event frequency over weeks.
|
| 1415 |
-
</i>
|
| 1416 |
-
</div>
|
| 1417 |
-
<div class="legend-box">
|
| 1418 |
-
<div class="legend-title">Improving Trends (Negative Slope):</div>
|
| 1419 |
-
<div class="legend-item">
|
| 1420 |
-
<div class="legend-color" style="background-color: #388e3c;"></div>
|
| 1421 |
-
<span>Excellent Improvement (≤−1.5)</span>
|
| 1422 |
-
</div>
|
| 1423 |
-
<div class="legend-item">
|
| 1424 |
-
<div class="legend-color" style="background-color: #81c784;"></div>
|
| 1425 |
-
<span>Great Improvement (−1.5 to −1.0)</span>
|
| 1426 |
-
</div>
|
| 1427 |
-
<div class="legend-item">
|
| 1428 |
-
<div class="legend-color" style="background-color: #a5d6a7;"></div>
|
| 1429 |
-
<span>Good Improvement (−1.0 to −0.5)</span>
|
| 1430 |
-
</div>
|
| 1431 |
-
<div class="legend-item">
|
| 1432 |
-
<div class="legend-color" style="background-color: #c8e6c9;"></div>
|
| 1433 |
-
<span>Slight Improvement (−0.5 to 0)</span>
|
| 1434 |
-
</div>
|
| 1435 |
-
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1436 |
-
Note: Negative slope reflects a consistent decline in fatigue events.
|
| 1437 |
-
</i>
|
| 1438 |
-
</div>
|
| 1439 |
-
</div>
|
| 1440 |
-
<div class="legend-box">
|
| 1441 |
-
<div class="legend-title">One-Time Events (Zero Slope):</div>
|
| 1442 |
-
<div class="legend-item">
|
| 1443 |
-
<div class="legend-color" style="background-color: #FFD700;"></div>
|
| 1444 |
-
<span>One Time Event (0)</span>
|
| 1445 |
-
</div>
|
| 1446 |
-
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1447 |
-
Note: Slope = 0 by definition when data exists for only one week.
|
| 1448 |
-
</i>
|
| 1449 |
</div>
|
| 1450 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1451 |
|
| 1452 |
# ===============================================================
|
| 1453 |
# PLOT FUNCTION — UPDATED: color for slope=0 is now #FFD700
|
|
|
|
| 1390 |
# LEGEND — UPDATED: Stable → One Time Event, Gray → Yellow
|
| 1391 |
# ===============================================================
|
| 1392 |
st.subheader("Hazard Gradient Legend")
|
| 1393 |
+
st.markdown("""
|
| 1394 |
+
<div style="display: flex; gap: 20px;">
|
| 1395 |
+
|
| 1396 |
+
<!-- Kolom 1: Worsening Trends -->
|
| 1397 |
+
<div class="legend-box" style="flex: 1;">
|
| 1398 |
+
<div class="legend-title"><b>Worsening Trends (Positive Slope):</b></div>
|
| 1399 |
+
<div class="legend-item">
|
| 1400 |
+
<div class="legend-color" style="background-color: #d32f2f;"></div>
|
| 1401 |
+
<span>Very High Worsening (≥1.5)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1402 |
</div>
|
| 1403 |
+
<div class="legend-item">
|
| 1404 |
+
<div class="legend-color" style="background-color: #e57373;"></div>
|
| 1405 |
+
<span>High Worsening (1.0–1.5)</span>
|
| 1406 |
+
</div>
|
| 1407 |
+
<div class="legend-item">
|
| 1408 |
+
<div class="legend-color" style="background-color: #ef9a9a;"></div>
|
| 1409 |
+
<span>Moderate Worsening (0.5–1.0)</span>
|
| 1410 |
+
</div>
|
| 1411 |
+
<div class="legend-item">
|
| 1412 |
+
<div class="legend-color" style="background-color: #ffcdd2;"></div>
|
| 1413 |
+
<span>Slight Worsening (0–0.5)</span>
|
| 1414 |
+
</div>
|
| 1415 |
+
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1416 |
+
Note: Positive slope indicates increasing fatigue event frequency over weeks.
|
| 1417 |
+
</i>
|
| 1418 |
+
</div>
|
| 1419 |
+
|
| 1420 |
+
<!-- Kolom 2: Improving Trends -->
|
| 1421 |
+
<div class="legend-box" style="flex: 1;">
|
| 1422 |
+
<div class="legend-title"><b>Improving Trends (Negative Slope):</b></div>
|
| 1423 |
+
<div class="legend-item">
|
| 1424 |
+
<div class="legend-color" style="background-color: #388e3c;"></div>
|
| 1425 |
+
<span>Excellent Improvement (≤−1.5)</span>
|
| 1426 |
+
</div>
|
| 1427 |
+
<div class="legend-item">
|
| 1428 |
+
<div class="legend-color" style="background-color: #81c784;"></div>
|
| 1429 |
+
<span>Great Improvement (−1.5 to −1.0)</span>
|
| 1430 |
+
</div>
|
| 1431 |
+
<div class="legend-item">
|
| 1432 |
+
<div class="legend-color" style="background-color: #a5d6a7;"></div>
|
| 1433 |
+
<span>Good Improvement (−1.0 to −0.5)</span>
|
| 1434 |
+
</div>
|
| 1435 |
+
<div class="legend-item">
|
| 1436 |
+
<div class="legend-color" style="background-color: #c8e6c9;"></div>
|
| 1437 |
+
<span>Slight Improvement (−0.5 to 0)</span>
|
| 1438 |
+
</div>
|
| 1439 |
+
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1440 |
+
Note: Negative slope reflects a consistent decline in fatigue events.
|
| 1441 |
+
</i>
|
| 1442 |
+
</div>
|
| 1443 |
+
|
| 1444 |
+
<!-- Kolom 3: One-Time Events -->
|
| 1445 |
+
<div class="legend-box" style="flex: 1;">
|
| 1446 |
+
<div class="legend-title"><b>One-Time Events (Zero Slope):</b></div>
|
| 1447 |
+
<div class="legend-item">
|
| 1448 |
+
<div class="legend-color" style="background-color: #FFD700;"></div>
|
| 1449 |
+
<span>One Time Event (0)</span>
|
| 1450 |
+
</div>
|
| 1451 |
+
<i style="display: block; margin-top: 12px; font-size: 12px; color: #666; font-style: italic;">
|
| 1452 |
+
Note: Slope = 0 by definition when data exists for only one week.
|
| 1453 |
+
</i>
|
| 1454 |
+
</div>
|
| 1455 |
+
|
| 1456 |
+
</div>
|
| 1457 |
+
""", unsafe_allow_html=True)
|
| 1458 |
+
|
| 1459 |
|
| 1460 |
# ===============================================================
|
| 1461 |
# PLOT FUNCTION — UPDATED: color for slope=0 is now #FFD700
|