Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -454,6 +454,7 @@ def build_overview():
|
|
| 454 |
scores = [r.health_score for r in sorted_recs]
|
| 455 |
|
| 456 |
trend = go.Figure()
|
|
|
|
| 457 |
trend.add_trace(
|
| 458 |
go.Scatter(
|
| 459 |
x=times,
|
|
@@ -461,16 +462,23 @@ def build_overview():
|
|
| 461 |
mode="lines",
|
| 462 |
name="Health Score",
|
| 463 |
line=dict(color="#06d6a0", width=2, shape="spline"),
|
| 464 |
-
fill="
|
| 465 |
-
fillcolor="rgba(6,214,160,0.
|
| 466 |
)
|
| 467 |
)
|
| 468 |
-
|
| 469 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 470 |
_dark(
|
| 471 |
trend,
|
| 472 |
title="Health Score Trend",
|
| 473 |
-
yaxis=dict(range=[
|
| 474 |
height=350,
|
| 475 |
)
|
| 476 |
|
|
|
|
| 454 |
scores = [r.health_score for r in sorted_recs]
|
| 455 |
|
| 456 |
trend = go.Figure()
|
| 457 |
+
min_score = max(0, min(scores) - 10)
|
| 458 |
trend.add_trace(
|
| 459 |
go.Scatter(
|
| 460 |
x=times,
|
|
|
|
| 462 |
mode="lines",
|
| 463 |
name="Health Score",
|
| 464 |
line=dict(color="#06d6a0", width=2, shape="spline"),
|
| 465 |
+
fill="tonexty" if min_score > 30 else "none",
|
| 466 |
+
fillcolor="rgba(6,214,160,0.06)",
|
| 467 |
)
|
| 468 |
)
|
| 469 |
+
# Only show threshold lines if they're within visible range
|
| 470 |
+
if min_score <= 75:
|
| 471 |
+
trend.add_hline(y=75, line_dash="dot", line_color="#f59e0b", line_width=1,
|
| 472 |
+
annotation_text="Warning: 75", annotation_font_size=9,
|
| 473 |
+
annotation_font_color="#f59e0b")
|
| 474 |
+
if min_score <= 40:
|
| 475 |
+
trend.add_hline(y=40, line_dash="dot", line_color="#ef4444", line_width=1,
|
| 476 |
+
annotation_text="Critical: 40", annotation_font_size=9,
|
| 477 |
+
annotation_font_color="#ef4444")
|
| 478 |
_dark(
|
| 479 |
trend,
|
| 480 |
title="Health Score Trend",
|
| 481 |
+
yaxis=dict(range=[min_score, 105], **_DARK_LAYOUT["yaxis"]),
|
| 482 |
height=350,
|
| 483 |
)
|
| 484 |
|