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

describeMedalTablefunction

The table as a sentence, the drawing's description.

Import it

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

Definition

function describeMedalTable(source: MedalTableSource, options?: Pick<MedalTableOptions, "locale" | "words" | "sort" | "ties" | "top" | "skipEmpty">): string

Parameters

NameTypeDescription
sourceMedalTableSource

The medal table.

options (optional)Pick<MedalTableOptions, "locale" | "words" | "ties" | "sort" | "top" | "skipEmpty">

The language, the words, the sort and the rows chosen.

Returns

string

The description.

Examples

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

console.log(describeMedalTable({ rows: [
  { name: "France", flag: "FR", gold: 6, silver: 1, bronze: 3 },
  { name: "Japan", flag: "JP", gold: 5, silver: 3, bronze: 2 },
] }));
Medal table. 1, France, 6 gold, 1 silver, 3 bronze, 10 total. 2, Japan, 5 gold, 3 silver, 2 bronze, 10 total.

What it prints (run when this page was built)

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