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 · Where every tie sits

FlagShapetype

How a flag is framed: round in a circle, square, or rect in its own proportions.

Import it

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

Also exported from: @johnmorrisdotca/taisen-brackets

Definition

type FlagShape = "round" | "square" | "rect";

Examples

import { type FlagShape, type FlagRenderer } from "@johnmorrisdotca/taisen-brackets";

const shapes: FlagShape[] = ["round", "square", "rect"];
const renderer: FlagRenderer = (code, request) => (shapes.includes(request.shape) ? `<svg viewBox="0 0 3 2"><title>${code}</title></svg>` : null);
console.log(renderer("JP", { shape: "round", size: 24, theme: "inherit" }));
<svg viewBox="0 0 3 2"><title>JP</title></svg>

What it prints (run when this page was built)

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