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

MedalRowtype

One row of a medal table: a country or a team and its medals. Only name is needed.

Import it

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

Definition

interface MedalRow {
    name: string;
    flag?: string;
    mark?: string;
    code?: string;
    gold?: number;
    silver?: number;
    bronze?: number;
    note?: string;
}

Members

NameTypeDescription
namestring

The country's or team's name as it is to be written ("France", "Soviet Union", "Unified Team").

flag (optional)string | undefined

A code for the flags function (FR, CA-BC); a country that has no flag in it (a former one, a team) is drawn as a badge with code or the initials.

mark (optional)string | undefined

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

code (optional)string | undefined

The country's three letters, for the badge of a row with no flag.

gold (optional)number | undefined
silver (optional)number | undefined
bronze (optional)number | undefined
note (optional)string | undefined

A small line under the name: the years a former country existed ("1922–1991"), or what a team is.

Examples

import { medalTable, type MedalRow } from "@johnmorrisdotca/taisen-brackets";

const row: MedalRow = { name: "Soviet Union", code: "URS", note: "1922–1991", gold: 1, bronze: 4 };
console.log(medalTable({ rows: [row] }).includes("1922–1991"));
true

What it prints (run when this page was built)

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