Skip to content

Commit

Permalink
Merge pull request #42 from mukilan/add-explanation-for-scores
Browse files Browse the repository at this point in the history
Add explanation for scores
  • Loading branch information
mrego authored Dec 13, 2024
2 parents fc0dcf4 + 88cbea1 commit ab69e8b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
18 changes: 18 additions & 0 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
#score-table-body .score {
text-align: right;
}

#score-explanation {
padding: 10px;
font-size: 1rem;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -103,11 +108,24 @@
<div class="row hide-in-embed">
<table class="col-12" id="score-table">
<thead id="score-table-header">
<tr>
<th>Test Suite</th>
<th>Score</th>
</tr>
</thead>
<tbody id="score-table-body">
</tbody>
</table>
</div>
<div class="row hide-in-embed" id="score-explanation">
Scores are calculated as percentages of total <b>enabled</b>
tests within the suite that pass. A passing test with no
subtests gets a score of 1 while a test with subtests gets a
score between 0 and 1 representing the fraction of passing
subtests within that test. This is different from the
percentages on wpt.fyi which is calculated by giving equal
weight to both top-level tests and subtests.
</div>
</div>
</body>
</html>
21 changes: 5 additions & 16 deletions site/load-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,6 @@ function setupChart () {
const score_table = document.getElementById('score-table-body')
removeChildren(score_table)

removeChildren(document.getElementById('score-table-header'))
.insertAdjacentHTML(
'beforeend',
`<tr>
<th>Test Suite</th>
<th>Servo</th>
</tr>`
)

for (const [idx, area] of scores.area_keys.entries()) {
const recent_score = scores.scores[scores.scores.length - 1]
score_table.insertAdjacentHTML(
Expand Down Expand Up @@ -200,15 +191,13 @@ function setupChart () {
area_dropdown.appendChild(selector)
}

function update () {
update_table(scores)
update_chart()
}
update_chart()

area_dropdown.onchange = update
period_dropdown.onchange = update
area_dropdown.onchange = update_chart
period_dropdown.onchange = update_chart
area_dropdown.value = scores.area_keys[0]
period_dropdown.value = Object.keys(periodRanges)[4]
update()
update_table(scores)
update_chart()
})
}

0 comments on commit ab69e8b

Please sign in to comment.