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

ResultsRowtype

One line of a results board. Only name is needed.

Import it

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

Definition

interface ResultsRow {
    name: string | RankingName;
    rank?: number | string;
    code?: string;
    flag?: string;
    mark?: string;
    values?: readonly (number | string | null)[];
    record?: string | readonly string[];
    note?: string;
}

Members

NameTypeDescription
namestring | RankingName

The name as it is to be written ("A. SACRAMONE", "Svetlana Khorkina"), or its two parts (set by nameStyle).

rank (optional)string | number | undefined

The rank: a number, or a text ("=3", "DQ"). Left out, the place in the list (equal results share one, see ties).

code (optional)string | undefined

The country's three letters, written before the flag.

flag (optional)string | undefined

A code for the flags function (US, CA-BC), drawn 4:3.

mark (optional)string | undefined

A mark of your own (an image address or inline SVG) in place of a flag.

values (optional)readonly (string | number | null)[] | undefined

One value for each column: a number (written to the column's precision decimals), a text (written as it is: 1:08.34), or none.

record (optional)string | readonly string[] | undefined

A record badge or several beside the last value: "OR", ["WR", "NR"].

note (optional)string | undefined

Written in place of the values when there are none to show: DNS, DNF, DQ.

Examples

import { resultsBoard, type ResultsRow } from "@johnmorrisdotca/taisen-brackets";

const row: ResultsRow = { code: "USA", flag: "US", name: "Michael Phillips", values: [50.58], record: "OR" };
console.log(resultsBoard({ title: "Final", rows: [row] }).includes("50.58"));
true

What it prints (run when this page was built)

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