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

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

Exports

NameKindWhat it is
advanceWinnersfunctionFills the sides of every tie from the ties that feed it: a decided tie's winner takes its place in the next tie (the loser, for a third-place match).
BackgroundImageOptionstypeYour own picture as the background: an image address (http(s), relative or data:image/…; anything else is refused), laid under a veil so the text reads.
BackgroundOptionstypeA preset, tuned: your own colours (hex or rgb(), the first two the ground), the gradient's angle, how strong the pattern is (0 to 1, default 0.6), a seed for the scattered parts, and which of its two variants.
BackgroundPresetNametypeThe name of one of the poster backgrounds.
BracketInputtypeA bracket's input with its teams listed once: { matchups, teams }.
BracketLayouttypeThe shape of a bracket worked out from its ties: the ties, the halves, the rounds, the rows and the champion.
collectTeamsfunctionA bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not.
countryNamefunctionThe name of a country in a language, from its ISO 3166 code, through Intl.DisplayNames: no list to write ("DE" is Germany, Allemagne, ドイツ, Alemania, Deutschland).
defineLocalefunctionA language of your own: what you give, on top of the base language's (English unless base says another) for what you leave out.
describeTiefunctionA tie in a sentence, for a tooltip, a table and a description: "Argentina 3, France 3 (after extra time, 4–2 on penalties).
DetailtypeHow much a box shows: both names and scores, an abbreviation and the score, or only the marks.
DrawOptionstypeEverything a drawing can be told: the layout, look, size, theme, background, language, marks, flags, trophy, links and titles.
EmblemRenderertypeA function from an emblem id and a request to an SVG string; renderEmblem of @johnmorrisdotca/dougu-sports/emblems is one.
EmblemRequesttypeWhat drawBracket asks an emblems renderer for.
EmblemStyletypeHow an emblem is drawn; the names are those of @johnmorrisdotca/dougu-sports.
FeedtypeWhat takes a side of a tie: a tie's id (its winner, as feeds always meant) or { tie, result }, which can name the tie's loser as well (a play-in's loser goes on to a decider).
FlagRenderertypeA function from a country code and a request to an SVG string, or null or undefined for a code it has no flag for.
FlagRequesttypeWhat a drawing asks a flags renderer for.
FlagShapetypeHow a flag is framed: round in a circle, square, or rect in its own proportions.
GametypeOne game of a tie: a match of a knockout, a game of a series, a leg of an aggregate, a replay.
GamesOptionstypeHow the games of a flat list are grouped into ties: the stages in order, which one is the third-place match, which are two legs, and how long each series is.
JudoMethodtypeHow a contest was won.
JudoOutcometypeA result checked and worked out.
JudoResulttypeThe result of one judo contest, the sides in the order of the matchup's sides: the first is white, the second blue.
JudoSidetypeWhat one side scored in a contest.
LayoutBoxtypeA tie's place in the tree.
layoutBracketfunctionThe shape of a knockout, worked out from its ties: which tie feeds which (a winner goes on to the next tie its team plays, or the tie that feeds names), the rounds, which half each tie sits in, and which side has a bye.
LayoutNametypeHow the ties are drawn: tree (the default) is the bracket as ever; the others are other ways to draw the same ties.
LayoutOptionstypeWhat layoutBracket can be told: the shape (halves or left to right) and the order of the groups.
LayoutSidetypeOne half of a bracket: its boxes, its rows and the name of its group.
LocaletypeA language: its words, the names of the rounds (by their English names), and the tag Intl formats numbers and dates for.
LOCALE_CODESconstantThe codes of the built-in languages, English first.
localeOffunctionThe language an option names: a code of a built-in one, or a Locale.
LOCALESconstantThe built-in languages, by code.
LooktypeHow a bracket is drawn: classic (the default) or road, with large round marks, big scores and a dotted path.
MatchuptypeOne tie: two sides and who went through.
MatchupKindtypeHow a tie is contested.
matchupsFromGamesfunctionMatchups from a flat list of games: the games of one pair in one stage become one tie (a replay, two legs or a series), the stage orders the rounds, and the third-place stage becomes the third-place match.
noteLongfunctionThe notes of a tie written out, for a sentence or a table: "after extra time", "4–2 on penalties".
notePartsfunctionThe pieces of a note under a tie's score, short: "a.e.t.", "pens", "in 7", "agg.".
PlacetypeWhere the layout put a tie.
PlayedGametypeOne played game, in the flat shape that most data sources give.
resolveMatchupfunctionOne matchup as a tie: sides resolved to teams, the winner and the result worked out.
ResulttypeWhat a tie came to, worked out from its games.
roundLabelfunctionThe name of round round (1 is the first) of a layout, from the names given (which may be only the last rounds) or the generic ones.
roundNamefunctionThe name of a round that has remaining teams left in it, counting from the final: Final, Semi-finals, Quarter-finals, Round of 16…
roundNamesForfunctionThe generic names of count rounds, first round first: roundNamesFor(3) is Quarter-finals, Semi-finals, Final.
SideIdtypeA side's key: a team code, a franchise id, anything that is unique within one bracket.
singleEliminationfunctionThe matchups of a single-elimination bracket for any number of teams, seeded in the standard way: the top seeds meet the lowest first, and when the number is not a power of two the top seeds have byes.
SingleEliminationOptionstypeWhat singleElimination can be told.
SizetypeA size in pixels: a width and, when it is not worked out from the drawing, a height.
SizeNametypeThe sizes a drawing has by name: wide, square, card and phone.
SourcetypeWhere a side of a tie comes from: the winner or the loser of the tie at tie (its index).
standardSeedsfunctionThe seeds in the order a standard bracket lists them, so that 1 meets 2 only in the final and the top seeds meet the bottom ones first: standardSeeds(8) is [1, 8, 4, 5, 2, 7, 3, 6].
TeamtypeA side of a tie: a team, with the marks and labels a drawing needs.
ThemeNametypeThe colours of a drawing: auto follows the page's light or dark, light, dark, poster is dark with gold lines, and none writes no style, for your own CSS.
TietypeA tie as the layout knows it.
VoicetypeA language ready to write with: the words with any replacements, and the formats.
voiceOffunctionBuilds the voice of a drawing from its locale, words and teamName options.
WordstypeThe words a drawing and a table use, in one language.
WORDSconstantThe English words, as they were before there were languages.

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