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 · Draw a bracket, a table or a road to the final

JudoWinsOptionstype

What judoWins can be told: the language, the round names, how to make an athlete of a team, and whether byes are listed.

Import it

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

Definition

interface JudoWinsOptions {
    locale?: DrawOptions["locale"];
    words?: DrawOptions["words"];
    roundNames?: DrawOptions["roundNames"];
    athlete?: (team: Team) => JudoAthlete;
    byes?: boolean;
}

Members

NameTypeDescription
locale (optional)string | Locale | undefined
words (optional)Partial<Words> | undefined
roundNames (optional)readonly string[] | { rounds: readonly { name: string; }[]; } | undefined

The names of the rounds, as for drawBracket.

athlete (optional)((team: Team) => JudoAthlete) | undefined

Turns a bracket's team into the athlete the panel draws. Default: its name, flag, mark and code.

byes (optional)boolean | undefined

Write a bye for each round the athlete skipped before their first contest. Default true.

Examples

import { judoWins, type JudoWinsOptions } from "@johnmorrisdotca/taisen-brackets";

const options: JudoWinsOptions = { locale: "fr", byes: false };
console.log(judoWins([
  { id: "a", round: 1, sides: ["Haru", "Marc"], judo: { sides: [{ ippon: true }, {}], time: "1:12" } },
  { id: "f", round: 2, sides: ["Haru", "Levan"], judo: { sides: [{ wazaAri: 1 }, { yuko: 1 }], goldenScore: true, time: "5:40" } },
], "Haru", options).length);
2

What it prints (run when this page was built)

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