League with a split
A league that plays its rounds, then splits into a championship group and a relegation group, with points carried over.
Championship group
| Team | P | W | D | L | +/- | Pts |
|---|---|---|---|---|---|---|
| 1Orcas | 10 | 8 | 0 | 2 | 11 | 24 |
| 2Herons | 11 | 7 | 0 | 4 | 6 | 21 |
| 3Lynx | 11 | 5 | 0 | 6 | -3 | 15 |
Relegation group
| Team | P | W | D | L | +/- | Pts |
|---|---|---|---|---|---|---|
| 1Falcons | 10 | 5 | 0 | 5 | -1 | 15 |
| 2Ravens | 11 | 4 | 0 | 7 | -5 | 12 |
| 3Wolves | 11 | 3 | 0 | 8 | -8 | 9 |
Championship group
Round 1
- Herons3Lynx0
Round 2
- LynxOrcas
Round 3
- OrcasHerons
Relegation group
Round 1
- Ravens1Wolves0
Round 2
- WolvesFalcons
Round 3
- FalconsRavens
Some leagues split partway through the season. After everyone has played everyone, the top half moves into a championship group and the bottom half into a relegation group. Each group plays one more round among itself, and the points from before the split carry over. The Scottish Premiership plays three times before its split, and leagues in Denmark and Austria work in a similar way.
You build it in two steps: the league, then the split.
import { roundRobin, standings } from 'react-brackets';
// Everyone plays everyone three times.
const league = roundRobin(teams, { legs: 3 });
// …play the league…
// Split the table in half, and play once more inside each half.
const table = standings(league);
const ids = (rows) => rows.map((row) => row.participantId);
const split = roundRobin(teams, {
id: 'split',
groups: [ids(table.slice(0, 6)), ids(table.slice(6))],
groupName: (index) => (index === 0 ? 'Championship group' : 'Relegation group'),
});
// Each group's table, with the points from before the split.
const [championship, relegation] = split.groups.map((group) =>
standings(split, group.id, { carryOver: table }),
);legssets how many times every pairing plays. Sides swap each leg.groupstakes the groups you want as lists of participant ids. Everyone has to be in exactly one group.carryOveradds an earlier table to this one: games played, wins, goals and points.- Each group is ranked on its own, so a team in the relegation group stays below the championship group, even with more points. To show one full table, put the two together:
[...championship, ...relegation].
Give the split its own id, so its match ids don't clash with the league's. See roundRobin and standings in the API reference.