本文へ移動

Taisen Brackets対戦

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

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

目次

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

MatchupSource型

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

A matchup to draw: the two athletes with their ranks and points, and their earlier meetings.

インポート

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

定義

interface MatchupSource {
    title?: string;
    category?: string;
    date?: string;
    source?: string;
    a: RankingEntry;
    b: RankingEntry;
    meetings?: readonly RankingMeeting[];
}

メンバー

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

The heading. Default: the language's "Head to head".

category (省略可)string | undefined

The category as a pill under the heading ("U18 · Men -60 kg").

date (省略可)string | undefined

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

source (省略可)string | undefined

Where the data comes from, small at the foot.

aRankingEntry

The two athletes: an entry's rank is its ranking and points its points.

bRankingEntry
meetings (省略可)readonly RankingMeeting[] | undefined

The previous meetings, in the order they are to be written (the latest first, as a broadcast does).

例

import { rankingMatchup, type MatchupSource } from "@johnmorrisdotca/taisen-brackets";

const source: MatchupSource = {
  category: "U18 · Men -60 kg",
  a: { name: { surname: "Nakamura", given: "Kenji" }, rank: 1, points: 412.5 },
  b: { name: { surname: "Brar", given: "Harpreet" }, rank: 2, points: 398 },
  meetings: [
  { date: "2026-09-13", event: "Fall Open", round: "Semi-final", winner: 0, result: "ippon · 2:11" },
  { date: "2026-05-17", event: "Spring Classic", round: "Final", winner: 1, result: "waza-ari · golden score" },
],
};
console.log(rankingMatchup(source).includes("PREVIOUS MEETINGS"));
true

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

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

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