本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス · トーナメント表・表・決勝までの道を描く

judoMatQueue関数

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

The mat queue board: for each mat a big number in the mat's colour and the contests to come, in order, each a row with the contest number, the white athlete and the blue one (name, code, flag). The mats are in columns on a wide board and stacked on an upright one. A mat with more contests than fit is cut at rows. Throws a RangeError for no mat, a mat with no number, a contest with no number or no athlete name, a colour that is not a hex code, or a bad size or theme.

インポート

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

定義

function judoMatQueue(input: JudoMat | readonly JudoMat[], options?: JudoQueueOptions): string

引数

名前型説明
inputJudoMat | readonly JudoMat[]

One mat or a list of mats.

options (省略可)JudoQueueOptions

The size, the theme, how many rows, the mat colours, the flags and the language.

戻り値

string

The SVG, a string that begins with <svg.

例

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

const svg = judoMatQueue([
  { mat: 1, contests: [{ number: "G-1", white: { name: "Daiki Hoshino", code: "JPN" }, blue: { name: "Mathis Roussel", code: "FRA" } }] },
  { mat: 2, color: "#0b6fb8", contests: [{ number: "G-2", white: { name: "Levan M.", code: "GEO" }, blue: { name: "Min-jae Seong", code: "KOR" } }] },
], { size: "tv", theme: "dark" });
console.log(svg.includes("G-2"), svg.includes("#0b6fb8"));
true true

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

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

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