Reference · Draw a bracket, a table or a road to the final
rankingMatchupfunction
The head-to-head card for two athletes and their meetings. Throws a RangeError for an athlete with no name, a ranking that is not a whole number from 1, a meeting whose winner is not
0, 1 or null, rows that is not a whole number from 1 to 50, or a bad size or theme.
Import it
import { rankingMatchup } from "@johnmorrisdotca/taisen-brackets";
Definition
function rankingMatchup(source: MatchupSource, options?: MatchupOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
source | MatchupSource | The matchup. |
options (optional) | MatchupOptions | The rows, the size, the theme, the precision and the language. |
Returns
string
The SVG, a string that begins with <svg.
Examples
import { matchupRecord, rankingMatchup, type RankingMeeting } from "@johnmorrisdotca/taisen-brackets";
const meetings: RankingMeeting[] = [
{ date: "2026-09-13", event: "Fall Open", round: "Semi-final", winner: 0, result: "ippon · 2:11" },
{ date: "2026-05-17", event: "Spring Classic", round: "Final", winner: 1, result: "waza-ari · golden score" },
];
const svg = rankingMatchup({
category: "U18 · Men -60 kg",
a: { name: { surname: "Nakamura", given: "Kenji" }, rank: 1, points: 412.5 },
b: { name: { surname: "Brar", given: "Harpreet" }, rank: 2, points: 398 },
meetings,
}, { precision: 2, size: "square" });
console.log(matchupRecord(meetings).join("–"), svg.includes("PREVIOUS MEETINGS"));1–1 trueWhat it prints (run when this page was built)