Skip to the content

Taisen Brackets対戦

Knockout brackets as SVG, from a list of ties.

Taisen (対戦, たいせん) is Japanese for a matchup: two sides facing each other. About the name

Contents

Reference · Where every tie sits

collectTeamsfunction

A bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not.

Import it

import { collectTeams } from "@johnmorrisdotca/taisen-brackets/layout";

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

function collectTeams(matchups: readonly Matchup[], given?: readonly Team[]): Map<SideId, Team>

Parameters

NameTypeDescription
matchupsreadonly Matchup[]

The matchups whose sides are to be found.

given (optional)readonly Team[]

The teams listed once, with names, marks and groups.

Returns

Map<SideId, Team>

A map from each side's id to its team.

Examples

import { collectTeams } from "@johnmorrisdotca/taisen-brackets";

const teams = collectTeams([{ sides: ["ARG", "FRA"], score: [3, 3] }], [{ id: "ARG", name: "Argentina" }]);
console.log(teams.get("ARG")?.name, teams.get("FRA")?.name);
Argentina FRA

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/taisen-brackets 0.20.0.