Commit d8f1bff1 authored by uudlo's avatar uudlo

Add possibility to disable the confidence interval visualisation

parent 46aea4d8
......@@ -45,6 +45,20 @@ function scatterChart(chartID, dataSets) {
Plotly.plot(chartID, dataSets, layout, options);
};
function toggleGlicko2ConfidenceIntervalCheckbox(element)
{
updateTraceVisibility("chart_glicko2_history", element.name, element.checked)
}
function updateTraceVisibility(chartID, traceID, visible) {
var update = {
visible: 'legendonly',
};
if (visible) {
update.visible = true;
}
Plotly.restyle(chartID, update, traceID);
};
$(function() {
var isMobile = window.matchMedia("only screen and (max-width: 768px)");
......
......@@ -21,6 +21,11 @@
<div class="col-md-4">
<h5>{{ stat_descriptions|ldescr:'glicko2_history' }}</h5>
<div id="chart_glicko2_history"></div>
<div>
{% for player in player_list|dictsort:"stats.points" %}
<label><input type="checkbox" name="{{ forloop.counter0 }}" onchange="toggleGlicko2ConfidenceIntervalCheckbox(this)"> {{ player.name }}</label>
{% endfor %}
</div>
</div>
</div>
<div class="row">
......@@ -163,6 +168,7 @@ var dataSetsGlicko2History = [
type: "scatter",
showlegend: false,
hoverinfo: "skip",
visible: 'legendonly',
x: [
{% for point in player.stats.glicko2_confidence_interval_history %}{{ forloop.counter0 }},{% endfor %}
{% for point in player.stats.glicko2_confidence_interval_history reversed %}{{ forloop.revcounter0 }},{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment