本文へ移動

Taisen Brackets対戦

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

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

目次

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

RankingSource型

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

A ranking to draw: the title, the category, the date, the source and the entries.

インポート

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

定義

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

メンバー

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

The heading. Default: the language's word for ranking.

category (省略可)string | undefined

The category as a line under the heading ("U18 · Men -60 kg"; rankingCategoryLabel writes one).

date (省略可)string | undefined

The date or period of the list, at the right of the heading ("October 2026").

source (省略可)string | undefined

Where the list comes from, small at the foot ("Source: BC Judo").

entriesreadonly RankingEntry[]

例

import { rankingList, type RankingSource } from "@johnmorrisdotca/taisen-brackets";

const source: RankingSource = { category: "U18 · Men -60 kg", date: "October 2026", entries: [
  { name: { surname: "Nakamura", given: "Kenji" }, club: "Coastal Pine Judo", flag: "CA-BC", points: 412.5, change: 1 },
  { name: { surname: "Brar", given: "Harpreet" }, club: "Salmonberry Judo Club", flag: "CA-BC", points: 398, change: -1 },
  { name: { surname: "Leclerc", given: "Mathieu" }, club: "Kestrel Valley Judo", flag: "CA-QC", points: 366.25, change: 4 },
] };
console.log(rankingList(source).includes("U18 · Men -60 kg"));
true

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

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

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