Skip to content

Commit ea002c7

Browse files
committed
Properly right-align numbers in compare table
1 parent c0bcd99 commit ea002c7

File tree

1 file changed

+45
-23
lines changed

1 file changed

+45
-23
lines changed

site/frontend/src/pages/compare/benchmarks/test-cases-table.vue

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -117,29 +117,41 @@ function prettifyRawNumber(number: number): string {
117117
</td>
118118
<td>{{ testCase.scenario }}</td>
119119
<td>
120-
<a
121-
v-bind:href="
122-
detailedQueryPercentLink(commitB, commitA, testCase)
123-
"
124-
>
125-
<span v-bind:class="percentClass(testCase.percent)">
126-
{{ testCase.percent.toFixed(2) }}%
127-
</span>
128-
</a>
120+
<div class="numeric-aligned">
121+
<div>
122+
<a
123+
v-bind:href="
124+
detailedQueryPercentLink(commitB, commitA, testCase)
125+
"
126+
>
127+
<span v-bind:class="percentClass(testCase.percent)">
128+
{{ testCase.percent.toFixed(2) }}%
129+
</span>
130+
</a>
131+
</div>
132+
</div>
129133
</td>
130134
<td>
131-
{{
132-
testCase.significanceThreshold
133-
? testCase.significanceThreshold.toFixed(2) + "%"
134-
: "-"
135-
}}
135+
<div class="numeric-aligned">
136+
<div>
137+
{{
138+
testCase.significanceThreshold
139+
? testCase.significanceThreshold.toFixed(2) + "%"
140+
: "-"
141+
}}
142+
</div>
143+
</div>
136144
</td>
137145
<td>
138-
{{
139-
testCase.significanceFactor
140-
? testCase.significanceFactor.toFixed(2) + "x"
141-
: "-"
142-
}}
146+
<div class="numeric-aligned">
147+
<div>
148+
{{
149+
testCase.significanceFactor
150+
? testCase.significanceFactor.toFixed(2) + "x"
151+
: "-"
152+
}}
153+
</div>
154+
</div>
143155
</td>
144156
<td v-if="showRawData" class="numeric">
145157
<a v-bind:href="detailedQueryRawDataLink(commitA, testCase)">
@@ -189,17 +201,27 @@ function prettifyRawNumber(number: number): string {
189201
190202
.benches th {
191203
text-align: center;
192-
width: 25%;
193204
min-width: 50px;
194205
}
195206
196207
.benches td {
197208
text-align: center;
198209
width: 25%;
199-
}
200210
201-
.benches td.numeric {
202-
text-align: right;
211+
& > .numeric-aligned {
212+
display: flex;
213+
flex-direction: column;
214+
align-items: center;
215+
text-align: right;
216+
217+
& > div {
218+
width: 70px;
219+
}
220+
}
221+
222+
&.numeric {
223+
text-align: right;
224+
}
203225
}
204226
205227
.bench-table {

0 commit comments

Comments
 (0)