本文へ移動

Taisen Brackets対戦

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

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

目次

リファレンス

トーナメント表・表・決勝までの道を描く

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.

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

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