@johnmorrisdotca/taisen-brackets 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -2
- package/NOTICE.md +4 -2
- package/README.md +64 -23
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/judo-model.d.ts +66 -0
- package/dist/judo-model.js +102 -0
- package/dist/judo-text.d.ts +19 -0
- package/dist/judo-text.js +84 -0
- package/dist/judo.d.ts +44 -0
- package/dist/judo.js +75 -0
- package/dist/layout.js +2 -2
- package/dist/layouts.js +4 -3
- package/dist/locales.js +25 -0
- package/dist/matchup.js +41 -8
- package/dist/playin.js +2 -1
- package/dist/render.js +37 -18
- package/dist/table.js +3 -2
- package/dist/theme.d.ts +9 -0
- package/dist/theme.js +5 -0
- package/dist/types.d.ts +49 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* The types of Taisen: what goes in (teams and matchups), what the layout works out (ties, rounds, halves) and what
|
|
3
3
|
* the drawing takes as options. Nothing here runs; the functions are in `matchup.ts`, `layout.ts` and `render.ts`.
|
|
4
4
|
*/
|
|
5
|
+
import type { JudoOutcome, JudoResult } from "./judo-model.ts";
|
|
5
6
|
/** A side's key: a team code, a franchise id, anything that is unique within one bracket. */
|
|
6
7
|
export type SideId = string | number;
|
|
7
8
|
/** A side of a tie: a team, with the marks and labels a drawing needs. Only `id` and `name` are required. */
|
|
@@ -106,8 +107,13 @@ export interface Matchup {
|
|
|
106
107
|
walkover?: boolean;
|
|
107
108
|
/** This is the third-place match: it leads nowhere and is drawn apart. */
|
|
108
109
|
third?: boolean;
|
|
109
|
-
/**
|
|
110
|
-
|
|
110
|
+
/**
|
|
111
|
+
* `"play-in"`: a game of a play-in (the NBA's) that is outside the rounds of the tree: its winner (and loser, see `feeds`) goes on to a place the tree's ties name. Drawn by the `playin` layout and, apart, under the other layouts' trees.
|
|
112
|
+
* `"repechage"` and `"bronze"`: a judo repechage contest and a bronze medal contest, fed by the losers of the tree's ties (`judoBracket` writes them); drawn apart under the tree.
|
|
113
|
+
*/
|
|
114
|
+
stage?: "play-in" | "repechage" | "bronze";
|
|
115
|
+
/** A judo contest's scores: ippon, waza-ari, yuko, shido, hansoku-make, golden score and time. The first side is white, the second blue. The score, the winner and the notes come from it; see `judoOutcome`. */
|
|
116
|
+
judo?: JudoResult;
|
|
111
117
|
/** The side playing at home (0 or 1), for the `at` wording of the `columns` layout: the home side is drawn second, after "AT". Left out, the second side. */
|
|
112
118
|
home?: 0 | 1;
|
|
113
119
|
note?: string;
|
|
@@ -151,8 +157,12 @@ export interface Tie {
|
|
|
151
157
|
seeds?: readonly [string | number | null, string | number | null];
|
|
152
158
|
/** Where each side comes from, when the matchup's `feeds` name it: another tie's winner or its loser. Left out for a tie that says nothing of the kind. */
|
|
153
159
|
from?: readonly [Source | null, Source | null];
|
|
154
|
-
/** The tie is a play-in game (`Matchup.stage`). */
|
|
160
|
+
/** The tie is a play-in game, a judo repechage contest or a bronze medal contest (`Matchup.stage`). */
|
|
155
161
|
playIn?: boolean;
|
|
162
|
+
/** The tie's `Matchup.stage`, when it has one. */
|
|
163
|
+
stage?: "play-in" | "repechage" | "bronze";
|
|
164
|
+
/** A judo contest's result, checked and worked out (`Matchup.judo`). */
|
|
165
|
+
judo?: JudoOutcome;
|
|
156
166
|
/** The side at home (`Matchup.home`), when given. */
|
|
157
167
|
home?: 0 | 1;
|
|
158
168
|
}
|
|
@@ -342,6 +352,39 @@ export interface Words {
|
|
|
342
352
|
/** `{name}`: a side that is the winner or loser of another tie, in a sentence or a table: "Loser of {name}". */
|
|
343
353
|
winnerOf: string;
|
|
344
354
|
loserOf: string;
|
|
355
|
+
/** Judo. The marks of the scores on a box (ippon, waza-ari, yuko), the same written out, and how a contest was won. */
|
|
356
|
+
judoIppon: string;
|
|
357
|
+
judoWazaAri: string;
|
|
358
|
+
judoYuko: string;
|
|
359
|
+
judoIpponLong: string;
|
|
360
|
+
judoWazaAriLong: string;
|
|
361
|
+
judoYukoLong: string;
|
|
362
|
+
judoMethodIppon: string;
|
|
363
|
+
judoMethodAwasete: string;
|
|
364
|
+
judoMethodScore: string;
|
|
365
|
+
judoMethodHansoku: string;
|
|
366
|
+
judoMethodFusen: string;
|
|
367
|
+
judoMethodKiken: string;
|
|
368
|
+
/** Golden score, short and in a sentence. */
|
|
369
|
+
judoGolden: string;
|
|
370
|
+
judoGoldenLong: string;
|
|
371
|
+
/** `{t}`: the contest time ("3:42"). */
|
|
372
|
+
judoTime: string;
|
|
373
|
+
/** `{name}`, `{n}`: a side's shido ("Kenji Nakamura: 2 shido"). */
|
|
374
|
+
judoShidoOf: string;
|
|
375
|
+
/** `{a}`, `{b}`: the sides' shido in a short note. */
|
|
376
|
+
judoShidoShort: string;
|
|
377
|
+
/** The headings over the repechage contests and the bronze medal contests, alone and together; the sides' colours. */
|
|
378
|
+
judoRepechage: string;
|
|
379
|
+
judoBronze: string;
|
|
380
|
+
judoRepechageBronze: string;
|
|
381
|
+
judoWhite: string;
|
|
382
|
+
judoBlue: string;
|
|
383
|
+
/** `{sex}`, `{w}` (the number of kilograms, no sign): a weight category up to and including that weight ("Men -66 kg"), one over it ("Women +78 kg"), and the two sexes' words. */
|
|
384
|
+
judoWeightClass: string;
|
|
385
|
+
judoWeightOver: string;
|
|
386
|
+
judoMen: string;
|
|
387
|
+
judoWomen: string;
|
|
345
388
|
}
|
|
346
389
|
/** A language: its words, the names of the rounds (by their English names), and the tag `Intl` formats numbers and dates for. */
|
|
347
390
|
export interface Locale {
|
|
@@ -352,6 +395,7 @@ export interface Locale {
|
|
|
352
395
|
/** Round names by their English name: `{ "Round of 16": "Huitièmes de finale" }`. A round with no entry keeps its name (or `roundOf`). */
|
|
353
396
|
rounds: Readonly<Record<string, string>>;
|
|
354
397
|
}
|
|
398
|
+
export type { JudoMethod, JudoOutcome, JudoResult, JudoSide } from "./judo-model.ts";
|
|
355
399
|
export type ThemeName = "auto" | "light" | "dark" | "poster" | "none";
|
|
356
400
|
export type SizeName = "wide" | "square" | "phone" | "card";
|
|
357
401
|
export interface Size {
|
|
@@ -434,6 +478,8 @@ export interface DrawOptions extends LayoutOptions {
|
|
|
434
478
|
standings?: "points" | "record";
|
|
435
479
|
/** In the `groups` layout, how many teams of each group go through: their rows are marked. Default 0, none. */
|
|
436
480
|
qualify?: number;
|
|
481
|
+
/** For `bracketStyle`: include the judo rules (the white and blue side bars, the shido cards). `drawBracket` adds them by itself when a tie has judo scores. */
|
|
482
|
+
judo?: boolean;
|
|
437
483
|
/** Write the `<style>` into the drawing. Default true; false leaves it out, for a second drawing of a page that shares the first's (`styleScope`, `bracketStyle`). */
|
|
438
484
|
style?: boolean;
|
|
439
485
|
/** A class that carries this drawing's rules in place of its own: two drawings with the same `styleScope` take their colours from one `<style>`, and the second can leave it out (`style: false`). A word of letters, digits, `-` and `_`. */
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.7.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/taisen-brackets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Taisen Brackets 対戦, knockout brackets as SVG: from a list of ties (games, best-of series, two legs, replays, byes, a third-place match) it works out the rounds and halves and draws the bracket with the halves meeting at the final, or left to right, wide, square, as a tall card or for a phone, in a classic or a road look (large round flags, big scores, a team's dotted path, a link on every box), in light, dark or a gold-on-navy poster look, in eight layouts (the tree, rows, shields, a score-update card, tall columns, the NBA's play-in, a series card and group tables), on one of twenty-five poster backgrounds (the playing surfaces of five sports among them) or your own, with each team's logo or round flag, the champion in the centre, and an accessible table; and the road to the final of either finalist. NHL, NBA, MLB, NFL, CFL, MLS and World Cup formats by era, in English, French, Japanese, Spanish and German. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bracket",
|