feat: enhance recovery dashboard with vital signs analytics and visualization improvements
- Updated the `build_vital_signs_matrix_chart_payload` function to accept optional keys for omitting specific snapshot data, improving flexibility in data presentation. - Enhanced the `build_recovery_dashboard_kpi_tiles` function to conditionally merge heart and autonomic tiles based on new parameters, refining the dashboard's insights. - Integrated new analytics features in the `RecoveryDashboardOverview` component, including consolidated paragraphs for better narrative context and visual representation of trends. - Improved the handling of vital signs data in the frontend, ensuring clearer messaging and enhanced user experience when displaying vital metrics.
This commit is contained in:
1 parent
e7bcdc3228
commit
8cb5ad992f
7 files changed
+299
-166
No files matched your search
@@ -22,7 +22,7 @@ Version: 1.0
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, List, Optional, Set
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from auth import require_auth
|
||||
@@ -1432,11 +1432,18 @@ def get_sleep_debt_chart(
|
||||
@router.get("/vital-signs-matrix")
|
||||
def get_vital_signs_matrix_chart(
|
||||
days: int = Query(default=7, ge=7, le=365),
|
||||
session: dict = Depends(require_auth)
|
||||
omit_snapshot_keys: Optional[str] = Query(
|
||||
default=None,
|
||||
description="Optional: Komma-getrennte Keys ausblenden (z. B. resting_hr,hrv) wenn Einordnung woanders steht.",
|
||||
),
|
||||
session: dict = Depends(require_auth),
|
||||
) -> Dict:
|
||||
"""Vital signs matrix (R5)."""
|
||||
profile_id = session["profile_id"]
|
||||
return build_vital_signs_matrix_chart_payload(profile_id, days)
|
||||
omit_set: Optional[Set[str]] = None
|
||||
if omit_snapshot_keys and omit_snapshot_keys.strip():
|
||||
omit_set = {x.strip() for x in omit_snapshot_keys.split(",") if x.strip()}
|
||||
return build_vital_signs_matrix_chart_payload(profile_id, days, omit_snapshot_keys=omit_set)
|
||||
|
||||
|
||||
# ── Correlation Charts ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user