本文へ移動

Taisen Brackets対戦

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

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

目次

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

RoadRecord型

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

One finalist's record on the way.

インポート

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

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

定義

interface RoadRecord {
    name: string;
    matches: number;
    won: number;
    drawn: number;
    lost: number;
    scored: number;
    conceded: number;
}

メンバー

名前型説明
namestring
matchesnumber

Matches played in the group and the knockout rounds (not the final), and how many it won, drew and lost.

wonnumber
drawnnumber
lostnumber
scorednumber

The goals it scored and let in over the matches whose score is a pair of numbers.

concedednumber

例

import { roadToFinal, type RoadRecord } from "@johnmorrisdotca/taisen-brackets";

const chart = roadToFinal([{ name: "Owls", path: [{ round: "semi-final", opponent: { name: "Stars" }, score: [2, 0] }] }, { name: "Gulls", path: [] }]);
const owls: RoadRecord = chart.totals.finalists[0];
console.log(owls.matches, owls.won, owls.scored);
1 1 2

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

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

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