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

PlayedGametype

One played game, in the flat shape that most data sources give.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface PlayedGame {
    stage: string;
    home: SideId;
    away: SideId;
    homeScore: number;
    awayScore: number;
    date?: string;
    extraTime?: boolean;
    homePens?: number;
    awayPens?: number;
    replay?: boolean;
    no?: number;
}

Members

NameTypeDescription
stagestring

The stage it was played in: a key from stages, or the third one.

homeSideId
awaySideId
homeScorenumber
awayScorenumber
date (optional)string | undefined
extraTime (optional)boolean | undefined
homePens (optional)number | undefined
awayPens (optional)number | undefined
replay (optional)boolean | undefined

A replay of a drawn game.

no (optional)number | undefined

An order within the stage (a match number).

Examples

import { matchupsFromGames, type PlayedGame } from "@johnmorrisdotca/taisen-brackets";

const game: PlayedGame = { stage: "Final", home: "ARG", away: "FRA", homeScore: 3, awayScore: 3, extraTime: true, homePens: 4, awayPens: 2 };
console.log(matchupsFromGames([game], { stages: ["Final"] }).length);
1

What it prints (run when this page was built)

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