diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 71f154b3..0cb791c5 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -272,7 +272,7 @@ def getstatsfields(): fielddict = {field.name:field.verbose_name for field in fields} - fielddict.pop('workoutid') + #fielddict.pop('workoutid') fielddict.pop('ergpace') fielddict.pop('hr_an') fielddict.pop('hr_tr') diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index f79b9ce2..14d42578 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -11,7 +11,7 @@ from bokeh.palettes import Dark2_8 as palette import itertools from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc from bokeh.models import CustomJS,Slider, TextInput -from bokeh.charts import Histogram,HeatMap +from bokeh.charts import Histogram,HeatMap,Area,BoxPlot from bokeh.resources import CDN,INLINE from bokeh.embed import components from bokeh.layouts import layout,widgetbox @@ -87,6 +87,22 @@ def tailwind(bearing,vwind,winddir): from rowers.dataprep import nicepaceformat,niceformat from rowers.dataprep import timedeltaconv +def interactive_boxchart(datadf,fieldname): + + plot = BoxPlot(datadf, values=fieldname, label='date', + legend=False, + title=axlabels[fieldname], + outliers=False) + + yrange1 = Range1d(start=yaxminima[fieldname],end=yaxmaxima[fieldname]) + plot.y_range = yrange1 + + + script, div = components(plot) + + + return script,div + def interactive_forcecurve(theworkouts,workstrokesonly=False): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,resize,crosshair' diff --git a/rowers/templates/cumstats.html b/rowers/templates/cumstats.html index eb0b9654..484e89ff 100644 --- a/rowers/templates/cumstats.html +++ b/rowers/templates/cumstats.html @@ -5,6 +5,35 @@ {% block title %}Workout Statistics{% endblock %} {% block content %} + + + + + {{ plotscript |safe }} + + + + +
@@ -97,6 +126,7 @@
This matrix indicates a positive (+) or negative (-) correlation between two parameters. The Spearman correlation coefficient has values between +1 and -1. Positive correlation between two metrics means that if one metric increases, the other value is also likely to increase. Negative is the opposite. The further from zero, the higher the likelyhood.
@@ -132,8 +162,13 @@ {% endfor %} +