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

Tietype

A tie as the layout knows it. index is the position of its matchup in the list given.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface Tie {
    index: number;
    id: string;
    round: number;
    sides: readonly [
        Team | null,
        Team | null
    ];
    winner: 0 | 1 | null;
    result: Result;
    date: string;
    no: number | null;
    third: boolean;
    walkover: boolean;
    note: string | null;
    seeds?: readonly [
        string | number | null,
        string | number | null
    ];
    from?: readonly [
        Source | null,
        Source | null
    ];
    playIn?: boolean;
    stage?: "play-in" | "repechage" | "bronze";
    judo?: JudoOutcome;
    home?: 0 | 1;
}

Members

NameTypeDescription
indexnumber
idstring
roundnumber

The round (1 for the first round of the tree); the final round for a third-place match; 0 for a round-robin game.

sidesreadonly [Team | null, Team | null]

The two sides; null where not known yet.

winner0 | 1 | null

0 or 1: the side that went through, or null.

resultResult
datestring
nonumber | null
thirdboolean
walkoverboolean
notestring | null
seeds (optional)readonly [string | number | null, string | number | null] | undefined

The seed tags given for the tie's sides (Matchup.seeds).

from (optional)readonly [Source | null, Source | null] | undefined

Where each side comes from, when the matchup's feeds name it: another tie's winner or its loser. Left out for a tie that says nothing of the kind.

playIn (optional)boolean | undefined

The tie is a play-in game, a judo repechage contest or a bronze medal contest (Matchup.stage).

stage (optional)"play-in" | "repechage" | "bronze" | undefined

The tie's Matchup.stage, when it has one.

judo (optional)JudoOutcome | undefined

A judo contest's result, checked and worked out (Matchup.judo).

home (optional)0 | 1 | undefined

The side at home (Matchup.home), when given.

Examples

import { layoutBracket, type Tie } from "@johnmorrisdotca/taisen-brackets";

const tie: Tie = layoutBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }]).ties[0];
console.log(tie.sides.map((side) => side?.name), tie.winner);
[ 'Aurora', 'Harbour' ] 0

What it prints (run when this page was built)

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