本文へ移動

Taisen Brackets対戦

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

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

目次

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

RankingEntry型

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

One line of a ranking. Only name is needed.

インポート

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

定義

interface RankingEntry {
    name: string | RankingName;
    rank?: number;
    points?: number | string;
    club?: string;
    country?: string;
    code?: string;
    flag?: string;
    mark?: string;
    category?: string;
    change?: number | "new";
    champion?: boolean | "interim";
}

メンバー

名前型説明
namestring | RankingName

The name as it is to be written, or its two parts (set by nameStyle).

rank (省略可)number | undefined

The rank. Left out, the position in the list, with equal points sharing a rank (ties). A champion has none.

points (省略可)string | number | undefined

A number (shown to precision decimals) or text (shown as it is).

club (省略可)string | undefined
country (省略可)string | undefined

The country's or region's name, written under the name in a podium row.

code (省略可)string | undefined

The country's three letters (CAN), written in the compact rows.

flag (省略可)string | undefined

A code for the flags renderer: a country (JP) or a Canadian province or territory (CA-BC).

mark (省略可)string | undefined

A mark of your own (an image address or inline SVG) in place of a flag: a club's emblem.

category (省略可)string | undefined

This athlete's category ("U18 · -60 kg"), written in the second line when categories is on: for a list that mixes categories.

change (省略可)number | "new" | undefined

The movement since the last list: whole places up (positive) or down (negative), 0 for none, "new" for newly ranked ("NR").

champion (省略可)boolean | "interim" | undefined

The champion of the division: a row marked "C" above the ranks ("interim" for an interim champion).

例

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

const entry: RankingEntry = { name: { surname: "Brar", given: "Harpreet" }, club: "Salmonberry Judo Club", flag: "CA-BC", points: 398, change: -1 };
console.log(rankingList({ entries: [entry] }).includes("BRAR Harpreet"));
true

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

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

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