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

roundLabelfunction

The name of round round (1 is the first) of a layout, from the names given (which may be only the last rounds) or the generic ones.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

function roundLabel(layout: BracketLayout, round: number, names: DrawOptions["roundNames"], v: Voice): string

Parameters

NameTypeDescription
layoutBracketLayout

The bracket's layout.

roundnumber

The round, counting from 1 at the first round.

namesreadonly string[] | { rounds: readonly { name: string; }[]; } | undefined

The roundNames option of the drawing, or undefined.

vVoice

The voice of a language, from voiceOf.

Returns

string

The label to write.

Examples

import { layoutBracket, roundLabel, voiceOf } from "@johnmorrisdotca/taisen-brackets";

const layout = layoutBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }, { sides: ["Cascade", "Delta"], score: [0, 1] }, { sides: ["Aurora", "Delta"], score: [3, 1] }]);
console.log(roundLabel(layout, 1, undefined, voiceOf({ locale: "fr" })));
Demi-finales

What it prints (run when this page was built)

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