Skip to content

Commit 835cb5c

Browse files
Merge pull request #1091 from homersimpsons/feature/raw-data-display
feature(compare) Add option to hide raw data, and improve formatting
2 parents 6dcfae7 + 50634c1 commit 835cb5c

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

site/static/compare.html

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,22 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
389389
</div>
390390
</div>
391391
</fieldset>
392+
<fieldset id="display">
393+
<legend id="display-toggle" class="section-heading">Display<span id="display-toggle-indicator"></span>
394+
</legend>
395+
<div id="display-content" style="display: none;">
396+
<div class="section">
397+
<div class="section-heading"><span>Display raw data</span>
398+
<span class="tooltip">?
399+
<span class="tooltiptext">
400+
Whether to display or not raw data columns.
401+
</span>
402+
</span>
403+
</div>
404+
<input type="checkbox" v-model="showRawData" style="margin-left: 20px;" />
405+
</div>
406+
</div>
407+
</fieldset>
392408
<p v-if="dataLoading && !data">Loading ...</p>
393409
<div v-if="data" id="content" style="margin-top: 15px">
394410
<div id="summary">
@@ -438,8 +454,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
438454
</span>
439455
</span>
440456
</th>
441-
<th>{{before}}</th>
442-
<th>{{after}}</th>
457+
<th v-if="showRawData">{{before}}</th>
458+
<th v-if="showRawData">{{after}}</th>
443459
</tr>
444460
</thead>
445461
<tbody v-if="testCases.length === 0">
@@ -458,17 +474,16 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
458474
</a>
459475
</td>
460476
<td>
461-
{{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" :"-"
462-
}}
477+
{{ testCase.significanceFactor ? testCase.significanceFactor.toFixed(2) + "x" : "-" }}
463478
</td>
464-
<td>
479+
<td v-if="showRawData">
465480
<a v-bind:href="detailedQueryLink(data.a.commit, testCase)">
466-
{{ testCase.datumA }}
481+
<abbr :title="testCase.datumA">{{ testCase.datumA.toFixed(2) }}</abbr>
467482
</a>
468483
</td>
469-
<td>
484+
<td v-if="showRawData">
470485
<a v-bind:href="detailedQueryLink(data.b.commit, testCase)">
471-
{{ testCase.datumB }}
486+
<abbr :title="testCase.datumB">{{ testCase.datumB.toFixed(2) }}</abbr>
472487
</a>
473488
</td>
474489
</tr>
@@ -538,6 +553,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
538553
incrPatched: true
539554
}
540555
},
556+
showRawData: false,
541557
data: null,
542558
dataLoading: false
543559
},
@@ -767,6 +783,7 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
767783
}
768784
toggleFilters("filters-content", "filters-toggle-indicator");
769785
toggleFilters("search-content", "search-toggle-indicator");
786+
toggleFilters("display-content", "display-toggle-indicator");
770787

771788
function testCaseString(testCase) {
772789
return testCase.benchmark + "-" + testCase.profile + "-" + testCase.scenario;
@@ -778,6 +795,9 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
778795
document.getElementById("search-toggle").onclick = (e) => {
779796
toggleFilters("search-content", "search-toggle-indicator");
780797
};
798+
document.getElementById("display-toggle").onclick = (e) => {
799+
toggleFilters("display-content", "display-toggle-indicator");
800+
};
781801

782802
function unique(arr) {
783803
return arr.filter((value, idx) => arr.indexOf(value) == idx);

0 commit comments

Comments
 (0)