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 · The road to the final

RoadMatchtype

One match on a finalist's way.

Import it

import type { RoadMatch } from "@johnmorrisdotca/taisen-brackets/road";

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface RoadMatch {
    round: string;
    opponent: RoadTeam;
    score: RoadScore;
    decidedBy?: RoadDecided;
    pens?: readonly [
        number | string,
        number | string
    ];
    homeFirst?: boolean;
    note?: string;
}

Members

NameTypeDescription
roundstring

The round, as a key. round-of-32, round-of-16, quarter-final and semi-final have words in every language; any other key is written as it is, or as options.labels names it.

opponentRoadTeam

The team it played: its name, abbreviation, mark or flag, and color.

scoreRoadScore

The score, the finalist's first: [2, 1] is a 2-1 win.

decidedBy (optional)RoadDecided | undefined

How it was decided: ft by default, or pens when pens is given. Written under the score: FT, AET, or the shoot-out.

pens (optional)readonly [string | number, string | number] | undefined

The shoot-out, the finalist's first: [4, 3].

homeFirst (optional)boolean | undefined

The order of the pair, left to right: true the finalist first, false its opponent first. By default the finalist is at the outer edge of its side, so that the two paths mirror each other.

note (optional)string | undefined

Words to write under the score in place of FT, AET or the shoot-out (Game 6, in 7). An empty text writes nothing.

Examples

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

const semi: RoadMatch = { round: "semi-final", opponent: { name: "Valley Stars", abbr: "VAL" }, score: [1, 1], decidedBy: "pens", pens: [4, 3] };
console.log(semi.round, semi.decidedBy);
semi-final pens

What it prints (run when this page was built)

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