本文へ移動

Taisen Brackets対戦

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

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

目次

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

JudoRoadOptions型

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

What a road panel can be told: the weight class, the side's colour, the order of the wins, how many rows, the size, the theme and the language.

インポート

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

定義

interface JudoRoadOptions extends Omit<JudoBoardOptions, "style" | "swap" | "coaches"> {
    weight?: string;
    side?: "white" | "blue";
    order?: "latest" | "first";
    rows?: number;
    coach?: boolean;
}

メンバー

名前型説明
weight (省略可)string | undefined

The weight class as a heading (judoCategoryLabel), written at the right of the header.

side (省略可)"white" | "blue" | undefined

The colour of the athlete's block: the white judogi's or the blue's. Default blue.

order (省略可)"latest" | "first" | undefined

latest (the default) puts the most recent win first, as a broadcast does; first the oldest.

rows (省略可)number | undefined

The most wins drawn. Default: as many as fit at a readable size, up to 8.

coach (省略可)boolean | undefined

Write the coach under the code. Default true.

title (省略可)string | undefined

The <title> of the drawing. Default the language's "Judo contest scoreboard".

locale (省略可)string | Locale | undefined

The language: en, fr, ja, es, de or a Locale.

words (省略可)Partial<Words> | undefined
flags (省略可)FlagRenderer | undefined

Draws a country's flag from its code, as for drawBracket: a synchronous function from a code and { shape, size, theme } to an SVG string, such as one made from @johnmorrisdotca/hata.

flagHref (省略可)((code: string) => string | null | undefined) | undefined

The address of a flag as a picture to load, tried where flags gives none.

theme (省略可)"auto" | "light" | "dark" | undefined

auto follows the page's light or dark; the athletes' panels are the colours of the judogi either way. Default auto.

id (省略可)string | undefined

Prefix for the drawing's ids. Default: a hash of the state and the options.

className (省略可)string | undefined
size (省略可)JudoBoardSizeName | { width: number; height: number; } | undefined

tv (the default), tablet, tablet-tall, or a size of your own: a wider-than-tall one lays the sides out left and right, a taller one top and bottom.

例

import { judoRoadPanel, type JudoRoadOptions } from "@johnmorrisdotca/taisen-brackets";

const options: JudoRoadOptions = { weight: "Men -66 kg", side: "blue", order: "first", rows: 4 };
console.log(judoRoadPanel({ athlete: { name: "Haru" }, wins: [] }, options).startsWith("<svg"));
true

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

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

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