Commit 4c0e27bb authored by Zixian Cai's avatar Zixian Cai

Add button to filter Mu time entries

parent 00504bd3
......@@ -30,4 +30,21 @@ function timelineHideAll() {
trace.visible = "legendonly";
}
Plotly.redraw("linePlot");
}
function timelineMuTimeOnly() {
var traces = document.getElementById("linePlot").data;
for (i = 0; i < traces.length; i++) {
var trace = traces[i];
var zebuIndex = trace.name.indexOf("zebu");
var muIndex = trace.name.indexOf("mu");
var isMu = muIndex !== -1 || zebuIndex !== -1;
var isTime = trace.name.endsWith("time");
if (isMu && isTime) {
trace.visible = true;
} else {
trace.visible = "legendonly";
}
}
Plotly.redraw("linePlot");
}
\ No newline at end of file
......@@ -37,6 +37,7 @@
<div class="panel-body">
<button class="btn btn-primary" onclick="timelineHideAll()">Hide All</button>
<button class="btn btn-primary" onclick="timelineShowAll()">Show All</button>
<button class="btn btn-primary" onclick="timelineMuTimeOnly()">Show Mu Time Only</button>
{% include "timeline_body.html" %}
</div>
</div>
......
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