From c5e825f4dfb93b9c07b0bb0925454190829159e2 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 9 Dec 2023 22:25:37 +1100 Subject: [PATCH] Make svg graph more generic, and make line of best fit the last line rendered so its always on top --- db.py | 2 +- templates/partials/sparkline.html | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/db.py b/db.py index 566444c..acbbf8d 100644 --- a/db.py +++ b/db.py @@ -535,7 +535,7 @@ class DataBase(): # Return exercise data with SVG dimensions and data points return { - 'exercise_name': topsets[0]['exercise_name'], + 'title': topsets[0]['exercise_name'], 'vb_width': vb_width, 'vb_height': vb_height, 'plots': [repetitions, weight, estimated_1rm], diff --git a/templates/partials/sparkline.html b/templates/partials/sparkline.html index f4efdc3..eb3fe50 100644 --- a/templates/partials/sparkline.html +++ b/templates/partials/sparkline.html @@ -46,9 +46,8 @@ -

{{ exercise_name }}

+

{{ title }}

- {% for plot in plots %} {{ plot_line(plot.points, plot.color) }} @@ -71,8 +70,7 @@ {% endfor %} - {% for pos in relative_positions %} - {% endfor %} +
{% for plot in plots %}