本文へ移動

Taisen Brackets対戦

対戦の一覧から、トーナメント表をSVGで描きます。

対戦(たいせん)は、二者が向かい合って勝負することです。 名前について(英語)

目次

リファレンス · トーナメント表・表・決勝までの道を描く

JudoWinsOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

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

メンバー

名前型説明
locale (省略可)string | Locale | undefined
words (省略可)Partial<Words> | undefined
roundNames (省略可)readonly string[] | { rounds: readonly { name: string; }[]; } | undefined

The names of the rounds, as for drawBracket.

athlete (省略可)((team: Team) => JudoAthlete) | undefined

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

byes (省略可)boolean | undefined

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

例

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/taisen-brackets 0.20.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。