リファレンス
トーナメント表・表・決勝までの道を描く
import { … } from "@johnmorrisdotca/taisen-brackets";
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
abbreviate | 関数 | A short name for a small box: the initials of a name of several words ("NYR"), else its first three letters; capitals. |
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). |
BACKGROUND_PRESETS | 定数 | The names of the twenty-five poster backgrounds. |
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. |
BackgroundInk | 型 | The colours that read well over a background: text, lines, boxes, edges and its dominant colours. |
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. |
backgroundSvg | 関数 | Draws one of the poster backgrounds. |
BackgroundSvg | 型 | A drawn background: the defs and the body to put in an SVG, and the ink that reads over it. |
BackgroundSvgOptions | 型 | What a background is drawn for: its width and height, the theme, colours, angle, intensity and seed. |
BOARD_SIZES | 定数 | The sizes of a board: a TV's 1920 by 1080, a tablet on its side (1280 by 800) and upright (800 by 1280), a phone's 600 by 1300, and the social-card shapes, square (1080) and 4:5 (1080 by 1350). |
BoardOptions | 型 | What every board takes. |
BoardSizeName | 型 | The sizes of a board: tv, tablet, tablet-tall, phone, square and portrait. |
BoutAthlete | 型 | One of the two athletes of a bout. |
boutBoard | 関数 | The bout presentation board as a standalone SVG. |
BoutBoardOptions | 型 | What a bout board can be told: the name style and case, and the options of every broadcast board. |
boutBoardSize | 関数 | The width and the height of a bout board with officialCount officials: the width given (1280 by default) and a height of 64 + 38 + 10 + 62 + 10 + 38 + 42 an official + 10, in units of the width over 1280. |
BoutBoardSource | 型 | A bout to draw: the title, the phase, the bout number, the red and blue athletes and the officials. |
BoutOfficial | 型 | A referee or a judge. |
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. |
bracketStyle | 関数 | The stylesheet of a drawing with these options, for a page that draws the same bracket twice (a desk's size and a phone's): put it in the page once, give each drawing the same styleScope and style: false, and every drawing takes its colours from it. |
bracketTable | 関数 | The bracket as an HTML table, for a reader the drawing does not serve: one row for every tie, round by round, with the two sides, the score, the winner in bold, the date where the tie has one (written as the language writes dates) and a note. |
BROADCAST_LOOKS | 定数 | The looks: blue (a broadcast's deep blue with a bright title band), night (near black with a cyan band) and paper (white, with the same blue band). |
BroadcastIcon | 型 | The icons of the title band's square, drawn by the package: a medal and a stopwatch. |
BroadcastLook | 型 | The looks of a broadcast board: blue, night and paper. |
BroadcastMedalOptions | 型 | What a broadcast medal table can be told: labels (the codes or the names), ranks, the sort and the rows, and the options of every broadcast board. |
broadcastMedalSize | 関数 | The width and the height of a broadcast medal table of rowCount rows: the width given (1280 by default) and a height of 64 + 36 + 10 + 48 a row + 10, in units of the width over 1280. |
broadcastMedalTable | 関数 | The broadcast-style medal table as a standalone SVG. |
BroadcastOptions | 型 | What every broadcast board takes: the width, the look, the icon, the flags, the language, a title and an id. |
cleanSvg | 関数 | Takes inline SVG markup from a caller and makes it safe to put inside a drawing: the outer <svg>'s viewBox is kept, and scripts, event handlers, <style>, <foreignObject>, comments and javascript: addresses are removed. |
collectTeams | 関数 | A bracket's teams: the list given, plus a team made from every id that a matchup names and the list does not. |
CONFERENCE_COLORS | 定数 | The colours of the two halves (conferences) of the layouts that colour them, each with white letters on it: --tb-conf-a and --tb-conf-b. |
contrastRatio | 関数 | The contrast between two colours, from 1 (the same) to 21 (black on white). |
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. |
describeBoutBoard | 関数 | The board as a sentence, the drawing's description. |
describeBracket | 関数 | The text a screen reader gets for the drawing as a whole, in the language of locale. |
describeEntryList | 関数 | The entry list as a sentence, the drawing's description. |
describeJudoCard | 関数 | The contest card as a sentence, the drawing's description. |
describeJudoContest | 関数 | The words of the state in a sentence, for the drawing's description. |
describeJudoQueue | 関数 | The mat queue as a sentence: for each mat, its contests in order. |
describeJudoRoad | 関数 | The road as a sentence, the drawing's description. |
describeMatchup | 関数 | The card as a sentence, the drawing's description. |
describeMedalTable | 関数 | The table as a sentence, the drawing's description. |
describeNumberOnes | 関数 | The cards as a sentence, the drawing's description. |
describeRanking | 関数 | The ranking as a sentence, the drawing's description. |
describeResultsBoard | 関数 | The board as a sentence, the drawing's description. |
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. |
drawBracket | 関数 | Draws a bracket as an SVG string. |
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. |
EntryListOptions | 型 | What an entry list can be told: the sort (entry or ranking), numbers, columns, rows and page. |
EntryListSource | 型 | An entry list to draw: a title, a category, a date and the athletes entered, with their rank if they have one. |
FAMILY_BACKGROUNDS_VERSION | 定数 | The version of the backgrounds the family shares; a change to any picture changes it. |
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. |
GroupRow | 型 | One team's line of a group's table. |
groupsTable | 関数 | The table of the groups as HTML, for a reader the drawing does not serve: one <table> a group, its caption the group's name, a row a team. |
groupStandings | 関数 | The tables of the group stage: one for each group, from the round-robin games (round: 0) of the ties. |
GroupTable | 型 | One group: its name in the language and its teams, the best first. |
isEmblemId | 関数 | Whether a trophy value names an emblem ("trophy:hockey-cup", "medal:gold/line") rather than being inline SVG or an image address. |
JUDO_BOARD_SIZES | 定数 | The sizes: a TV's 1920 by 1080, a tablet on its side, 1280 by 800, and a tablet held upright, 800 by 1280. |
JUDO_MAT_COLORS | 定数 | The IJF-style mat colours, in turn: red, green, yellow, purple, orange, teal. |
JUDO_WEIGHT_CLASSES | 定数 | The IJF's senior weight classes in kilograms, the lightest first: a number is "up to and including", a text starting + is "over". |
JudoAthlete | 型 | One athlete on the scoreboard. |
JudoBoardOptions | 型 | What a judo board can be told: the size, the theme, the style (board or flip cards), which side is on the left, the coaches, the flags and the language. |
JudoBoardSizeName | 型 | The sizes of a judo board: tv, tablet and tablet-tall. |
judoBracket | 関数 | The contests of one judo weight category for any number of athletes, seeded in the standard way (the top seeds have the byes when the number is not a power of two). |
JudoBracketOptions | 型 | What judoBracket can be told: the system and a prefix for the ties' ids. |
JudoCardContest | 型 | What the contest card shows: the two athletes and the header. |
JudoCategory | 型 | A judo category: the sex and the weight class. |
judoCategoryLabel | 関数 | A weight category as a heading in a language: "Men -66 kg", "Women +78 kg". |
judoClock | 関数 | Seconds as m:ss. |
JudoContest | 型 | The state of a contest: who is on the mat, what has been scored, and the clock. |
judoContestCard | 関数 | The contest card: the weight class and the round on top, then the white athlete over the blue one, each as a wide band with the flag, the name as big as the band lets it be, and the country code. |
JudoMat | 型 | One mat: its number or name, its colour (any CSS colour that a hex code gives, default by position) and its contests in the order they will be fought. |
judoMatQueue | 関数 | The mat queue board: for each mat a big number in the mat's colour and the contests to come, in order, each a row with the contest number, the white athlete and the blue one (name, code, flag). |
JudoMethod | 型 | How a contest was won. |
judoOutcome | 関数 | Checks a result against the rules and works out who won and how. |
JudoOutcome | 型 | A result checked and worked out. |
judoPodium | 関数 | The gold, silver and two bronze medals of a bracket (matchups, input or layout), from the final, the bronze medal contests or the semi-finals. |
JudoPodium | 型 | The medallists of a judo tournament, as far as it has been fought. |
JudoQueueContest | 型 | One contest of a mat's queue: its number ("G-24", 24) and the two athletes, and optionally the weight class and the round (for a caption). |
JudoQueueOptions | 型 | 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. |
JudoResult | 型 | The result of one judo contest, the sides in the order of the matchup's sides: the first is white, the second blue. |
JudoRoadOptions | 型 | What a road panel can be told: the weight class, the side's colour, the order of the wins, how many rows, the size, the theme and the language. |
judoRoadPanel | 関数 | The road-to-the-final panel for an athlete: their block (flag, name, code, coach) in the colour of a judogi, and a row for each contest won, most recent first: the round, the opponent's flag, code and name, and how it was won. |
JudoRoadSource | 型 | What a road panel shows: the athlete and the contests they won. |
judoScoreboard | 関数 | The scoreboard of a contest as an SVG string. |
judoSeconds | 関数 | A time as seconds: a number, or "m:ss". |
JudoSide | 型 | What one side scored in a contest. |
JudoSystem | 型 | How a judo tournament is drawn: repechage (the IJF's quarter-final repechage, with its two bronze medal contests), or direct (a direct knockout in which both semi-final losers are bronze medallists). |
JudoWin | 型 | One win on the road: the round it was in, the opponent (none for a bye), and how it was won in words ("ippon · 1:12", "decision · GS · 5:12", or a score). |
judoWins | 関数 | The contests an athlete has won in a bracket, oldest first, with a bye for each round skipped at the start: the opponent, the round (a repechage and a bronze medal contest are named as such) and how it was won, from the judo result's notes or the score. |
JudoWinsOptions | 型 | What judoWins can be told: the language, the round names, how to make an athlete of a team, and whether byes are listed. |
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. |
LAYOUTS | 定数 | The names of the layouts, the tree first. |
LayoutSide | 型 | One half of a bracket: its boxes, its rows and the name of its group. |
League | 型 | A league with a playoff format by era: nhl, nba, mlb, nfl, cfl, mls or worldcup. |
LEAGUE_EMBLEMS | 定数 | The emblem each league's champion gets by default: an id of @johnmorrisdotca/dougu-sports (generic forms, no league's own mark). |
LEAGUES | 定数 | The leagues that have a format here. |
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. |
localizedLayout | 関数 | The layout with each team's name in the language: what the drawing, the table and the description are written from. |
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. |
MatchupOptions | 型 | What a matchup board can be told: how many meetings are listed, the name and rank style, the precision, and the options of every board. |
matchupRecord | 関数 | The record of the meetings: how many each athlete won. |
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. |
MatchupSource | 型 | A matchup to draw: the two athletes with their ranks and points, and their earlier meetings. |
MedalAward | 型 | A medal won: who won it and what kind, with whatever you filter on. |
MedalFilter | 型 | What tallyMedals keeps: awards equal to every field given. |
medalRanks | 関数 | The ranks of a list of rows, as medalTable draws them ([1, 2, 2, 4]), in the order they are drawn. |
MedalRow | 型 | One row of a medal table: a country or a team and its medals. |
medalTable | 関数 | The medal table as an SVG. |
MedalTableOptions | 型 | What a medal table can be told: the sort (gold, total or given), ties, how many rows, columns, highlighting, and the options of every board. |
MedalTableSource | 型 | A medal table to draw: the title, the sport or event, the date, the source and the rows. |
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.". |
NUMBER_ONE_COLORS | 定数 | Orange, crimson, blue, teal, purple and amber, each dark enough for white type (4.5 to 1 or better). |
NumberOnesOptions | 型 | What the number-ones board can be told: the columns, the card colours, and the options of every board. |
NumberOnesSource | 型 | The number ones to draw: a title, a date, a source and one card for each category. |
Palette | 型 | The colours of one look. |
Place | 型 | Where the layout put a tie. |
PlayedGame | 型 | One played game, in the flat shape that most data sources give. |
playoffEras | 関数 | Every era of a league, oldest first. |
playoffFormat | 関数 | The playoff format of a league in a season (or a World Cup in its year), or null when there was none or this package does not cover it. |
PlayoffFormat | 型 | A league's playoff format in one era: the years it ran, its rounds, how many teams it took, its byes and its sources. |
PlayoffRound | 型 | One round of a playoff format: its name and how many games a series is (null for a single game). |
RankingCard | 型 | A category and its number one. |
rankingCategoryLabel | 関数 | A category as a heading ("U18 · Men -60 kg"): an age group, a sex and a weight, any of them, joined by a dot. |
RankingEntry | 型 | One line of a ranking. |
rankingEntryList | 関数 | An event's entry list: a numbered row for each athlete in the order of the draw, with the flag, the name and club, the country's letters and the athlete's ranking (NR for none) at the right. |
rankingList | 関数 | The ranking list as an SVG. |
rankingMatchup | 関数 | The head-to-head card for two athletes and their meetings. |
RankingMeeting | 型 | One previous meeting of the two athletes. |
RankingName | 型 | A name in two parts: the family name is written in capitals and first by default (SURNAME Given, as judo and the IJF write it). |
rankingNumberOnes | 関数 | The number ones as cards in a grid: a coloured panel with the 1, the flag, the name and the club or country, the points and a pill that says "#1 in -57 kg". |
RankingOptions | 型 | What a ranking can be told: the style (podium, list or featured), rows and page, columns, movement arrows, name and rank style, and the size, theme and language. |
rankingRanks | 関数 | The ranks of a list, in order: an entry's own rank, else its position, with equal points sharing a rank; null for a champion row. |
RankingSource | 型 | A ranking to draw: the title, the category, the date, the source and the entries. |
resolveBackground | 関数 | Reads the background option for a drawing width by height in the look theme, with prefix for the ids. |
ResolvedBackground | 型 | A background ready to put in a drawing: its definitions, its body and the ink that reads over it. |
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. |
resultsBoard | 関数 | The results board as a standalone SVG. |
ResultsBoardOptions | 型 | What a results board can be told: the width, the look, the icon, the rank style, the name style and case, and the language. |
resultsBoardSize | 関数 | The width and the height of a results board with rowCount rows: the width given (1280 by default) and a height of 64 + 36 + 20 + 54 a row, in units of the width over 1280. |
ResultsBoardSource | 型 | A results board to draw: the title, the phase, the columns and the rows. |
ResultsColumn | 型 | A column of scores: its heading in the sub bar, and the decimals of its numbers. |
ResultsRow | 型 | One line of a results board. |
ROAD_THEMES | 定数 | The road look's colours for each theme: light, dark and poster. |
RoadChart | 型 | What roadToFinal gives back. |
RoadDecided | 型 | How a match was decided: ft (full time, the default), aet (after extra time) or pens (a shoot-out after extra time). |
RoadFinal | 型 | The final, when it has been played. |
RoadFinalist | 型 | A finalist: a team and the matches it played on the way, the earliest first. |
RoadGroupMatch | 型 | One match of the group stage: as a knockout match, without a round. |
RoadInput | 型 | What roadToFinal takes: the two finalists with their paths, or a tournament (a list of matchups, { matchups, teams } or a layout) whose final has two sides. |
RoadMatch | 型 | One match on a finalist's way. |
RoadOptions | 型 | What roadToFinal takes besides the finalists or the tournament. |
RoadPalette | 型 | What the road look adds to a palette: the ring and the hairline round a mark, the pill behind a round's name, and the road's dots. |
RoadRecord | 型 | One finalist's record on the way. |
RoadScore | 型 | A match's score from the finalist's side: [for, against] (numbers, or text such as a series' 4), or one text, "4-2", that is split at its dash. |
RoadSize | 型 | The sizes of the road chart are the bracket's: card (the default here), square, wide (the finalists at the two ends) and phone. |
RoadTeam | 型 | A team of a road chart: a Team whose id is optional (a standalone finalist needs only a name), with logo as another name for mark. |
roadToFinal | 関数 | The road to the final: the two finalists as large round marks with their names at the top, each one's matches on its side (the round mark of both teams with the score between them, and FT, AET or the shoot-out under it), the round names down the middle, and the group stage as a compact row of small marks, codes and scores. |
RoadTotals | 型 | The numbers behind a road chart. |
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. |
safeHref | 関数 | Whether an address may be a link in a drawing: http(s), a relative path or a # fragment. |
safeUrl | 関数 | Whether an image address is one a drawing will load: http(s), a relative path, or a data:image/. |
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. |
SIZES | 定数 | The sizes by name. |
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]. |
TableOptions | 型 | What bracketTable can be told: the language and words, the round names, a caption and a class. |
tallyMedals | 関数 | Adds up a list of medals into the rows of a table, one row for each name, keeping the first flag, mark, code and note given for it. |
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. |
THEMES | 定数 | The looks. |
Tie | 型 | A tie as the layout knows it. |
VERSION | 定数 | The package's version. |
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。