Private
Public Access
1
0
Files
rowsandall/rowers/templates/forcecurve_single.html
2022-10-26 23:49:28 +02:00

85 lines
3.1 KiB
HTML

{% extends "newbase.html" %}
{% load static %}
{% load rowerfilters %}
{% load tz %}
{% block title %} Force Curve Plot {% endblock %}
{% localtime on %}
{% block main %}
{{ js_res | safe }}
{{ css_res| safe }}
<script src="https://cdn.pydata.org/bokeh/release/bokeh-2.2.3.min.js"></script>
<script src="https://cdn.pydata.org/bokeh/release/bokeh-widgets-2.2.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
{{ the_script |safe }}
<h1>Empower Force Curve</h1>
<ul class="main-content">
<li class="grid_4">
<div id="theplot" class="flexplot">
{{ the_div|safe }}
</div>
</li>
<li class="grid_4">
<form enctype="multipart/form-data" action="" method="post">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<div class="buttoncontainer">
<input name="chartform" type="submit" class="button"
value="Update Chart">
<input name='_save' class="button" type="submit" value="Save">
<input name='_save_as_new' class="button" type="submit" value="Save as New">
<p>
With the Save buttons, you can save your analysis for future use and to compare
multiple analyses to each other. You can find the saved analyses under the Analysis
tab (<a href="/rowers/analysis/forcecurveanalysis/">force curve analysis</a>).
</p>
</div>
</form>
</li>
</ul>
<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>
{% endblock %}
{% endlocaltime %}
{% block sidebar %}
{% include 'menu_workout.html' %}
{% endblock %}