Reference · Draw a bracket, a table or a road to the final
ResultsBoardSourcetype
A results board to draw: the title, the phase, the columns and the rows.
Import it
import type { ResultsBoardSource } from "@johnmorrisdotca/taisen-brackets";
Definition
interface ResultsBoardSource {
title: string;
phase?: string;
columns?: readonly ResultsColumn[];
rows: readonly ResultsRow[];
}
Members
| Name | Type | Description |
|---|---|---|
title | string | The event, in capitals in the title band ("Women's apparatus final"). |
phase (optional) | string | undefined | The phase in the sub bar ("Result", "Final", "Preliminaries"). Default: the language's "Result". |
columns (optional) | readonly ResultsColumn[] | undefined | The score columns, left to right. Default: one column per value of the longest row, with no heading. |
rows | readonly ResultsRow[] |
Examples
import { resultsBoard, type ResultsBoardSource } from "@johnmorrisdotca/taisen-brackets";
const source: ResultsBoardSource = {
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] },
],
};
console.log(resultsBoard(source).includes("50.58"));trueWhat it prints (run when this page was built)