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

Gametype

One game of a tie: a match of a knockout, a game of a series, a leg of an aggregate, a replay.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface Game {
    score: readonly [
        number,
        number
    ];
    date?: string;
    extraTime?: boolean;
    pens?: readonly [
        number,
        number
    ];
    replay?: boolean;
    note?: string;
}

Members

NameTypeDescription
scorereadonly [number, number]

The score, in the order of the tie's sides.

date (optional)string | undefined
extraTime (optional)boolean | undefined

The game went to extra time (a.e.t.).

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

The penalty shoot-out's score, in the order of the tie's sides.

replay (optional)boolean | undefined

This game replays a drawn one (the World Cup of 1934 and 1938).

note (optional)string | undefined

Examples

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

const first: Game = { score: [2, 1], date: "2026-06-01" };
const svg = drawBracket([{ sides: ["Aurora", "Harbour"], kind: "series", bestOf: 3, games: [first, { score: [0, 1] }, { score: [1, 0] }] }]);
console.log(svg.startsWith("<svg"));
true

What it prints (run when this page was built)

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