Force curve plot
This commit is contained in:
@@ -178,6 +178,42 @@ def interactive_forcecurve(theworkouts):
|
|||||||
|
|
||||||
plot.add_layout(avf)
|
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.xaxis.axis_label = "Angle"
|
||||||
plot.yaxis.axis_label = "Force (lbs)"
|
plot.yaxis.axis_label = "Force (lbs)"
|
||||||
plot.title.text = theworkouts[0].name
|
plot.title.text = theworkouts[0].name
|
||||||
@@ -193,6 +229,11 @@ def interactive_forcecurve(theworkouts):
|
|||||||
source=source,
|
source=source,
|
||||||
source2=source2,
|
source2=source2,
|
||||||
avf=avf,
|
avf=avf,
|
||||||
|
avflabel=avflabel,
|
||||||
|
catchlabel=catchlabel,
|
||||||
|
finishlabel=finishlabel,
|
||||||
|
sliplabel=sliplabel,
|
||||||
|
washlabel=washlabel,
|
||||||
), code="""
|
), code="""
|
||||||
var data = source.data
|
var data = source.data
|
||||||
var data2 = source2.data
|
var data2 = source2.data
|
||||||
@@ -254,6 +295,11 @@ def interactive_forcecurve(theworkouts):
|
|||||||
data['y'] = [0,thresholdforce,peakforceav,thresholdforce,0]
|
data['y'] = [0,thresholdforce,peakforceav,thresholdforce,0]
|
||||||
|
|
||||||
avf.location = averageforceav
|
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');
|
source.trigger('change');
|
||||||
""")
|
""")
|
||||||
|
|||||||
Reference in New Issue
Block a user