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

Resulttype

What a tie came to, worked out from its games.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface Result {
    kind: MatchupKind;
    score: readonly [
        number,
        number
    ] | null;
    played: number;
    bestOf: number | null;
    pens: readonly [
        number,
        number
    ] | null;
    extraTime: boolean;
    replays: number;
    games: readonly (readonly [
        number,
        number
    ])[];
    decided: boolean;
}

Members

NameTypeDescription
kindMatchupKind
scorereadonly [number, number] | null

The number drawn for each side: goals in a game, games won in a series, the total of an aggregate. null when nothing was played.

playednumber

The games played.

bestOfnumber | null
pensreadonly [number, number] | null
extraTimeboolean
replaysnumber

Replays played.

gamesreadonly (readonly [number, number])[]

The scores of the games, for a series or an aggregate, in the order of sides.

decidedboolean

Whether one side has gone through.

Examples

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

const result: Result = layoutBracket([{ sides: ["ARG", "FRA"], score: [3, 3], pens: [4, 2] }]).ties[0].result;
console.log(result.score, result.pens, result.decided);
[ 3, 3 ] [ 4, 2 ] true

What it prints (run when this page was built)

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