diff options
| -rw-r--r-- | services/app/assets/chart.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/services/app/assets/chart.js b/services/app/assets/chart.js index dab6cbf..5873080 100644 --- a/services/app/assets/chart.js +++ b/services/app/assets/chart.js @@ -31,6 +31,17 @@ document.addEventListener('DOMContentLoaded', async () => { } const stats = apiResult.stats; + // Filter best scores. + for (const s of stats) { + const bestScores = []; + for (const score of s.scores) { + if (bestScores.length === 0 || bestScores[bestScores.length - 1].code_size > score.code_size) { + bestScores.push(score); + } + } + s.scores = bestScores; + } + new Chart( chartCanvas, { |
