Reference · Draw a bracket, a table or a road to the final
MatchupOptionstype
What a matchup board can be told: how many meetings are listed, the name and rank style, the precision, and the options of every board.
Import it
import type { MatchupOptions } from "@johnmorrisdotca/taisen-brackets";
Definition
interface MatchupOptions extends BoardOptions, Pick<RankingOptions, "nameStyle" | "precision" | "rankStyle"> {
rows?: number;
}
Members
| Name | Type | Description |
|---|---|---|
rows (optional) | number | undefined | The most meetings drawn. Default: as many as fit at a readable size. The rest are counted ("+2 more"); the record counts them all. |
size (optional) | BoardSizeName | { width: number; height: number; } | undefined | One of |
theme (optional) | "auto" | "light" | "dark" | undefined |
|
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 |
flagShape (optional) | "round" | "square" | undefined |
|
locale (optional) | string | Locale | undefined | The language: |
words (optional) | Partial<Words> | undefined | |
title (optional) | string | undefined | The |
id (optional) | string | undefined | Prefix for the drawing's ids. Default: a hash of the state and the options. |
className (optional) | string | undefined | |
nameStyle (optional) | "surname-first" | "given-first" | "as-is" | undefined |
|
precision (optional) | number | undefined | Decimals for numeric points ( |
rankStyle (optional) | "plain" | "hash" | undefined |
|
Examples
import { rankingMatchup, type MatchupOptions } from "@johnmorrisdotca/taisen-brackets";
const options: MatchupOptions = { size: "square", rows: 3, precision: 2 };
console.log(rankingMatchup({ a: { name: "Nakamura", rank: 1 }, b: { name: "Brar", rank: 2 } }, options).startsWith("<svg"));trueWhat it prints (run when this page was built)