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

BracketInputtype

A bracket's input with its teams listed once: { matchups, teams }.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface BracketInput {
    matchups: readonly Matchup[];
    teams?: readonly Team[];
}

Members

NameTypeDescription
matchupsreadonly Matchup[]
teams (optional)readonly Team[] | undefined

The teams: names, marks, groups. A side named by an id that is not here is a team of that name.

Examples

import { drawBracket, type BracketInput } from "@johnmorrisdotca/taisen-brackets";

const input: BracketInput = {
  teams: [{ id: "A", name: "Aurora" }, { id: "H", name: "Harbour" }],
  matchups: [{ sides: ["A", "H"], score: [2, 1] }],
};
console.log(drawBracket(input).includes("Aurora"));
true

What it prints (run when this page was built)

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