Reference
Where every tie sits
import { … } from "@johnmorrisdotca/taisen-brackets/layout";
Exports
| Name | Kind | What it is |
|---|---|---|
advanceWinners | function | Fills 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). |
BackgroundImageOptions | type | Your 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. |
BackgroundOptions | type | A 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. |
BackgroundPresetName | type | The name of one of the poster backgrounds. |
BracketInput | type | A bracket's input with its teams listed once: { matchups, teams }. |
BracketLayout | type | The shape of a bracket worked out from its ties: the ties, the halves, the rounds, the rows and the champion. |
collectTeams | function | A bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not. |
countryName | function | The 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). |
defineLocale | function | A language of your own: what you give, on top of the base language's (English unless base says another) for what you leave out. |
describeTie | function | A tie in a sentence, for a tooltip, a table and a description: "Argentina 3, France 3 (after extra time, 4–2 on penalties). |
Detail | type | How much a box shows: both names and scores, an abbreviation and the score, or only the marks. |
DrawOptions | type | Everything a drawing can be told: the layout, look, size, theme, background, language, marks, flags, trophy, links and titles. |
EmblemRenderer | type | A function from an emblem id and a request to an SVG string; renderEmblem of @johnmorrisdotca/dougu-sports/emblems is one. |
EmblemRequest | type | What drawBracket asks an emblems renderer for. |
EmblemStyle | type | How an emblem is drawn; the names are those of @johnmorrisdotca/dougu-sports. |
Feed | type | What 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). |
FlagRenderer | type | A function from a country code and a request to an SVG string, or null or undefined for a code it has no flag for. |
FlagRequest | type | What a drawing asks a flags renderer for. |
FlagShape | type | How a flag is framed: round in a circle, square, or rect in its own proportions. |
Game | type | One game of a tie: a match of a knockout, a game of a series, a leg of an aggregate, a replay. |
GamesOptions | type | How 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. |
JudoMethod | type | How a contest was won. |
JudoOutcome | type | A result checked and worked out. |
JudoResult | type | The result of one judo contest, the sides in the order of the matchup's sides: the first is white, the second blue. |
JudoSide | type | What one side scored in a contest. |
LayoutBox | type | A tie's place in the tree. |
layoutBracket | function | The 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. |
LayoutName | type | How the ties are drawn: tree (the default) is the bracket as ever; the others are other ways to draw the same ties. |
LayoutOptions | type | What layoutBracket can be told: the shape (halves or left to right) and the order of the groups. |
LayoutSide | type | One half of a bracket: its boxes, its rows and the name of its group. |
Locale | type | A language: its words, the names of the rounds (by their English names), and the tag Intl formats numbers and dates for. |
LOCALE_CODES | constant | The codes of the built-in languages, English first. |
localeOf | function | The language an option names: a code of a built-in one, or a Locale. |
LOCALES | constant | The built-in languages, by code. |
Look | type | How a bracket is drawn: classic (the default) or road, with large round marks, big scores and a dotted path. |
Matchup | type | One tie: two sides and who went through. |
MatchupKind | type | How a tie is contested. |
matchupsFromGames | function | Matchups 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. |
noteLong | function | The notes of a tie written out, for a sentence or a table: "after extra time", "4–2 on penalties". |
noteParts | function | The pieces of a note under a tie's score, short: "a.e.t.", "pens", "in 7", "agg.". |
Place | type | Where the layout put a tie. |
PlayedGame | type | One played game, in the flat shape that most data sources give. |
resolveMatchup | function | One matchup as a tie: sides resolved to teams, the winner and the result worked out. |
Result | type | What a tie came to, worked out from its games. |
roundLabel | function | The 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. |
roundName | function | The name of a round that has remaining teams left in it, counting from the final: Final, Semi-finals, Quarter-finals, Round of 16… |
roundNamesFor | function | The generic names of count rounds, first round first: roundNamesFor(3) is Quarter-finals, Semi-finals, Final. |
SideId | type | A side's key: a team code, a franchise id, anything that is unique within one bracket. |
singleElimination | function | The 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. |
SingleEliminationOptions | type | What singleElimination can be told. |
Size | type | A size in pixels: a width and, when it is not worked out from the drawing, a height. |
SizeName | type | The sizes a drawing has by name: wide, square, card and phone. |
Source | type | Where a side of a tie comes from: the winner or the loser of the tie at tie (its index). |
standardSeeds | function | The 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]. |
Team | type | A side of a tie: a team, with the marks and labels a drawing needs. |
ThemeName | type | The 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. |
Tie | type | A tie as the layout knows it. |
Voice | type | A language ready to write with: the words with any replacements, and the formats. |
voiceOf | function | Builds the voice of a drawing from its locale, words and teamName options. |
Words | type | The words a drawing and a table use, in one language. |
WORDS | constant | The English words, as they were before there were languages. |