Reference · Draw a bracket, a table or a road to the final
judoMatQueuefunction
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 it
import { judoMatQueue } from "@johnmorrisdotca/taisen-brackets";
Definition
function judoMatQueue(input: JudoMat | readonly JudoMat[], options?: JudoQueueOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
input | JudoMat | readonly JudoMat[] | One mat or a list of mats. |
options (optional) | JudoQueueOptions | The size, the theme, how many rows, the mat colours, the flags and the language. |
Returns
string
The SVG, a string that begins with <svg.
Examples
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 trueWhat it prints (run when this page was built)