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

Sourcetype

Where a side of a tie comes from: the winner or the loser of the tie at tie (its index).

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

interface Source {
    tie: number;
    result: "winner" | "loser";
}

Members

NameTypeDescription
tienumber
result"winner" | "loser"

Examples

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

const layout = layoutBracket([
  { id: "sf1", sides: ["A", "B"], score: [1, 0] },
  { id: "sf2", sides: ["C", "D"], score: [0, 2] },
  { id: "final", sides: ["A", "D"], score: [2, 1] },
  { id: "bronze", sides: [null, null], feeds: [{ tie: "sf1", result: "loser" }, { tie: "sf2", result: "loser" }], third: true },
]);
const source: Source | null | undefined = layout.ties[3].from?.[0];
console.log(source);
{ tie: 0, result: 'loser' }

What it prints (run when this page was built)

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