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
| Name | Type | Description |
|---|---|---|
source | NumberOnesSource | 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 trueWhat it prints (run when this page was built)