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

JudoQueueOptionstype

What a mat queue can be told: the size, the theme, how many rows, whether the first contest is marked as the current one, and the mat colours.

Import it

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

Definition

interface JudoQueueOptions extends Omit<JudoBoardOptions, "style" | "coaches"> {
    rows?: number;
    current?: boolean;
    colors?: readonly string[];
}

Members

NameTypeDescription
rows (optional)number | undefined

The most contests drawn for a mat. Default: as many as fit at a readable size, up to 12.

current (optional)boolean | undefined

Show the first contest of each mat as the one on now (a green number). Default true.

colors (optional)readonly string[] | undefined

The colours the mats take in turn where a mat names none. Hex codes.

title (optional)string | undefined

The <title> of the drawing. Default the language's "Judo contest scoreboard".

locale (optional)string | Locale | undefined

The language: en, fr, ja, es, de or a Locale.

words (optional)Partial<Words> | undefined
flags (optional)FlagRenderer | undefined

Draws a country's flag from its code, as for drawBracket: a synchronous function from a code and { shape, size, theme } to an SVG string, such as one made from @johnmorrisdotca/hata.

flagHref (optional)((code: string) => string | null | undefined) | undefined

The address of a flag as a picture to load, tried where flags gives none.

theme (optional)"auto" | "light" | "dark" | undefined

auto follows the page's light or dark; the athletes' panels are the colours of the judogi either way. Default auto.

id (optional)string | undefined

Prefix for the drawing's ids. Default: a hash of the state and the options.

className (optional)string | undefined
size (optional)JudoBoardSizeName | { width: number; height: number; } | undefined

tv (the default), tablet, tablet-tall, or a size of your own: a wider-than-tall one lays the sides out left and right, a taller one top and bottom.

swap (optional)boolean | undefined

Draw blue first (on the left, or at the top) in place of white. Default false.

Examples

import { judoMatQueue, type JudoQueueOptions } from "@johnmorrisdotca/taisen-brackets";

const options: JudoQueueOptions = { size: "tv", theme: "dark", rows: 4, current: true };
console.log(judoMatQueue({ mat: 1, contests: [{ number: 1, white: { name: "A" }, blue: { name: "B" } }] }, options).startsWith("<svg"));
true

What it prints (run when this page was built)

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