myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit 99a58339accd294dd0dfff3b9e87b78534ddfe41
parent ce7d3425aa00af6e70a241a5ab73f3297e49d0b7
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Thu, 23 Mar 2023 23:26:29 +0100

feat: order by start nr

Diffstat:
Msrc/Leaderboard.js | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/Leaderboard.js b/src/Leaderboard.js @@ -64,6 +64,9 @@ function rankByHeat(rankingComp) { // rank by chosen heat or ranking comparator for (const r of rankingComp) { switch(r.value) { + case 'start': + // rank by start number + return b.nr < a.nr case 'best': if (b.bestHeat - a.bestHeat !== 0) { // rank by best heat first @@ -147,8 +150,18 @@ function Leaderboard() { }) // add options to rank by best/worst heat - const rankOpts = heatOpts.concat([ + const rankOpts = heatOpts.map(h => { + return { + value: h.value, + label: "Sum " + h.label + } + }) + + rankOpts.push(...[ { + value: 'start', + label: 'Start Nr.' + }, { value: 'best', label: 'Best Heat' }, {