From ac0d2bc50450c7f83cdae657a0f37d878add93d4 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 2 Apr 2024 22:26:17 +0200 Subject: [PATCH] moved some of form to chart --- rowers/forms.py | 8 -------- rowers/interactiveplots.py | 2 +- rowers/templates/forcecurve_single.html | 4 ++-- rowers/views/workoutviews.py | 5 ----- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/rowers/forms.py b/rowers/forms.py index 3376dc36..c69e3720 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -1870,14 +1870,6 @@ class ForceCurveOptionsForm(forms.Form): notes = forms.CharField(initial="", label='notes', widget=HiddenInput, required=False) - plotchoices = ( - ('line', 'Force Curve Collection Plot'), - ('scatter', 'Peak Force Scatter Plot'), - ('none', 'Only aggregrate data') - ) - plottype = forms.ChoiceField(choices=plotchoices, initial='line', - label='Individual Stroke Chart Type') - name = forms.CharField(initial="", label='Name',required=False) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 1e14f767..f8f8a5e0 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -534,7 +534,7 @@ def interactive_forcecurve(theworkouts, workstrokesonly=True, plottype='scatter' columns = ['catch', 'slip', 'wash', 'finish', 'averageforce', 'peakforceangle', 'peakforce', 'spm', 'distance', - 'workoutstate', 'driveenergy'] + 'workoutstate', 'driveenergy', 'cumdist'] rowdata = dataprep.getsmallrowdata_db(columns, ids=ids, workstrokesonly=workstrokesonly) diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index f5da7253..f3251dba 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -25,8 +25,8 @@
{% csrf_token %} - {{ form.as_table }} -
+ {{ form.as_table }} +
diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 909a6750..20c40276 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -448,10 +448,8 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly 'work_min': work_min, 'work_max': work_max, 'notes': notes, - 'plottype': 'line', 'name': name, }) - plottype = 'line' if request.method == 'POST': @@ -468,7 +466,6 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly if not name: name = row.name includereststrokes = form.cleaned_data['includereststrokes'] - plottype = form.cleaned_data['plottype'] workstrokesonly = not includereststrokes if "_save" in request.POST and "new" not in request.POST: # pragma: no cover @@ -523,13 +520,11 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly else: # pragma: no cover workstrokesonly = True - plottype = 'line' script, div = interactive_forcecurve( [row], workstrokesonly=workstrokesonly, - plottype=plottype, dist_min = dist_min, dist_max = dist_max, spm_min = spm_min,