incomplete force curve
This commit is contained in:
@@ -553,6 +553,19 @@ def interactive_forcecurve(theworkouts, workstrokesonly=True, plottype='scatter'
|
||||
if rowdata.empty:
|
||||
return "", "No Valid Data Available", "", ""
|
||||
|
||||
data_dict = rowdata.to_dict("records")
|
||||
|
||||
thresholdforce = 100. if 'x' in boattype else 200.
|
||||
|
||||
chart_data = {
|
||||
'title': theworkouts[0].name,
|
||||
'data': data_dict,
|
||||
'thresholdforce': thresholdforce,
|
||||
}
|
||||
|
||||
script, div = get_chart("/forcecurve", chart_data)
|
||||
return script, div
|
||||
|
||||
try:
|
||||
covariancematrix = np.cov(
|
||||
rowdata['peakforceangle'], y=rowdata['peakforce'])
|
||||
|
||||
@@ -8,16 +8,8 @@
|
||||
{% localtime on %}
|
||||
{% block main %}
|
||||
|
||||
{{ js_res | safe }}
|
||||
{{ css_res| safe }}
|
||||
<script src="https://d3js.org/d3.v6.js"></script>
|
||||
|
||||
<script src="https://cdn.pydata.org/bokeh/release/bokeh-3.1.1.min.js"></script>
|
||||
<script src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-3.1.1.min.js"></script>
|
||||
<script async="true" type="text/javascript">
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
|
||||
{{ the_script |safe }}
|
||||
|
||||
<h1>Empower Force Curve</h1>
|
||||
|
||||
@@ -25,6 +17,7 @@
|
||||
<li class="grid_4">
|
||||
<div id="theplot" class="flexplot">
|
||||
{{ the_div|safe }}
|
||||
{{ the_script |safe }}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -52,27 +45,6 @@
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var slider_min_spm = Bokeh.documents[0].get_model_by_name('min_spm_slider')
|
||||
slider_min_spm.value = {{ spm_min }}
|
||||
console.log('min spm value after:', slider_min_spm.value)
|
||||
var slider_max_spm = Bokeh.documents[0].get_model_by_name('max_spm_slider')
|
||||
slider_max_spm.value = {{ spm_max }}
|
||||
console.log('max spm value after:', slider_max_spm.value)
|
||||
var slider_min_work = Bokeh.documents[0].get_model_by_name('min_work_slider')
|
||||
slider_min_work.value = {{ work_min }}
|
||||
console.log('min work value after:', slider_min_work.value)
|
||||
var slider_max_work = Bokeh.documents[0].get_model_by_name('max_work_slider')
|
||||
slider_max_work.value = {{ work_max }}
|
||||
console.log('max work value after:', slider_max_work.value)
|
||||
var slider_min_dist = Bokeh.documents[0].get_model_by_name('min_dist_slider')
|
||||
slider_min_dist.value = {{ dist_min }}
|
||||
console.log('min dist value after:', slider_min_dist.value)
|
||||
var slider_max_dist = Bokeh.documents[0].get_model_by_name('max_dist_slider')
|
||||
slider_max_dist.value = {{ dist_max }}
|
||||
console.log('max dist value after:', slider_max_dist.value)
|
||||
var annotation = Bokeh.documents[0].get_model_by_name('annotation')
|
||||
annotation.value = "{{ annotation }}"
|
||||
console.log('Annotation set to ', annotation.value)
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly
|
||||
plottype = 'line'
|
||||
|
||||
|
||||
script, div, js_resources, css_resources = interactive_forcecurve(
|
||||
script, div = interactive_forcecurve(
|
||||
[row],
|
||||
workstrokesonly=workstrokesonly,
|
||||
plottype=plottype,
|
||||
@@ -577,8 +577,6 @@ def workout_forcecurve_view(request, id=0, analysis=0, userid=0, workstrokesonly
|
||||
'work_max': work_max,
|
||||
'annotation': notes,
|
||||
'the_div': div,
|
||||
'js_res': js_resources,
|
||||
'css_res': css_resources,
|
||||
'id': id,
|
||||
'mayedit': mayedit,
|
||||
'teams': get_my_teams(request.user),
|
||||
|
||||
Reference in New Issue
Block a user