diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 3b74b7b8..fe4dd91a 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -553,6 +553,19 @@ def interactive_forcecurve(theworkouts, workstrokesonly=True, plottype='scatter' if rowdata.empty: return "", "No Valid Data Available", "", "" + data_dict = rowdata.to_dict("records") + + thresholdforce = 100. if 'x' in boattype else 200. + + chart_data = { + 'title': theworkouts[0].name, + 'data': data_dict, + 'thresholdforce': thresholdforce, + } + + script, div = get_chart("/forcecurve", chart_data) + return script, div + try: covariancematrix = np.cov( rowdata['peakforceangle'], y=rowdata['peakforce']) diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index d9ea9729..f5da7253 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -8,16 +8,8 @@ {% localtime on %} {% block main %} -{{ js_res | safe }} -{{ css_res| safe }} + - - - - -{{ the_script |safe }}

Empower Force Curve

@@ -25,7 +17,8 @@
  • {{ the_div|safe }} -
    + {{ the_script |safe }} +
  • @@ -52,27 +45,6 @@ diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index d0e77543..909a6750 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -526,7 +526,7 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly plottype = 'line' - script, div, js_resources, css_resources = interactive_forcecurve( + script, div = interactive_forcecurve( [row], workstrokesonly=workstrokesonly, plottype=plottype, @@ -577,8 +577,6 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly 'work_max': work_max, 'annotation': notes, 'the_div': div, - 'js_res': js_resources, - 'css_res': css_resources, 'id': id, 'mayedit': mayedit, 'teams': get_my_teams(request.user),