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

rankingNumberOnesfunction

The number ones as cards in a grid: a coloured panel with the 1, the flag, the name and the club or country, the points and a pill that says "#1 in -57 kg". Throws a RangeError for no cards, a card with no category, an entry with no name, a colour that is not a hex code, columns that are not 1 to 4, or a bad size or theme.

Import it

import { rankingNumberOnes } from "@johnmorrisdotca/taisen-brackets";

Definition

function rankingNumberOnes(source: NumberOnesSource, options?: NumberOnesOptions): string

Parameters

NameTypeDescription
sourceNumberOnesSource

The cards.

options (optional)NumberOnesOptions

The columns, the colours, the size, the theme and the language.

Returns

string

The SVG, a string that begins with <svg.

Examples

import { rankingNumberOnes } from "@johnmorrisdotca/taisen-brackets";

const svg = rankingNumberOnes({
  date: "October 2026",
  cards: [
    { category: "-60 kg", entry: { name: { surname: "Nakamura", given: "Kenji" }, club: "Coastal Pine Judo", flag: "CA-BC", points: 1240 } },
    { category: "-66 kg", entry: { name: { surname: "Leclerc", given: "Mathieu" }, club: "Kestrel Valley Judo", flag: "CA-QC", points: 1175 } },
  ],
}, { size: "square" });
console.log(svg.includes("#1 in -66 kg"), svg.includes("LECLERC Mathieu"));
true true

What it prints (run when this page was built)

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