README update + new Screenshot of the FIT app Version

This commit is contained in:
2025-09-14 16:03:00 +02:00
parent d0deae4e2b
commit 1d005e54c5
5 changed files with 38 additions and 41 deletions

View File

@@ -3,7 +3,7 @@
An interactive Python Dash app to visualize, analyze, and explore your jogging or running sessions recorded as GPX/FIT files.
<p align="left">
<img src="WebAppGPXDashboard.jpg" alt="Description" width="800">
<img src="WebAppFITDashboard.png" alt="Description" width="800">
</p>
---

BIN
WebAppFITDashboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 KiB

BIN
WebAppGPXDashboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

@@ -27,13 +27,10 @@ from fitparse import FitFile
# === Helper Functions ===
def list_fit_files():
folder = './fit_files' # Ordnerpfad anpassen
if not os.path.exists(folder):
os.makedirs(folder)
folder = './fit_files'
files = [f for f in os.listdir(folder) if f.lower().endswith('.fit')]
# Datum extrahieren für Sortierung
# Extract date from the start of the filename and sort descending
def extract_date(filename):
try:
return datetime.datetime.strptime(filename[:10], '%d.%m.%Y') # Format DD.MM.YYYY
@@ -523,6 +520,7 @@ def create_heart_rate_plot(df):
mode='lines',
#name='Geglättete Herzfrequenz',
line=dict(color='#E43D70', width=2),
showlegend=False,
hovertemplate=(
"Zeit: %{x}<br>" +
"Herzfrequenz: %{y:.0f} bpm<br>" +
@@ -530,18 +528,18 @@ def create_heart_rate_plot(df):
)
))
# Optional: Raw Heart Rate als dünnere, transparente Linie
if not df['heart_rate'].isna().all():
fig.add_trace(go.Scatter(
x=df['time'],
y=df['heart_rate'],
mode='lines',
name='Raw Herzfrequenz',
line=dict(color='#E43D70', width=1, dash='dot'),
opacity=0.3,
showlegend=False,
hoverinfo='skip'
))
# # Optional: Raw Heart Rate als dünnere, transparente Linie
# if not df['heart_rate'].isna().all():
# fig.add_trace(go.Scatter(
# x=df['time'],
# y=df['heart_rate'],
# mode='lines',
# name='Raw Herzfrequenz',
# line=dict(color='#E43D70', width=1, dash='dot'),
# opacity=0.3,
# showlegend=False,
# hoverinfo='skip'
# ))
# Durchschnittslinie
if mean_hr > 0:
@@ -569,31 +567,30 @@ def create_heart_rate_plot(df):
# Heart Rate Zonen (optional)
if mean_hr > 0:
# Geschätzte maximale Herzfrequenz (220 - Alter, hier als Beispiel 190)
max_hr_estimated = 190 # Du kannst das anpassen
# Geschätzte maximale Herzfrequenz (Beispiel: 200 bpm)
# Heart Rate Zonen (optional)
# Geschätzte maximale Herzfrequenz
max_hr_estimated = 200 # oder z. B. 220 - alter
# Zone 1: Sehr leicht (50-60% HRmax)
zone1_lower = max_hr_estimated * 0.5
zone1_upper = max_hr_estimated * 0.6
# Definiere feste HR-Zonen in BPM
zones = [
{"name": "Zone 1", "lower": 0, "upper": 124, "color": "#F4A4A3"},
{"name": "Zone 2", "lower": 124, "upper": 154, "color": "#EF7476"},
{"name": "Zone 3", "lower": 154, "upper": 169, "color": "#EA4748"},
{"name": "Zone 4", "lower": 169, "upper": 184, "color": "#E02628"},
{"name": "Zone 5", "lower": 184, "upper": max_hr_estimated, "color": "#B71316"},
]
# Zone 2: Leicht (60-70% HRmax)
zone2_upper = max_hr_estimated * 0.7
# Zone 3: Moderat (70-80% HRmax)
zone3_upper = max_hr_estimated * 0.8
# Zone 4: Hart (80-90% HRmax) #update: bis 100%
zone4_upper = max_hr_estimated * 1.0
# Füge Zonen-Bereiche als Hintergrundbereiche hinzu
fig.add_hrect(y0=zone1_lower, y1=zone1_upper,
fillcolor="green", opacity=0.1, line_width=0)
fig.add_hrect(y0=zone1_upper, y1=zone2_upper,
fillcolor="yellow", opacity=0.1, line_width=0)
fig.add_hrect(y0=zone2_upper, y1=zone3_upper,
fillcolor="orange", opacity=0.1, line_width=0)
fig.add_hrect(y0=zone3_upper, y1=zone4_upper,
fillcolor="red", opacity=0.1, line_width=0)
# Zeichne Zonen als Hintergrund (horizontale Rechtecke)
for zone in zones:
fig.add_hrect(
y0=zone["lower"], y1=zone["upper"],
fillcolor=zone["color"],
opacity=0.1,
line_width=0,
annotation_text=zone["name"], # optional: Name der Zone einblenden
annotation_position="top left"
)
# Layout
title_text = f'Herzfrequenz über die Zeit (geglättete)'