Reference · The road to the final
RoadOptionstype
What roadToFinal takes besides the finalists or the tournament.
Import it
import type { RoadOptions } from "@johnmorrisdotca/taisen-brackets/road";
Also exported from: @johnmorrisdotca/taisen-brackets
Definition
interface RoadOptions extends Pick<DrawOptions, "locale" | "words" | "teamName" | "roundNames" | "markShape" | "flags" | "flagHref" | "theme" | "background" | "id" | "className"> {
team?: SideId;
title?: string;
subtitle?: string;
final?: RoadFinal;
labels?: Readonly<Record<string, string>>;
groupLabel?: string;
size?: RoadSize;
winner?: "auto" | "none";
codes?: boolean;
endnote?: string;
}
Members
| Name | Type | Description |
|---|---|---|
team (optional) | SideId | undefined | With a tournament: the finalist whose road is on the left (by team id); the other finalist is its opponent in the final. Left out, the first side of the final. |
title (optional) | string | undefined | The tournament, set large at the top. The language's "Road to the final" when missing. |
subtitle (optional) | string | undefined | The line under it. "Road to the final" when a |
final (optional) | RoadFinal | undefined | The final, if it has been played: its score is written between the two big marks, the winner is brighter, and the table has a row for it. A tournament's own final is used when this is left out. |
labels (optional) | Readonly<Record<string, string>> | undefined | The names of the rounds, by key, over the language's own words: |
groupLabel (optional) | string | undefined | The group stage's name, over the language's own. |
size (optional) | SizeName | undefined |
|
winner (optional) | "auto" | "none" | undefined | Who is brighter: |
codes (optional) | boolean | undefined | Write the opponent's three-letter code under its mark. On by default. |
endnote (optional) | string | undefined | A line at the foot: a source, a credit, "Made-up results". |
roundNames (optional) | readonly string[] | { rounds: readonly { name: string; }[]; } | undefined | Names of the rounds, first round first (or just the last ones). Default: Final, Semi-finals, Quarter-finals, Round of 16… |
locale (optional) | string | Locale | undefined | The language: |
words (optional) | Partial<Words> | undefined | Replace any of the language's words. |
teamName (optional) | ((team: Team, locale: Locale) => string | undefined) | undefined | The name to draw for a team in this language: |
markShape (optional) | "round" | "none" | "square" | undefined |
|
flags (optional) | FlagRenderer | undefined | Draws the flag a team's |
flagHref (optional) | ((code: string) => string | null | undefined) | undefined | The address of the flag a team's |
theme (optional) | ThemeName | undefined |
|
background (optional) | boolean | "midnight" | "crimson" | "royal" | "emerald" | "pitch" | "ice" | "hardwood" | "infield" | "turf" | "ball-panels" | "swirl" | "waves" | "glow" | "floodlights" | "confetti" | "carbon" | "aurora" | "sunburst" | "chevrons" | "halftone" | "argyle" | "contour" | "stardust" | "mesh" | "spotlight" | BackgroundOptions | BackgroundImageOptions | undefined | The background. |
id (optional) | string | undefined | Prefix for the drawing's ids. Default: a hash of the bracket and the options. Only letters, digits, |
className (optional) | string | undefined | Extra class names for the root |
Examples
import { roadToFinal, type RoadOptions } from "@johnmorrisdotca/taisen-brackets";
const options: RoadOptions = { title: "Northern Cup 2030", size: "square", codes: true };
console.log(roadToFinal([{ name: "Owls", abbr: "NOW", path: [] }, { name: "Gulls", abbr: "HCG", path: [] }], options).title);Owls and Gulls: Northern Cup 2030, Road to the finalWhat it prints (run when this page was built)