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

ResultsBoardSourcetype

A results board to draw: the title, the phase, the columns and the rows.

Import it

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

Definition

interface ResultsBoardSource {
    title: string;
    phase?: string;
    columns?: readonly ResultsColumn[];
    rows: readonly ResultsRow[];
}

Members

NameTypeDescription
titlestring

The event, in capitals in the title band ("Women's apparatus final").

phase (optional)string | undefined

The phase in the sub bar ("Result", "Final", "Preliminaries"). Default: the language's "Result".

columns (optional)readonly ResultsColumn[] | undefined

The score columns, left to right. Default: one column per value of the longest row, with no heading.

rowsreadonly ResultsRow[]

Examples

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

const source: ResultsBoardSource = {
  title: "Men's 100m butterfly",
  phase: "Results · Final",
  columns: [{ precision: 2 }],
  rows: [
    { code: "USA", flag: "US", name: "Michael Phillips", values: [50.58], record: "OR" },
    { code: "HUN", flag: "HU", name: "Laszlo Czigany", values: [50.59] },
  ],
};
console.log(resultsBoard(source).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.