本文へ移動

Taisen Brackets対戦

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

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

目次

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

Tie型

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

A tie as the layout knows it. index is the position of its matchup in the list given.

インポート

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

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

定義

interface Tie {
    index: number;
    id: string;
    round: number;
    sides: readonly [
        Team | null,
        Team | null
    ];
    winner: 0 | 1 | null;
    result: Result;
    date: string;
    no: number | null;
    third: boolean;
    walkover: boolean;
    note: string | null;
    seeds?: readonly [
        string | number | null,
        string | number | null
    ];
    from?: readonly [
        Source | null,
        Source | null
    ];
    playIn?: boolean;
    stage?: "play-in" | "repechage" | "bronze";
    judo?: JudoOutcome;
    home?: 0 | 1;
}

メンバー

名前型説明
indexnumber
idstring
roundnumber

The round (1 for the first round of the tree); the final round for a third-place match; 0 for a round-robin game.

sidesreadonly [Team | null, Team | null]

The two sides; null where not known yet.

winner0 | 1 | null

0 or 1: the side that went through, or null.

resultResult
datestring
nonumber | null
thirdboolean
walkoverboolean
notestring | null
seeds (省略可)readonly [string | number | null, string | number | null] | undefined

The seed tags given for the tie's sides (Matchup.seeds).

from (省略可)readonly [Source | null, Source | null] | undefined

Where each side comes from, when the matchup's feeds name it: another tie's winner or its loser. Left out for a tie that says nothing of the kind.

playIn (省略可)boolean | undefined

The tie is a play-in game, a judo repechage contest or a bronze medal contest (Matchup.stage).

stage (省略可)"play-in" | "repechage" | "bronze" | undefined

The tie's Matchup.stage, when it has one.

judo (省略可)JudoOutcome | undefined

A judo contest's result, checked and worked out (Matchup.judo).

home (省略可)0 | 1 | undefined

The side at home (Matchup.home), when given.

例

import { layoutBracket, type Tie } from "@johnmorrisdotca/taisen-brackets";

const tie: Tie = layoutBracket([{ sides: ["Aurora", "Harbour"], score: [2, 1] }]).ties[0];
console.log(tie.sides.map((side) => side?.name), tie.winner);
[ 'Aurora', 'Harbour' ] 0

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

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

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