本文へ移動

Taisen Brackets対戦

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

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

目次

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

MedalRow型

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

One row of a medal table: a country or a team and its medals. Only name is needed.

インポート

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

定義

interface MedalRow {
    name: string;
    flag?: string;
    mark?: string;
    code?: string;
    gold?: number;
    silver?: number;
    bronze?: number;
    note?: string;
}

メンバー

名前型説明
namestring

The country's or team's name as it is to be written ("France", "Soviet Union", "Unified Team").

flag (省略可)string | undefined

A code for the flags function (FR, CA-BC); a country that has no flag in it (a former one, a team) is drawn as a badge with code or the initials.

mark (省略可)string | undefined

A mark of your own (an image address or inline SVG) in place of a flag.

code (省略可)string | undefined

The country's three letters, for the badge of a row with no flag.

gold (省略可)number | undefined
silver (省略可)number | undefined
bronze (省略可)number | undefined
note (省略可)string | undefined

A small line under the name: the years a former country existed ("1922–1991"), or what a team is.

例

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

const row: MedalRow = { name: "Soviet Union", code: "URS", note: "1922–1991", gold: 1, bronze: 4 };
console.log(medalTable({ rows: [row] }).includes("1922–1991"));
true

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

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

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