本文へ移動

Taisen Brackets対戦

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

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

目次

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

MedalTableSource型

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

A medal table to draw: the title, the sport or event, the date, the source and the rows.

インポート

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

定義

interface MedalTableSource {
    title?: string;
    subtitle?: string;
    date?: string;
    source?: string;
    rows: readonly MedalRow[];
}

メンバー

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

The heading. Default: the language's "Medal table".

subtitle (省略可)string | undefined

The sport, event or Games as a pill under the heading ("Men's judo +100 kg").

date (省略可)string | undefined

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

source (省略可)string | undefined

Where the numbers come from, small at the foot.

rowsreadonly MedalRow[]

例

import { medalTable, type MedalTableSource } from "@johnmorrisdotca/taisen-brackets";

const source: MedalTableSource = { subtitle: "Men's judo +100 kg", rows: [
  { name: "France", flag: "FR", gold: 6, silver: 1, bronze: 3 },
  { name: "Japan", flag: "JP", gold: 5, silver: 3, bronze: 2 },
] };
console.log(medalTable(source).includes("France"));
true

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

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

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