Add exercise progress graphs to new person overview page

This commit is contained in:
Peter Stockings
2025-01-26 20:00:31 +11:00
parent 2c8019ef7b
commit cd6f3920f5
3 changed files with 82 additions and 2 deletions

View File

@@ -469,3 +469,10 @@ def generate_plot(df, title):
# Convert Plotly figure to HTML div
plot_div = pio.to_html(fig, full_html=False)
return plot_div
def calculate_estimated_1rm(weight, repetitions):
# Ensure the inputs are numeric
if repetitions == 0: # Avoid division by zero
return 0
estimated_1rm = round((100 * int(weight)) / (101.3 - 2.67123 * repetitions), 0)
return int(estimated_1rm)