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

MedalFiltertype

What tallyMedals keeps: awards equal to every field given. A value can be a list (any of them).

Import it

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

Definition

interface MedalFilter {
    sport?: string | readonly string[];
    category?: string | readonly string[];
    games?: string | number | readonly (string | number)[];
}

Members

NameTypeDescription
sport (optional)string | readonly string[] | undefined
category (optional)string | readonly string[] | undefined
games (optional)string | number | readonly (string | number)[] | undefined

Examples

import { tallyMedals, type MedalFilter } from "@johnmorrisdotca/taisen-brackets";

const filter: MedalFilter = { sport: "judo", games: [2020, 2024] };
console.log(tallyMedals([{ name: "France", medal: "gold", sport: "judo", games: 2024 }, { name: "Japan", medal: "gold", sport: "wrestling", games: 2024 }], filter).length);
1

What it prints (run when this page was built)

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