Skip to the content

Taisen Brackets対戦

Knockout brackets as SVG, from a list of ties.

Taisen (対戦, たいせん) is Japanese for a matchup: two sides facing each other. About the name

Contents

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

NameTypeDescription
sourceMatchupSource

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 true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/taisen-brackets 0.20.0.