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

Add button to filter Mu time entries

parent 00504bd3
...@@ -31,3 +31,20 @@ function timelineHideAll() { ...@@ -31,3 +31,20 @@ function timelineHideAll() {
} }
Plotly.redraw("linePlot"); 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 @@ ...@@ -37,6 +37,7 @@
<div class="panel-body"> <div class="panel-body">
<button class="btn btn-primary" onclick="timelineHideAll()">Hide All</button> <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="timelineShowAll()">Show All</button>
<button class="btn btn-primary" onclick="timelineMuTimeOnly()">Show Mu Time Only</button>
{% include "timeline_body.html" %} {% include "timeline_body.html" %}
</div> </div>
</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