本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · 各対戦の位置を計算

GamesOptions型

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

How the games of a flat list are grouped into ties: the stages in order, which one is the third-place match, which are two legs, and how long each series is.

インポート

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

ほかのエクスポート元: @johnmorrisdotca/taisen-brackets

定義

interface GamesOptions {
    stages: readonly string[];
    third?: string;
    aggregate?: readonly string[];
    series?: Readonly<Record<string, number>>;
}

メンバー

名前型説明
stagesreadonly string[]

The knockout stages in order, first round first: ["round-of-16", "quarter-final", "semi-final", "final"].

third (省略可)string | undefined

The stage of the third-place match, if the data has one.

aggregate (省略可)readonly string[] | undefined

Stages played in two legs, added up. Several games of one pair in any other stage are a replay.

series (省略可)Readonly<Record<string, number>> | undefined

Stages played as a series, with their length: { final: 7 }.

例

import { matchupsFromGames, type GamesOptions } from "@johnmorrisdotca/taisen-brackets";

const options: GamesOptions = { stages: ["Semi-final", "Final"], third: "Third place" };
console.log(options.stages.length);
2

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

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

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