annotations & slider annotations at empower force chart
This commit is contained in:
@@ -546,6 +546,21 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
text_color='red',
|
||||
)
|
||||
|
||||
annolabel = Label(x=50,y=450,x_units='screen',y_units='screen',
|
||||
text='',
|
||||
background_fill_alpha=0.7,
|
||||
background_fill_color='white',
|
||||
text_color='black',
|
||||
)
|
||||
|
||||
sliderlabel = Label(x=10,y=470,x_units='screen',y_units='screen',
|
||||
text='',
|
||||
background_fill_alpha=0.7,
|
||||
background_fill_color='white',
|
||||
text_color='black',text_font_size='10pt',
|
||||
)
|
||||
|
||||
|
||||
plot.add_layout(peakflabel)
|
||||
plot.add_layout(peakforceanglelabel)
|
||||
plot.add_layout(avflabel)
|
||||
@@ -553,6 +568,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
plot.add_layout(sliplabel)
|
||||
plot.add_layout(washlabel)
|
||||
plot.add_layout(finishlabel)
|
||||
plot.add_layout(annolabel)
|
||||
plot.add_layout(sliderlabel)
|
||||
|
||||
plot.xaxis.axis_label = "Angle"
|
||||
plot.yaxis.axis_label = "Force (N)"
|
||||
@@ -576,6 +593,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
washlabel=washlabel,
|
||||
peakflabel=peakflabel,
|
||||
peakforceanglelabel=peakforceanglelabel,
|
||||
annolabel=annolabel,
|
||||
sliderlabel=sliderlabel,
|
||||
), code="""
|
||||
var data = source.data
|
||||
var data2 = source2.data
|
||||
@@ -596,6 +615,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
var peakforce = data2['peakforce']
|
||||
var averageforce = data2['averageforce']
|
||||
|
||||
var annotation = annotation.value
|
||||
var minspm = minspm.value
|
||||
var maxspm = maxspm.value
|
||||
var mindist = mindist.value
|
||||
@@ -603,6 +623,10 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
var minwork = minwork.value
|
||||
var maxwork = maxwork.value
|
||||
|
||||
sliderlabel.text = 'SPM: '+minspm.toFixed(0)+'-'+maxspm.toFixed(0)
|
||||
sliderlabel.text += ', Dist: '+mindist.toFixed(0)+'-'+maxdist.toFixed(0)
|
||||
sliderlabel.text += ', WpS: '+minwork.toFixed(0)+'-'+maxwork.toFixed(0)
|
||||
|
||||
var catchav = 0
|
||||
var finishav = 0
|
||||
var slipav = 0
|
||||
@@ -649,11 +673,16 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
washlabel.text = 'Wash: '+washav.toFixed(2)
|
||||
peakflabel.text = 'Fpeak: '+peakforceav.toFixed(2)
|
||||
peakforceanglelabel.text = 'Peak angle: '+peakforceangleav.toFixed(2)
|
||||
annolabel.text = annotation
|
||||
|
||||
// source.trigger('change');
|
||||
source.change.emit();
|
||||
""")
|
||||
|
||||
annotation = TextInput(title="Type your plot notes here", value="",
|
||||
callback=callback)
|
||||
callback.args["annotation"] = annotation
|
||||
|
||||
slider_spm_min = Slider(start=15.0, end=55,value=15.0, step=.1,
|
||||
title="Min SPM",callback=callback)
|
||||
callback.args["minspm"] = slider_spm_min
|
||||
@@ -683,7 +712,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=False):
|
||||
title="Max Distance",callback=callback)
|
||||
callback.args["maxdist"] = slider_dist_max
|
||||
|
||||
layout = layoutrow([layoutcolumn([slider_spm_min,
|
||||
layout = layoutrow([layoutcolumn([annotation,
|
||||
slider_spm_min,
|
||||
slider_spm_max,
|
||||
slider_dist_min,
|
||||
slider_dist_max,
|
||||
|
||||
Reference in New Issue
Block a user