本文へ移動

Taisen Brackets対戦

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

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

目次

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

EntryListSource型

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

An entry list to draw: a title, a category, a date and the athletes entered, with their rank if they have one.

インポート

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

定義

interface EntryListSource {
    title?: string;
    category?: string;
    date?: string;
    source?: string;
    entries: readonly RankingEntry[];
}

メンバー

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

The heading. Default: the language's "Entry list".

category (省略可)string | undefined

The category as a pill under the heading.

date (省略可)string | undefined

The event or the date, at the right of the heading.

source (省略可)string | undefined

Where the list comes from, small at the foot.

entriesreadonly RankingEntry[]

The athletes in the order of the draw. An entry's rank is its ranking (none: not ranked, written NR); points are optional.

例

import { rankingEntryList, type EntryListSource } from "@johnmorrisdotca/taisen-brackets";

const source: EntryListSource = { category: "Men -66 kg", entries: [{ name: { surname: "Hoshino", given: "Daiki" }, code: "JPN", rank: 3 }] };
console.log(rankingEntryList(source).includes("HOSHINO Daiki"));
true

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

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

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