Reference · Draw a bracket, a table or a road to the final
BoutBoardOptionstype
What a bout board can be told: the name style and case, and the options of every broadcast board.
Import it
import type { BoutBoardOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface BoutBoardOptions extends BroadcastOptions, Pick<RankingOptions, "nameStyle"> {
nameCase?: "as-is" | "upper";
}
Members
| Name | Type | Description |
|---|---|---|
nameCase (optional) | "as-is" | "upper" | undefined |
|
width (optional) | number | undefined | The width of the board; the height follows from the rows. Default 1280, from 320 to 4000. |
look (optional) | BroadcastLook | undefined |
|
icon (optional) | BroadcastIcon | undefined | The icon in the square at the left of the title: |
iconMark (optional) | string | undefined | A mark of your own for that square (inline SVG or an image address), in place of |
flags (optional) | FlagRenderer | undefined | Draws a flag from its code, as for |
flagHref (optional) | ((code: string) => string | null | undefined) | undefined | The address of a flag as a picture to load, tried where |
locale (optional) | string | Locale | undefined | |
words (optional) | Partial<Words> | undefined | |
title (optional) | string | undefined | The |
id (optional) | string | undefined | |
className (optional) | string | undefined | |
nameStyle (optional) | "surname-first" | "given-first" | "as-is" | undefined |
|
Examples
import { boutBoard, type BoutBoardOptions } from "@johnmorrisdotca/taisen-brackets";
const options: BoutBoardOptions = { width: 960, look: "night", nameCase: "upper" };
console.log(boutBoard({
title: "Women's 57-60 kg",
phase: "Preliminaries",
bout: 142,
red: { code: "BRA", flag: "BR", name: "TAVARES M." },
blue: { code: "USA", flag: "US", name: "MAYER M." },
officials: [{ role: "referee", code: "MGL", flag: "MN", name: "KHISHIGEE Khas-Erdene" }, { code: "POL", flag: "PL", name: "GORNY Mariusz" }],
}, options).startsWith("<svg"));trueWhat it prints (run when this page was built)