Skip to Content
react-brackets

League with a split

A league that plays its rounds, then splits into a championship group and a relegation group, with points carried over.

Markdown

Championship group

TeamPWDL+/-Pts
1Orcas108021124
2Herons11704621
3Lynx11506-315

Relegation group

TeamPWDL+/-Pts
1Falcons10505-115
2Ravens11407-512
3Wolves11308-89

Championship group

Round 1

  1. Herons3
    Lynx0

Round 2

  1. Lynx
    Orcas

Round 3

  1. Orcas
    Herons

Relegation group

Round 1

  1. Ravens1
    Wolves0

Round 2

  1. Wolves
    Falcons

Round 3

  1. Falcons
    Ravens

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 }),
);
  • legs sets how many times every pairing plays. Sides swap each leg.
  • groups takes the groups you want as lists of participant ids. Everyone has to be in exactly one group.
  • carryOver adds 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.