本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · リーグごとの形式

LEAGUE_EMBLEMS定数

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

The emblem each league's champion gets by default: an id of @johnmorrisdotca/dougu-sports (generic forms, no league's own mark). Pass it as trophy together with an emblems renderer; with no renderer it draws nothing. A cup for MLS because the MLS Cup is one.

インポート

import { LEAGUE_EMBLEMS } from "@johnmorrisdotca/taisen-brackets/presets";

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

定義

const LEAGUE_EMBLEMS: Readonly<Record<League, string>> = Object.freeze({
    nhl: "trophy:hockey-cup",
    nba: "trophy:basketball",
    mlb: "trophy:baseball",
    nfl: "trophy:football",
    cfl: "trophy:canadian-bowl",
    mls: "trophy:cup",
    worldcup: "trophy:soccer-globe",
})

例

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

console.log(LEAGUE_EMBLEMS.nhl);
trophy:hockey-cup

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

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

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