diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 04c2ee23..88f99d01 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -178,6 +178,42 @@ def interactive_forcecurve(theworkouts): plot.add_layout(avf) + avflabel = Label(x=450,y=500,x_units='screen',y_units='screen', + text="Favg: {averageforceav:6.2f}".format(averageforceav=averageforceav), + background_fill_alpha=.7, + text_color='blue', + ) + + catchlabel = Label(x=450,y=470,x_units='screen',y_units='screen', + text="Catch: {catchav:6.2f}".format(catchav=catchav), + background_fill_alpha=0.7, + text_color='red', + ) + + finishlabel = Label(x=450,y=440,x_units='screen',y_units='screen', + text="Finish: {finishav:6.2f}".format(finishav=finishav), + background_fill_alpha=0.7, + text_color='red', + ) + + sliplabel = Label(x=450,y=410,x_units='screen',y_units='screen', + text="Slip: {slipav:6.2f}".format(slipav=slipav), + background_fill_alpha=0.7, + text_color='red', + ) + + washlabel = Label(x=450,y=380,x_units='screen',y_units='screen', + text="Wash: {washav:6.2f}".format(washav=washav), + background_fill_alpha=0.7, + text_color='red', + ) + + plot.add_layout(avflabel) + plot.add_layout(catchlabel) + plot.add_layout(sliplabel) + plot.add_layout(washlabel) + plot.add_layout(finishlabel) + plot.xaxis.axis_label = "Angle" plot.yaxis.axis_label = "Force (lbs)" plot.title.text = theworkouts[0].name @@ -193,7 +229,12 @@ def interactive_forcecurve(theworkouts): source=source, source2=source2, avf=avf, - ), code=""" + avflabel=avflabel, + catchlabel=catchlabel, + finishlabel=finishlabel, + sliplabel=sliplabel, + washlabel=washlabel, + ), code=""" var data = source.data var data2 = source2.data @@ -254,6 +295,11 @@ def interactive_forcecurve(theworkouts): data['y'] = [0,thresholdforce,peakforceav,thresholdforce,0] avf.location = averageforceav + avflabel.text = 'Favg: '+averageforceav.toFixed(2) + catchlabel.text = 'Catch: '+catchav.toFixed(2) + finishlabel.text = 'Finish: '+finishav.toFixed(2) + sliplabel.text = 'Slip: '+slipav.toFixed(2) + washlabel.text = 'Wash: '+washav.toFixed(2) source.trigger('change'); """)