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

MedalTableSourcetype

A medal table to draw: the title, the sport or event, the date, the source and the rows.

Import it

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

Definition

interface MedalTableSource {
    title?: string;
    subtitle?: string;
    date?: string;
    source?: string;
    rows: readonly MedalRow[];
}

Members

NameTypeDescription
title (optional)string | undefined

The heading. Default: the language's "Medal table".

subtitle (optional)string | undefined

The sport, event or Games as a pill under the heading ("Men's judo +100 kg").

date (optional)string | undefined

The date or the edition, at the right of the heading.

source (optional)string | undefined

Where the numbers come from, small at the foot.

rowsreadonly MedalRow[]

Examples

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

const source: MedalTableSource = { subtitle: "Men's judo +100 kg", rows: [
  { name: "France", flag: "FR", gold: 6, silver: 1, bronze: 3 },
  { name: "Japan", flag: "JP", gold: 5, silver: 3, bronze: 2 },
] };
console.log(medalTable(source).includes("France"));
true

What it prints (run when this page was built)

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