Reference · Draw a bracket, a table or a road to the final
ResultsBoardOptionstype
What a results board can be told: the width, the look, the icon, the rank style, the name style and case, and the language.
Import it
import type { ResultsBoardOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface ResultsBoardOptions extends BroadcastOptions, Pick<RankingOptions, "nameStyle"> {
rankStyle?: "box" | "medal" | "plain";
precision?: number;
ties?: boolean;
nameCase?: "as-is" | "upper";
}
Members
| Name | Type | Description |
|---|---|---|
rankStyle (optional) | "plain" | "box" | "medal" | undefined |
|
precision (optional) | number | undefined | Decimals for numeric values where a column names none ( |
ties (optional) | boolean | undefined | Equal results share a rank ( |
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 { resultsBoard, type ResultsBoardOptions } from "@johnmorrisdotca/taisen-brackets";
const options: ResultsBoardOptions = { width: 960, look: "night", rankStyle: "medal", nameCase: "upper" };
console.log(resultsBoard({
title: "Men's 100m butterfly",
phase: "Results · Final",
columns: [{ precision: 2 }],
rows: [
{ code: "USA", flag: "US", name: "Michael Phillips", values: [50.58], record: "OR" },
{ code: "HUN", flag: "HU", name: "Laszlo Czigany", values: [50.59] },
],
}, options).startsWith("<svg"));trueWhat it prints (run when this page was built)