Add min/max filter filter for exercise sparkline graph
This commit is contained in:
8
utils.py
8
utils.py
@@ -214,7 +214,7 @@ def flatten(lst):
|
||||
result.append(item)
|
||||
return result
|
||||
|
||||
def get_exercise_graph_model(title, estimated_1rm, repetitions, weight, start_dates, messages, epoch, person_id, exercise_id):
|
||||
def get_exercise_graph_model(title, estimated_1rm, repetitions, weight, start_dates, messages, epoch, person_id, exercise_id, min_date=None, max_date=None):
|
||||
min_date, max_date = min(start_dates), max(start_dates)
|
||||
min_e1rm, max_e1rm = min(estimated_1rm), max(estimated_1rm)
|
||||
min_reps, max_reps = min(repetitions), max(repetitions)
|
||||
@@ -295,10 +295,12 @@ def get_exercise_graph_model(title, estimated_1rm, repetitions, weight, start_da
|
||||
'best_fit_points': best_fit_points,
|
||||
'best_fit_formula': best_fit_formula,
|
||||
'plot_labels': plot_labels,
|
||||
'epochs': ['1M', '3M', '6M', 'All'],
|
||||
'epochs': ['Custom', '1M', '3M', '6M', 'All'],
|
||||
'selected_epoch': epoch,
|
||||
'person_id': person_id,
|
||||
'exercise_id': exercise_id
|
||||
'exercise_id': exercise_id,
|
||||
'min_date': min_date,
|
||||
'max_date': max_date
|
||||
}
|
||||
|
||||
def get_workout_counts(workouts, period='week'):
|
||||
|
||||
Reference in New Issue
Block a user