本文へ移動

Taisen Brackets対戦

対戦の一覧から、トーナメント表をSVGで描きます。

対戦(たいせん)は、二者が向かい合って勝負することです。 名前について(英語)

目次

リファレンス

各対戦の位置を計算

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

リファレンスの説明と例は英語です。見出しと目次は日本語です。

エクスポート

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

ソースを見るGitHub で編集@johnmorrisdotca/taisen-brackets 0.20.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。