Commit 5fc83764 authored by Zixian Cai's avatar Zixian Cai

Add button to hide/show all

parent 36bf84c1
/*
Copyright 2017 The Australian National University
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function timelineShowAll() {
var traces = document.getElementById("linePlot").data;
for (i = 0; i < traces.length; i++) {
var trace = traces[i];
trace.visible = true;
}
Plotly.redraw("linePlot");
}
function timelineHideAll() {
var traces = document.getElementById("linePlot").data;
for (i = 0; i < traces.length; i++) {
var trace = traces[i];
trace.visible = "legendonly";
}
Plotly.redraw("linePlot");
}
\ No newline at end of file
......@@ -63,5 +63,6 @@
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<script src="{{ url_for('root.static', filename='mubench.js') }}"></script>
</body>
</html>
\ No newline at end of file
......@@ -35,6 +35,8 @@
<div class="panel-heading">How has Mu performance evolved over time?
</div>
<div class="panel-body">
<button class="btn btn-primary" onclick="timelineHideAll()">Hide All</button>
<button class="btn btn-primary" onclick="timelineShowAll()">Show All</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