本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · 決勝までの道

RoadMatch型

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

One match on a finalist's way.

インポート

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

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

定義

interface RoadMatch {
    round: string;
    opponent: RoadTeam;
    score: RoadScore;
    decidedBy?: RoadDecided;
    pens?: readonly [
        number | string,
        number | string
    ];
    homeFirst?: boolean;
    note?: string;
}

メンバー

名前型説明
roundstring

The round, as a key. round-of-32, round-of-16, quarter-final and semi-final have words in every language; any other key is written as it is, or as options.labels names it.

opponentRoadTeam

The team it played: its name, abbreviation, mark or flag, and color.

scoreRoadScore

The score, the finalist's first: [2, 1] is a 2-1 win.

decidedBy (省略可)RoadDecided | undefined

How it was decided: ft by default, or pens when pens is given. Written under the score: FT, AET, or the shoot-out.

pens (省略可)readonly [string | number, string | number] | undefined

The shoot-out, the finalist's first: [4, 3].

homeFirst (省略可)boolean | undefined

The order of the pair, left to right: true the finalist first, false its opponent first. By default the finalist is at the outer edge of its side, so that the two paths mirror each other.

note (省略可)string | undefined

Words to write under the score in place of FT, AET or the shoot-out (Game 6, in 7). An empty text writes nothing.

例

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

const semi: RoadMatch = { round: "semi-final", opponent: { name: "Valley Stars", abbr: "VAL" }, score: [1, 1], decidedBy: "pens", pens: [4, 3] };
console.log(semi.round, semi.decidedBy);
semi-final pens

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

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

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