@johnmorrisdotca/kyogijo-stadiums 0.4.0 → 0.6.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 +133 -0
- package/NOTICE.md +182 -2
- package/README.md +106 -19
- package/dist/annotate.js +1 -1
- package/dist/arenas-entry.d.ts +4 -0
- package/dist/arenas-entry.js +3 -0
- package/dist/arenas.d.ts +125 -0
- package/dist/arenas.data.d.ts +2 -0
- package/dist/arenas.data.js +3763 -0
- package/dist/arenas.js +72 -0
- package/dist/athletics/describe.d.ts +8 -0
- package/dist/athletics/describe.js +41 -0
- package/dist/athletics/events.d.ts +17 -0
- package/dist/athletics/events.js +48 -0
- package/dist/athletics/facilities.d.ts +80 -0
- package/dist/athletics/facilities.js +176 -0
- package/dist/athletics/infield.d.ts +79 -0
- package/dist/athletics/infield.js +166 -0
- package/dist/athletics/layout.d.ts +13 -0
- package/dist/athletics/layout.js +98 -0
- package/dist/athletics/oval.d.ts +57 -0
- package/dist/athletics/oval.js +116 -0
- package/dist/athletics/plan.d.ts +97 -0
- package/dist/athletics/plan.js +355 -0
- package/dist/athletics/races.d.ts +102 -0
- package/dist/athletics/races.js +355 -0
- package/dist/athletics/steeplechase.d.ts +72 -0
- package/dist/athletics/steeplechase.js +196 -0
- package/dist/athletics/stencil.d.ts +13 -0
- package/dist/athletics/stencil.js +85 -0
- package/dist/athletics/track.d.ts +54 -0
- package/dist/athletics/track.js +105 -0
- package/dist/athletics/types.d.ts +77 -0
- package/dist/athletics/types.js +1 -0
- package/dist/athletics-entry.d.ts +17 -0
- package/dist/athletics-entry.js +11 -0
- package/dist/athletics.style.d.ts +16 -0
- package/dist/athletics.style.js +51 -0
- package/dist/atlas-entry.d.ts +6 -2
- package/dist/atlas-entry.js +4 -2
- package/dist/atlas.d.ts +117 -23
- package/dist/atlas.js +197 -12
- package/dist/background.js +2 -1
- package/dist/budo/describe.d.ts +13 -0
- package/dist/budo/describe.js +120 -0
- package/dist/budo/dojo.api.d.ts +64 -0
- package/dist/budo/dojo.api.js +46 -0
- package/dist/budo/dojo.d.ts +72 -0
- package/dist/budo/dojo.js +300 -0
- package/dist/budo/judo.d.ts +61 -0
- package/dist/budo/judo.js +109 -0
- package/dist/budo/karate.d.ts +29 -0
- package/dist/budo/karate.js +80 -0
- package/dist/budo/kendo.d.ts +18 -0
- package/dist/budo/kendo.js +44 -0
- package/dist/budo/kimarite.d.ts +19 -0
- package/dist/budo/kimarite.js +33 -0
- package/dist/budo/kit.d.ts +16 -0
- package/dist/budo/kit.js +24 -0
- package/dist/budo/kyudo.d.ts +28 -0
- package/dist/budo/kyudo.js +66 -0
- package/dist/budo/looks.d.ts +28 -0
- package/dist/budo/looks.js +58 -0
- package/dist/budo/parts.d.ts +32 -0
- package/dist/budo/parts.js +10 -0
- package/dist/budo/plan.d.ts +64 -0
- package/dist/budo/plan.js +139 -0
- package/dist/budo/room.d.ts +133 -0
- package/dist/budo/room.js +111 -0
- package/dist/budo/sumo.d.ts +31 -0
- package/dist/budo/sumo.js +71 -0
- package/dist/budo/tatami.d.ts +55 -0
- package/dist/budo/tatami.js +156 -0
- package/dist/budo/types.d.ts +192 -0
- package/dist/budo/types.js +2 -0
- package/dist/budo-entry.d.ts +22 -0
- package/dist/budo-entry.js +13 -0
- package/dist/budo.board.d.ts +28 -0
- package/dist/budo.board.js +81 -0
- package/dist/budo.score.d.ts +18 -0
- package/dist/budo.score.js +52 -0
- package/dist/budo.style.d.ts +6 -0
- package/dist/budo.style.js +67 -0
- package/dist/charts-entry.d.ts +6 -1
- package/dist/charts-entry.js +3 -0
- package/dist/charts.athletics.d.ts +183 -0
- package/dist/charts.athletics.js +455 -0
- package/dist/charts.baseball.js +1 -1
- package/dist/charts.curling.heat.d.ts +24 -0
- package/dist/charts.curling.heat.js +116 -0
- package/dist/charts.curling.js +14 -3
- package/dist/charts.js +4 -4
- package/dist/charts.pool.d.ts +67 -0
- package/dist/charts.pool.js +76 -0
- package/dist/charts.skating.d.ts +204 -0
- package/dist/charts.skating.js +426 -0
- package/dist/charts.soccer.js +3 -3
- package/dist/charts.types.d.ts +63 -1
- package/dist/colour.d.ts +4 -4
- package/dist/colour.js +4 -4
- package/dist/court.d.ts +85 -2
- package/dist/court.js +102 -7
- package/dist/court.more.d.ts +46 -0
- package/dist/court.more.js +219 -0
- package/dist/courts.style.d.ts +14 -2
- package/dist/courts.style.js +51 -4
- package/dist/crowd.d.ts +164 -0
- package/dist/crowd.draw.d.ts +17 -0
- package/dist/crowd.draw.js +204 -0
- package/dist/crowd.js +480 -0
- package/dist/crowd.park.d.ts +19 -0
- package/dist/crowd.park.js +153 -0
- package/dist/curling.stats.d.ts +271 -0
- package/dist/curling.stats.js +301 -0
- package/dist/draw.d.ts +16 -0
- package/dist/draw.js +462 -54
- package/dist/element-entry.d.ts +3 -1
- package/dist/element-entry.js +2 -1
- package/dist/element.d.ts +13 -2
- package/dist/element.js +79 -4
- package/dist/emblems-source.d.ts +50 -0
- package/dist/emblems-source.js +56 -0
- package/dist/eras.d.ts +3 -1
- package/dist/eras.js +8 -3
- package/dist/features.js +204 -0
- package/dist/field.data.d.ts +16 -0
- package/dist/field.data.js +50 -0
- package/dist/fields.kit.d.ts +2 -2
- package/dist/fields.types.d.ts +24 -4
- package/dist/formations.js +18 -7
- package/dist/formations.sports.d.ts +8 -0
- package/dist/formations.sports.js +251 -0
- package/dist/frames.providers.js +71 -8
- package/dist/geojson.js +3 -0
- package/dist/geometry-entry.d.ts +2 -1
- package/dist/geometry-entry.js +2 -1
- package/dist/geometry.d.ts +20 -0
- package/dist/geometry.js +78 -1
- package/dist/grounds.d.ts +4 -0
- package/dist/grounds.data.js +12 -0
- package/dist/halls.d.ts +65 -0
- package/dist/halls.js +122 -0
- package/dist/hardwood.d.ts +31 -0
- package/dist/hardwood.js +157 -0
- package/dist/heat.js +21 -13
- package/dist/heat.types.d.ts +5 -0
- package/dist/heat.zones.d.ts +4 -2
- package/dist/heat.zones.js +207 -7
- package/dist/homeside.js +24 -0
- package/dist/index.d.ts +30 -4
- package/dist/index.js +18 -2
- package/dist/layers-entry.d.ts +2 -1
- package/dist/layers-entry.js +1 -0
- package/dist/layers.d.ts +2 -1
- package/dist/layers.env.d.ts +12 -1
- package/dist/layers.env.js +36 -4
- package/dist/layers.js +32 -13
- package/dist/layers.types.d.ts +9 -2
- package/dist/leagues/athletics.d.ts +63 -0
- package/dist/leagues/athletics.js +87 -0
- package/dist/leagues/budo.d.ts +196 -0
- package/dist/leagues/budo.js +105 -0
- package/dist/leagues/courts.d.ts +269 -4
- package/dist/leagues/courts.js +155 -1
- package/dist/leagues/hockey.js +41 -19
- package/dist/leagues/skating.d.ts +145 -0
- package/dist/leagues/skating.js +73 -0
- package/dist/leagues/sources.js +41 -0
- package/dist/leagues/types.d.ts +1 -1
- package/dist/leagues-entry.d.ts +4 -2
- package/dist/leagues-entry.js +2 -1
- package/dist/leagues.d.ts +17 -4
- package/dist/leagues.js +246 -5
- package/dist/lineup.codes.d.ts +23 -0
- package/dist/lineup.codes.js +122 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.js +47 -0
- package/dist/look.d.ts +3 -3
- package/dist/look.js +39 -6
- package/dist/outline.d.ts +1 -1
- package/dist/outline.js +46 -4
- package/dist/pageant.d.ts +120 -0
- package/dist/pageant.draw.d.ts +21 -0
- package/dist/pageant.draw.js +171 -0
- package/dist/pageant.js +211 -0
- package/dist/pageant.style.d.ts +8 -0
- package/dist/pageant.style.js +42 -0
- package/dist/png.d.ts +8 -1
- package/dist/png.js +21 -1
- package/dist/pointer-entry.d.ts +2 -0
- package/dist/pointer-entry.js +2 -0
- package/dist/pointer.d.ts +113 -0
- package/dist/pointer.js +151 -0
- package/dist/pool.d.ts +176 -0
- package/dist/pool.figures.d.ts +306 -0
- package/dist/pool.figures.js +148 -0
- package/dist/pool.js +304 -0
- package/dist/pool.kit.d.ts +48 -0
- package/dist/pool.kit.js +141 -0
- package/dist/pool.labels.d.ts +20 -0
- package/dist/pool.labels.js +258 -0
- package/dist/pool.race.d.ts +65 -0
- package/dist/pool.race.js +140 -0
- package/dist/pool.replay.d.ts +46 -0
- package/dist/pool.replay.js +127 -0
- package/dist/pool.section.d.ts +13 -0
- package/dist/pool.section.js +83 -0
- package/dist/pool.style.d.ts +20 -0
- package/dist/pool.style.js +169 -0
- package/dist/pool.types.d.ts +145 -0
- package/dist/pool.types.js +3 -0
- package/dist/pool.words.d.ts +13 -0
- package/dist/pool.words.js +101 -0
- package/dist/ranges.names.js +53 -3
- package/dist/replay-entry.d.ts +3 -0
- package/dist/replay-entry.js +2 -0
- package/dist/restyle.js +1 -1
- package/dist/road.draw.js +3 -2
- package/dist/road.js +2 -1
- package/dist/road.types.d.ts +3 -0
- package/dist/rules.d.ts +138 -0
- package/dist/rules.js +511 -0
- package/dist/rules.types.d.ts +4 -0
- package/dist/rules.types.js +64 -0
- package/dist/score.d.ts +3 -0
- package/dist/score.js +93 -6
- package/dist/sheet.d.ts +3 -0
- package/dist/sheet.js +7 -3
- package/dist/situation.d.ts +135 -0
- package/dist/situation.draw.d.ts +34 -0
- package/dist/situation.draw.js +202 -0
- package/dist/situation.js +337 -0
- package/dist/situation.style.d.ts +2 -0
- package/dist/situation.style.js +45 -0
- package/dist/situation.types.d.ts +77 -0
- package/dist/situation.types.js +3 -0
- package/dist/situation.widgets.d.ts +39 -0
- package/dist/situation.widgets.js +129 -0
- package/dist/skating/describe.d.ts +7 -0
- package/dist/skating/describe.js +44 -0
- package/dist/skating/events.d.ts +24 -0
- package/dist/skating/events.js +47 -0
- package/dist/skating/figure.d.ts +24 -0
- package/dist/skating/figure.js +37 -0
- package/dist/skating/long.d.ts +54 -0
- package/dist/skating/long.js +111 -0
- package/dist/skating/parts.d.ts +43 -0
- package/dist/skating/parts.js +40 -0
- package/dist/skating/plan.d.ts +55 -0
- package/dist/skating/plan.js +197 -0
- package/dist/skating/short.d.ts +47 -0
- package/dist/skating/short.js +89 -0
- package/dist/skating/track.d.ts +66 -0
- package/dist/skating/track.js +94 -0
- package/dist/skating/types.d.ts +57 -0
- package/dist/skating/types.js +3 -0
- package/dist/skating-entry.d.ts +17 -0
- package/dist/skating-entry.js +11 -0
- package/dist/skating.style.d.ts +4 -0
- package/dist/skating.style.js +24 -0
- package/dist/strings.d.ts +470 -0
- package/dist/strings.js +674 -13
- package/dist/style.d.ts +2 -0
- package/dist/style.js +19 -2
- package/dist/surfaces/artistic.d.ts +9 -0
- package/dist/surfaces/artistic.js +94 -0
- package/dist/surfaces/athletics.d.ts +16 -0
- package/dist/surfaces/athletics.js +132 -0
- package/dist/surfaces/baseball.js +17 -0
- package/dist/surfaces/basketball.floor.d.ts +27 -0
- package/dist/surfaces/basketball.floor.js +83 -0
- package/dist/surfaces/basketball.gear.d.ts +27 -0
- package/dist/surfaces/basketball.gear.js +90 -0
- package/dist/surfaces/basketball.js +44 -22
- package/dist/surfaces/budo.d.ts +6 -0
- package/dist/surfaces/budo.js +104 -0
- package/dist/surfaces/curling.d.ts +16 -0
- package/dist/surfaces/curling.fold.d.ts +67 -0
- package/dist/surfaces/curling.fold.js +107 -0
- package/dist/surfaces/curling.js +37 -3
- package/dist/surfaces/dive.d.ts +9 -0
- package/dist/surfaces/dive.js +128 -0
- package/dist/surfaces/field.d.ts +7 -2
- package/dist/surfaces/field.js +15 -9
- package/dist/surfaces/football.js +7 -0
- package/dist/surfaces/hockey.js +4 -2
- package/dist/surfaces/net.d.ts +2 -1
- package/dist/surfaces/net.js +160 -15
- package/dist/surfaces/polo.d.ts +12 -0
- package/dist/surfaces/polo.js +159 -0
- package/dist/surfaces/pool.d.ts +27 -0
- package/dist/surfaces/pool.js +198 -0
- package/dist/surfaces/skating.d.ts +6 -0
- package/dist/surfaces/skating.js +62 -0
- package/dist/surfaces/soccer.js +2 -1
- package/dist/surfaces/surface.d.ts +76 -0
- package/dist/surfaces/venue.d.ts +15 -0
- package/dist/surfaces/venue.js +95 -0
- package/dist/target-entry.d.ts +2 -0
- package/dist/target-entry.js +2 -0
- package/dist/target.d.ts +200 -0
- package/dist/target.js +525 -0
- package/dist/team.common.d.ts +1 -1
- package/dist/team.common.js +3 -3
- package/dist/team.formation.d.ts +3 -1
- package/dist/team.formation.js +3 -3
- package/dist/team.layers.d.ts +2 -2
- package/dist/team.layers.js +4 -1
- package/dist/team.lineup.d.ts +27 -0
- package/dist/team.lineup.js +207 -0
- package/dist/team.network.js +6 -5
- package/dist/team.shape.js +5 -5
- package/dist/team.types.d.ts +40 -1
- package/dist/tenants.d.ts +77 -0
- package/dist/tenants.data.d.ts +8 -0
- package/dist/tenants.data.js +1793 -0
- package/dist/tenants.js +46 -0
- package/dist/turn-entry.d.ts +12 -0
- package/dist/turn-entry.js +7 -0
- package/dist/turn.camera.d.ts +116 -0
- package/dist/turn.camera.js +184 -0
- package/dist/turn.dom.d.ts +40 -0
- package/dist/turn.dom.js +353 -0
- package/dist/turn.kit.d.ts +86 -0
- package/dist/turn.kit.js +110 -0
- package/dist/turn.markup.d.ts +48 -0
- package/dist/turn.markup.js +108 -0
- package/dist/turn.model.d.ts +78 -0
- package/dist/turn.model.js +91 -0
- package/dist/turn.style.d.ts +5 -0
- package/dist/turn.style.js +56 -0
- package/dist/types.d.ts +221 -20
- package/dist/units.d.ts +1 -1
- package/dist/units.js +22 -1
- package/dist/uprights.board.d.ts +17 -0
- package/dist/uprights.board.js +59 -0
- package/dist/uprights.budo.d.ts +17 -0
- package/dist/uprights.budo.js +87 -0
- package/dist/uprights.d.ts +37 -0
- package/dist/uprights.fields.d.ts +32 -0
- package/dist/uprights.fields.js +172 -0
- package/dist/uprights.goal.d.ts +49 -0
- package/dist/uprights.goal.js +69 -0
- package/dist/uprights.js +169 -0
- package/dist/uprights.more.d.ts +7 -0
- package/dist/uprights.more.js +183 -0
- package/dist/uprights.net.d.ts +12 -0
- package/dist/uprights.net.js +109 -0
- package/dist/uprights.netkit.d.ts +28 -0
- package/dist/uprights.netkit.js +67 -0
- package/dist/uprights.pools.d.ts +8 -0
- package/dist/uprights.pools.js +190 -0
- package/dist/uprights.rinks.d.ts +27 -0
- package/dist/uprights.rinks.js +106 -0
- package/dist/uprights.track.d.ts +50 -0
- package/dist/uprights.track.js +246 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/zones-entry.d.ts +2 -0
- package/dist/zones-entry.js +2 -0
- package/package.json +56 -3
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { Background } from "./background.ts";
|
|
2
|
+
import type { EmblemRef, EmblemRenderer } from "./emblems-source.ts";
|
|
2
3
|
import type { Layer } from "./layers.types.ts";
|
|
3
4
|
import type { Unit } from "./units.ts";
|
|
4
5
|
import type { SoccerFrame, SoccerProviderId } from "./surfaces/soccer-providers.ts";
|
|
5
6
|
import type { SoccerPitchId, SoccerSize } from "./surfaces/soccer-spec.ts";
|
|
6
7
|
import type { Frame } from "./frames.ts";
|
|
8
|
+
import type { PoolSport, PoolStyle } from "./pool.types.ts";
|
|
9
|
+
import type { AthleticsStyle } from "./athletics/types.ts";
|
|
10
|
+
import type { SkatingStyle } from "./skating/types.ts";
|
|
11
|
+
import type { Situation } from "./situation.types.ts";
|
|
12
|
+
import type { BudoStyle, DojoSpec, BudoScore } from "./budo/types.ts";
|
|
7
13
|
/** The field sports: lacrosse (the field and the box), rugby (union and league), Australian football, Gaelic football and hurling, cricket, field hockey and team handball. */
|
|
8
14
|
export type FieldSport = "lacrosse" | "rugby" | "afl" | "gaelic" | "cricket" | "fieldhockey" | "handball";
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
export type { PoolSport, PoolStyle };
|
|
16
|
+
/** The budō: the contest areas of judo and karate, the kendo shiai-jo, the sumo dohyō, the kyūdōjō, and a dojo of tatami. */
|
|
17
|
+
export type BudoSport = "judo" | "karate" | "kendo" | "sumo" | "kyudo" | "dojo";
|
|
18
|
+
export type { BudoStyle, DojoSpec, BudoScore };
|
|
19
|
+
/** The surfaces: three football fields, a rink, a court, a ballpark, a soccer pitch, a curling sheet, twelve net, racket and court sports (tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet and netball), four pools (swimming, water polo, diving and artistic swimming), seven field sports (lacrosse, rugby, Australian football, Gaelic football and hurling, cricket, field hockey and handball) and the athletics stadium (the 400 m track with its infield, and the covered 200 m track). */
|
|
20
|
+
export type Sport = "nfl" | "cfl" | "ifaf" | "nhl" | "nba" | "mlb" | "soccer" | "curling" | "tennis" | "volleyball" | "badminton" | "pickleball" | "tabletennis" | "padel" | "squash" | "racquetball" | "sepaktakraw" | "teqball" | "roundnet" | "netball" | PoolSport | FieldSport | "athletics" | "skating" | BudoSport;
|
|
11
21
|
/** `auto` follows the device's light or dark setting (and `data-theme` on the page's root), the others force one. */
|
|
12
22
|
export type Theme = "auto" | "light" | "dark";
|
|
13
23
|
/** The language of the words the drawing says itself: its title, its description and its status labels. */
|
|
@@ -91,7 +101,7 @@ export interface GoalInfo {
|
|
|
91
101
|
line: number;
|
|
92
102
|
}
|
|
93
103
|
/** The looks a drawing can have, alongside `court` (a basketball court's own). See `LOOKS`. */
|
|
94
|
-
export type LookName = "grass" | "night" | "chalkboard" | "blueprint" | "print" | "broadcast" | "high-contrast";
|
|
104
|
+
export type LookName = "grass" | "night" | "chalkboard" | "blueprint" | "print" | "broadcast" | "high-contrast" | "line-drawing";
|
|
95
105
|
/** The width of the lines: a multiple of the width they are drawn at (`2`, or `{ scale: 2 }`), or an absolute width in `units` (`{ width: 0.5 }`). */
|
|
96
106
|
export type LineWidth = number | {
|
|
97
107
|
scale: number;
|
|
@@ -220,21 +230,100 @@ export interface CourtStyle {
|
|
|
220
230
|
baselineInk?: string;
|
|
221
231
|
/** Paint the area inside the three-point line in the key's colour. */
|
|
222
232
|
paintThreePoint?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* A realistic floor: maple boards that run the length of the court with staggered ends, grain and tone, stained keys and centre circle with the wood showing through,
|
|
235
|
+
* a stained border with a baseline in each team's colour, the baskets seen from above with their shadows, and a satin sheen. `true` for the defaults, or the options
|
|
236
|
+
* (`HardwoodOptions`). Off by default, and then the drawing is byte for byte as before. See `docs/hardwood.md`.
|
|
237
|
+
*/
|
|
238
|
+
hardwood?: boolean | HardwoodOptions;
|
|
239
|
+
/** The colour of the border behind each baseline (`[left, right]`, or one for both) on a `hardwood` floor: a team's colour by default, else the border's. */
|
|
240
|
+
baselineColor?: string | [string, string];
|
|
241
|
+
/** Words along the sidelines, in the border of a `hardwood` floor: one text for both, or `[top, bottom]`. */
|
|
242
|
+
sidelineText?: string | [string, string];
|
|
243
|
+
}
|
|
244
|
+
/** The options of a `hardwood` floor. Every part is optional. */
|
|
245
|
+
export interface HardwoodOptions {
|
|
246
|
+
/** The seed of the boards' lengths and tones and of the grain: the same seed always gives the same floor. 1 by default. */
|
|
247
|
+
seed?: number;
|
|
248
|
+
/**
|
|
249
|
+
* How much is drawn. `fine`: the boards' seams and ends, the grain, the baskets' soft shadows, the table and the benches. `plain`: broad boards and one shadow, for a
|
|
250
|
+
* thumbnail. `auto` (the default) is `plain` when the drawing has `detail: "simple"` or a `width` under 480 pixels, else `fine`.
|
|
251
|
+
*/
|
|
252
|
+
detail?: "auto" | "fine" | "plain";
|
|
253
|
+
/** The width of a board in inches, 1.5 to 6. 2.25 by default, as a maple strip floor is laid. */
|
|
254
|
+
board?: number;
|
|
255
|
+
/** How much of the paint is stain, 0.3 to 1: the lower, the more wood shows through the keys, the circle and the border. 0.82 by default. */
|
|
256
|
+
stain?: number;
|
|
257
|
+
/** The satin sheen, 0 (none) to 1.5. 1 by default. */
|
|
258
|
+
sheen?: number;
|
|
259
|
+
/** Draw the baskets from above, with the stanchion and its shadows (the usual `goals` choices still apply). On by default. */
|
|
260
|
+
hoops?: boolean;
|
|
261
|
+
/** The coaching box's lines, the scorers' table and the two benches along the bottom sideline. On by default in the `fine` detail. */
|
|
262
|
+
bench?: boolean;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* How much of a curling sheet is shown: all of it (`sheet`), the half from the hog line to the back line (`half`), just the house (`house`), or `folded`: the whole sheet as a strip in the
|
|
266
|
+
* middle with its two houses enlarged beside it, so that the drawing fills a roughly square frame (see `SheetStyle.panels`).
|
|
267
|
+
*/
|
|
268
|
+
export type SheetShow = "sheet" | "half" | "house" | "folded";
|
|
269
|
+
/** An end of a curling sheet: `left` or `right` as the sheet lies wide, or `top` (the left end) and `bottom` (the right end), as a tall sheet's ends are read. */
|
|
270
|
+
export type SheetEnd = Side | "top" | "bottom";
|
|
271
|
+
/** The shape of a venue's stands round the playing surface. */
|
|
272
|
+
export type CrowdShape = "bowl" | "sides" | "horseshoe" | "grandstand";
|
|
273
|
+
/**
|
|
274
|
+
* The stands and the crowd round a surface (`crowd`). Every part is optional. `true` is the sport's usual venue, 85 percent full, with an away end, drawn in detail.
|
|
275
|
+
* See `docs/crowd.md`.
|
|
276
|
+
*/
|
|
277
|
+
export interface CrowdOptions {
|
|
278
|
+
/**
|
|
279
|
+
* The venue: `bowl` (stands on every side), `sides` (the long sides only), `horseshoe` (three sides, the open end at the right, or at the left with `open: "left"`; a
|
|
280
|
+
* ballpark's outfield with a gap at the batter's eye) or `grandstand` (a ballpark's infield stands only). Each sport has its usual one.
|
|
281
|
+
*/
|
|
282
|
+
shape?: CrowdShape;
|
|
283
|
+
/** The end of a `horseshoe` that is open: `right` (the usual) or `left`. */
|
|
284
|
+
open?: "left" | "right";
|
|
285
|
+
/**
|
|
286
|
+
* What a soccer pitch is inside. `auto` (the default) is a stadium of its own for most grounds and a gridiron stadium for the NFL's and the CFL's, where the stands keep a
|
|
287
|
+
* football field's footprint and the pitch stands inside it; `purpose`, `nfl` and `cfl` choose. The footprint is drawn faintly so that the gap is seen.
|
|
288
|
+
*/
|
|
289
|
+
stadium?: "auto" | "purpose" | "nfl" | "cfl";
|
|
290
|
+
/** How full the stands are, 0 to 1: the share of seats with someone in them. 0.85 by default. Over `attendance`. */
|
|
291
|
+
density?: number;
|
|
292
|
+
/** The people in the stands, with `capacity` the seats: the density is their quotient. A ground's `capacity` is the default for soccer; without one, the seats the drawing's stands have. */
|
|
293
|
+
attendance?: number;
|
|
294
|
+
capacity?: number;
|
|
295
|
+
/** The seed of the crowd: the same seed is always the same crowd. 1 by default. */
|
|
296
|
+
seed?: number;
|
|
297
|
+
/** The home fans' colour and the visitors': the teams' colours of a score, else the sides' colours. */
|
|
298
|
+
home?: string;
|
|
299
|
+
away?: string;
|
|
300
|
+
/** Where the visitors sit: `auto` (the sport's usual place), `left`, `right`, `corner` (a block in a corner), or `none`. */
|
|
301
|
+
awayEnd?: "auto" | "left" | "right" | "corner" | "none";
|
|
302
|
+
/** A tifo or card display in the colours of a team, in a block of the lower stands behind a goal: `home`, `away`, `both` or `false`. Off by default. */
|
|
303
|
+
tifo?: boolean | "home" | "away" | "both";
|
|
304
|
+
/** `stripes` (the usual) or `checks`. */
|
|
305
|
+
tifoDesign?: "stripes" | "checks";
|
|
306
|
+
/** Tunnels, the benches' places and the camera platform of the media side. On by default. */
|
|
307
|
+
gaps?: boolean;
|
|
308
|
+
/** The roof's edge throws a shade on the last rows of the upper tier. On by default. */
|
|
309
|
+
roof?: boolean;
|
|
310
|
+
/** A ballpark's seats on top of a wall: `true` for every wall of the park's data that is 25 feet or more (and has a `walls` entry), `false` for none, and by default the walls the package knows have seats (Fenway Park's Green Monster). */
|
|
311
|
+
wallSeats?: boolean;
|
|
312
|
+
/** How much is drawn: `fine` (the crowd as heads and shoulders, empty seats, aisles), `plain` (blocks of colour), or `auto` (`plain` for `detail: "simple"` or a `width` under 480 pixels). */
|
|
313
|
+
detail?: "auto" | "fine" | "plain";
|
|
223
314
|
}
|
|
224
|
-
/** How much of a curling sheet is shown: all of it, the half from the hog line to the back line, or just the house. */
|
|
225
|
-
export type SheetShow = "sheet" | "half" | "house";
|
|
226
315
|
/**
|
|
227
316
|
* The parts of a surface a drawing can be cropped to (`range`). Football: `red-zone`, `between-the-20s`, `end-zone`, `field-of-play`, `own-half`, `opponent-half`.
|
|
228
317
|
* Hockey: `offensive-zone`, `defensive-zone`, `neutral-zone`, `half`. Basketball: `half-court`, `paint`. Soccer: `half`, `final-third`, `defensive-third`, `middle-third`,
|
|
229
|
-
* `penalty-area`. Baseball: `infield`, `outfield`. The net sports: `half-court`. Curling: `sheet`, `half`, `house`. Rugby: `half`, `twenty-two` (union) or `twenty` (league), `in-goal`. Lacrosse: `half`, `crease`. Australian football: `half`, `forward-fifty`, `centre-square`.
|
|
230
|
-
* Gaelic games: `half`, `large-rectangle`. Cricket: `pitch`, `circle`. Field hockey: `half`, `circle`, `twenty-three`. Handball: `half`, `goal-area`. `RANGES` lists them for each sport.
|
|
318
|
+
* `penalty-area`. Baseball: `infield`, `outfield`. The net sports: `half-court`. Curling: `sheet`, `half`, `house`, `folded`. Rugby: `half`, `twenty-two` (union) or `twenty` (league), `in-goal`. Lacrosse: `half`, `crease`. Australian football: `half`, `forward-fifty`, `centre-square`.
|
|
319
|
+
* Gaelic games: `half`, `large-rectangle`. Cricket: `pitch`, `circle`. Field hockey: `half`, `circle`, `twenty-three`. Handball: `half`, `goal-area`. Swimming: `half`, `pool-end`. Water polo: `half`, `goal-area`. Diving: `springboards`, `platforms`. Artistic swimming: `half`, `centre-stage`. Judo and karate: `contest-area`, `start`. Sumo: `ring`. Kyudo: `shajo`, `yamichi`, `azuchi`. Dojo: `kamiza`, `half`. Athletics: `bend`, `home-straight`, `back-straight`, `finish`, `start`, `infield`, a field event (`high-jump`, `pole-vault`, `long-jump`, `triple-jump`, `shot-put`, `discus-throw`, `hammer-throw`, `javelin-throw`) and `water-jump`. `RANGES` lists them for each sport.
|
|
231
320
|
*/
|
|
232
|
-
export type RangeName = "red-zone" | "between-the-20s" | "end-zone" | "field-of-play" | "own-half" | "opponent-half" | "offensive-zone" | "defensive-zone" | "neutral-zone" | "half" | "half-court" | "paint" | "final-third" | "defensive-third" | "middle-third" | "penalty-area" | "infield" | "outfield" | "sheet" | "house" | "in-goal" | "twenty-two" | "twenty" | "crease" | "forward-fifty" | "centre-square" | "large-rectangle" | "pitch" | "circle" | "twenty-three" | "goal-area";
|
|
321
|
+
export type RangeName = "red-zone" | "between-the-20s" | "end-zone" | "field-of-play" | "own-half" | "opponent-half" | "offensive-zone" | "defensive-zone" | "neutral-zone" | "half" | "half-court" | "paint" | "final-third" | "defensive-third" | "middle-third" | "penalty-area" | "infield" | "outfield" | "sheet" | "house" | "folded" | "in-goal" | "twenty-two" | "twenty" | "crease" | "forward-fifty" | "centre-square" | "large-rectangle" | "pitch" | "circle" | "twenty-three" | "goal-area" | "pool-end" | "springboards" | "platforms" | "centre-stage" | "bend" | "home-straight" | "back-straight" | "finish" | "start" | "infield" | "high-jump" | "pole-vault" | "long-jump" | "triple-jump" | "shot-put" | "discus-throw" | "hammer-throw" | "javelin-throw" | "water-jump" | "crossing-straight" | "first-bend" | "second-bend" | "judges" | "kiss-and-cry" | "contest-area" | "ring" | "shajo" | "yamichi" | "azuchi" | "kamiza";
|
|
233
322
|
/** A named range at the end of your choice: `{ name: "offensive-zone", end: "left" }` is the offensive zone of a team that attacks the left. */
|
|
234
323
|
export interface RangeNamed {
|
|
235
324
|
name: RangeName;
|
|
236
|
-
/** The end of the surface the range is at, as the surface is drawn wide: `left` or `right
|
|
237
|
-
end?:
|
|
325
|
+
/** The end of the surface the range is at, as the surface is drawn wide: `left` or `right` (a curling sheet's also `top` and `bottom`: the left end and the right). Each range has its own default (`RANGES`); a range with no end ignores it. */
|
|
326
|
+
end?: SheetEnd;
|
|
238
327
|
}
|
|
239
328
|
/**
|
|
240
329
|
* A box of your own to crop to: the corners `x0, y0` and `x1, y1`, in the drawing's frame (feet, or `units`: x along the surface from the left, y across it from the top;
|
|
@@ -273,10 +362,14 @@ export interface SheetStyle {
|
|
|
273
362
|
pebble?: boolean;
|
|
274
363
|
/** Shade the free guard zone at both ends: the ground between the hog line and the tee line, outside the house. Off by default. */
|
|
275
364
|
guardZone?: boolean;
|
|
276
|
-
/** How much of the sheet to show. A bare sheet only; a score always shows all of it. `sheet` by default. `range` says the same (`range: "house"`) and wins. */
|
|
365
|
+
/** How much of the sheet to show. A bare sheet only; a score always shows all of it. `sheet` by default. `range` says the same (`range: "house"`) and wins. `folded` is the whole sheet with both houses enlarged beside it. */
|
|
277
366
|
show?: SheetShow;
|
|
278
|
-
/** Which end `show: "half"` and `show: "house"` show: the `left` one (the top house of a tall drawing, the default) or the `right
|
|
279
|
-
end?:
|
|
367
|
+
/** Which end `show: "half"` and `show: "house"` show: the `left` one (the top house of a tall drawing, the default) or the `right`; `top` and `bottom` say the same for a tall sheet (`top` is the left end). */
|
|
368
|
+
end?: SheetEnd;
|
|
369
|
+
/** What each enlarged panel of `show: "folded"` holds: the `half` from the hog line to the back line, with the free guard zone (the default), or just the `house`. */
|
|
370
|
+
panels?: "half" | "house";
|
|
371
|
+
/** The shape of the frame `show: "folded"` fills: width over height as the drawing lies, 1 (square) by default; the panels are as large as that allows. */
|
|
372
|
+
fit?: number;
|
|
280
373
|
}
|
|
281
374
|
/** The named looks of a tennis court: the colour of its surface and of the ground round it. */
|
|
282
375
|
export type TennisLook = "hard-blue" | "hard-green" | "clay" | "grass";
|
|
@@ -288,16 +381,31 @@ export type BadmintonLook = "green" | "blue" | "wood";
|
|
|
288
381
|
export type PickleballLook = "blue-green" | "green" | "red";
|
|
289
382
|
/** The named looks of a table tennis table. */
|
|
290
383
|
export type TableTennisLook = "blue" | "green";
|
|
384
|
+
/** The named looks of a padel court: the colours the FIP's rules prefer for the floor. */
|
|
385
|
+
export type PadelLook = "blue" | "green" | "terracotta";
|
|
386
|
+
/** The named looks of a squash court. */
|
|
387
|
+
export type SquashLook = "wood" | "blue";
|
|
388
|
+
/** The named looks of a racquetball court: the lines are the IRF's recommended red, or blue on a convertible court. */
|
|
389
|
+
export type RacquetballLook = "wood" | "convertible";
|
|
390
|
+
/** The named looks of a sepak takraw court. */
|
|
391
|
+
export type SepakTakrawLook = "blue" | "green" | "wood";
|
|
392
|
+
/** The named looks of a teqball court. */
|
|
393
|
+
export type TeqballLook = "grey" | "blue" | "green";
|
|
394
|
+
/** The named looks of a roundnet court. */
|
|
395
|
+
export type RoundnetLook = "grass" | "sand" | "indoor";
|
|
396
|
+
/** The named looks of a netball court. */
|
|
397
|
+
export type NetballLook = "wood" | "blue" | "green";
|
|
291
398
|
/**
|
|
292
|
-
* The look and the variants of a net sport's court (tennis, volleyball, badminton, pickleball, table tennis
|
|
399
|
+
* The look and the variants of a net sport's court (tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet
|
|
400
|
+
* and netball). Every part is optional.
|
|
293
401
|
* The lines and the sizes are the rulebook's whatever the look; a look is the colour of the ground and of the surface.
|
|
294
402
|
*/
|
|
295
403
|
export interface NetStyle {
|
|
296
|
-
/** A named look: for tennis `hard-blue` (the default), `hard-green`, `clay` or `grass`; volleyball `wood` (the default for indoors) or `blue`, and `sand` for the beach; badminton `green` (the default), `blue` or `wood`; pickleball `blue-green` (the default), `green` or `red`; table tennis `blue` (the default) or `green`. An unknown name is an error that lists them. */
|
|
404
|
+
/** A named look: for tennis `hard-blue` (the default), `hard-green`, `clay` or `grass`; volleyball `wood` (the default for indoors) or `blue`, and `sand` for the beach; badminton `green` (the default), `blue` or `wood`; pickleball `blue-green` (the default), `green` or `red`; table tennis `blue` (the default) or `green`; padel `blue` (the default), `green` or `terracotta`; squash `wood` (the default) or `blue`; racquetball `wood` (the default) or `convertible`; sepak takraw `blue` (the default), `green` or `wood`; teqball `grey` (the default), `blue` or `green`; roundnet `grass` (the default), `sand` or `indoor`; netball `wood` (the default), `blue` or `green`. An unknown name is an error that lists them. */
|
|
297
405
|
look?: string;
|
|
298
406
|
/**
|
|
299
407
|
* The free zone drawn round the court: `official` (the default: the figure a rulebook gives for its own competitions, where it gives one), `least` (the least it allows
|
|
300
|
-
* or recommends) or `none`. Tennis (Appendix X), volleyball and
|
|
408
|
+
* or recommends) or `none`. Tennis (Appendix X), volleyball, beach volleyball and sitting volleyball (Rule 1.1), pickleball (Rule 3.A.3), sepak takraw (Law 1.5) and netball (Rule 1, item 8) give figures; badminton, table tennis, padel, squash, racquetball, teqball and roundnet do not.
|
|
301
409
|
*/
|
|
302
410
|
free?: "official" | "least" | "none";
|
|
303
411
|
/** Tennis: draw the two singles sticks that hold a doubles net up for a singles match, 3 feet outside the singles court (Rule 1). Off by default. */
|
|
@@ -325,6 +433,49 @@ export interface FieldStyle {
|
|
|
325
433
|
}
|
|
326
434
|
/** The shape of a team's mark: its logo as it is (`plain`), or clipped to a circle with a ring (`round`). */
|
|
327
435
|
export type TeamMark = "plain" | "round";
|
|
436
|
+
/** How a pageant lays out each team's picture: `carpet` is its flag or logo laid flat over its half, as a rectangle with a border; `stage` is its crest on a large round disc with a ring. */
|
|
437
|
+
export type PageantStyle = "carpet" | "stage";
|
|
438
|
+
/**
|
|
439
|
+
* The pageant: each team's flag or logo laid out large over its own half of the surface, as a stadium lays giant flags and crests on the pitch for a final's
|
|
440
|
+
* ceremony, and an emblem or a trophy in the centre circle. Give `pageant: "carpet"`, `"stage"` or `true` (a carpet), or these options. Off by default, and a drawing without it is
|
|
441
|
+
* the same text as before. It needs a score (`home` and `away`) and the full or compact size.
|
|
442
|
+
*/
|
|
443
|
+
export interface PageantOptions {
|
|
444
|
+
/** `carpet` (the default) or `stage`. */
|
|
445
|
+
style?: PageantStyle;
|
|
446
|
+
/** A carpet's border band: `dark` (the default), `team` (each team's colour), or a colour. */
|
|
447
|
+
border?: "dark" | "team" | (string & {});
|
|
448
|
+
/** A carpet's border band as a share of its shorter side, 0.02 to 0.15. 0.06 by default. */
|
|
449
|
+
borderWidth?: number;
|
|
450
|
+
/** A carpet's fabric: a gentle, fixed wave of light and shade over it. On by default; left out at small sizes. */
|
|
451
|
+
fabric?: boolean;
|
|
452
|
+
/** Where the surface's lines lie: `over` the pictures (the default), `under` them (the pictures cover the lines), or `through` (under the pictures, which are a little see-through, so that the lines show faintly). */
|
|
453
|
+
lines?: "over" | "under" | "through";
|
|
454
|
+
/** A stage's ring: `gold` (the default), `team` (each team's colour), or a colour. */
|
|
455
|
+
ring?: "gold" | "team" | (string & {});
|
|
456
|
+
/** The picture in the centre circle, centre ice, centre court or at the mound: a competition's emblem or a trophy, as a logo is given (an address, an image `data:` address, an SVG document as text, or, with a renderer of emblems plugged in, the id of one: `"trophy:hockey-cup"`). Yours; none is supplied. */
|
|
457
|
+
emblem?: EmblemRef;
|
|
458
|
+
/** `round` (the default): the emblem on a disc with a ring, as a team's mark. `plain`: the picture as it is, for a trophy with a cut-out outline. */
|
|
459
|
+
emblemShape?: "round" | "plain";
|
|
460
|
+
/** An emblem's fit on its disc: `contain` (the default: shown whole) or `cover` (it fills the disc). */
|
|
461
|
+
emblemFit?: "contain" | "cover";
|
|
462
|
+
/** What the emblem is, for the drawing's description: "World Cup". */
|
|
463
|
+
emblemName?: string;
|
|
464
|
+
/** Where the score goes: `centre` (the plate stays in the middle, a little smaller, and the pictures keep clear of it), `strip` (the compact strip under the drawing) or `auto` (the default: the centre, unless there is an emblem or the sport's board is large, which then go to the strip). */
|
|
465
|
+
score?: "auto" | "centre" | "strip";
|
|
466
|
+
/**
|
|
467
|
+
* How a carpet fills its half: `fill` (the default) takes the room the half gives it with a margin, as a ceremony's flags are made to the size of the half, so its shape may differ from the
|
|
468
|
+
* flag's ratio by up to 2 to 1, and the art is stretched a little and cropped a little (each by the square root of the difference, so stripes stay stripes and a centred emblem stays nearly round);
|
|
469
|
+
* `ratio` keeps the flag's own ratio and leaves the rest of the half bare. A stage is round either way.
|
|
470
|
+
*/
|
|
471
|
+
fit?: "fill" | "ratio";
|
|
472
|
+
/** The size of a carpet or a stage, as a share of the room its half gives it. 0.4 to 1; 1 by default (the room less a margin). */
|
|
473
|
+
scale?: number;
|
|
474
|
+
/** Write each team's name on its picture. By default only a team with no flag or logo has its name (or its initials, when they would not fit). */
|
|
475
|
+
names?: boolean;
|
|
476
|
+
/** An entrance, in CSS only and for people who have not asked for less motion: `unfurl` (a carpet rolls out from its end, a stage grows) or `fade`. `none` by default. */
|
|
477
|
+
animate?: "none" | "unfurl" | "fade";
|
|
478
|
+
}
|
|
328
479
|
/** One team of a score. */
|
|
329
480
|
export interface Team {
|
|
330
481
|
/** The name, as it is to be written: "Harbour City Gulls". */
|
|
@@ -333,8 +484,8 @@ export interface Team {
|
|
|
333
484
|
abbr?: string;
|
|
334
485
|
/** The score. A number, or text such as "–" before the game. */
|
|
335
486
|
score?: number | string;
|
|
336
|
-
/** The logo: an `https:` or relative address, an image `data:` address,
|
|
337
|
-
logo?:
|
|
487
|
+
/** The logo: an `https:` or relative address, an image `data:` address, an SVG document as text, or, with a renderer of emblems plugged in (`useEmblems`), the id of a ready-made emblem: `"crest:shield"` takes the team's `color`, `textColor` and `abbr`. */
|
|
488
|
+
logo?: EmblemRef;
|
|
338
489
|
/**
|
|
339
490
|
* How the logo is drawn: `round` clips it to a circle with a thin ring (a flag, or a crest) and, for a team with no logo, draws its initials on its colour; `plain` is the
|
|
340
491
|
* logo as it is, in a box. The score's `markShape` is the default for both teams.
|
|
@@ -342,13 +493,15 @@ export interface Team {
|
|
|
342
493
|
mark?: TeamMark;
|
|
343
494
|
/** A round mark's fit: `cover` (the default) fills the circle with the picture, as a flag does; `contain` shows a crest whole on a plain disc. */
|
|
344
495
|
markFit?: "cover" | "contain";
|
|
496
|
+
/** The pageant's carpet is as wide as it is tall by this ratio: 1.5 for a flag of 3 to 2. Read from an SVG logo's `viewBox` when missing, else 1.5; held between 1 and 3. */
|
|
497
|
+
logoRatio?: number;
|
|
345
498
|
/** The goals it scored in a penalty shoot-out: shown with the status, and the winner of a level game. */
|
|
346
499
|
penalties?: number | string;
|
|
347
500
|
/** Curling: the points it scored in each end, in order (`null` for an end not played yet; `"X"` for a conceded one). */
|
|
348
501
|
ends?: readonly (number | string | null | undefined)[];
|
|
349
502
|
/** Curling: the team has the hammer, the last stone of the end. A marker is drawn beside its name. */
|
|
350
503
|
hammer?: boolean;
|
|
351
|
-
/**
|
|
504
|
+
/** The net and racket sports (not netball): what it scored in each set (tennis and padel: its games; the others: each game's or set's points), in order; `null` for one not played yet. The set in progress is the last one given. */
|
|
352
505
|
sets?: readonly (number | string | null | undefined)[];
|
|
353
506
|
/** Tennis: the points of a tie-break in each set (the same places as `sets`; `null` where the set had none), written small beside the games. */
|
|
354
507
|
tiebreaks?: readonly (number | string | null | undefined)[];
|
|
@@ -363,6 +516,8 @@ export interface Team {
|
|
|
363
516
|
wickets?: number | string;
|
|
364
517
|
overs?: number | string;
|
|
365
518
|
innings?: readonly (number | string | null | undefined)[];
|
|
519
|
+
/** Judo, karate, kendo and sumo: what the team has scored, as the sport counts it (see `BudoScore`). */
|
|
520
|
+
budo?: BudoScore;
|
|
366
521
|
/** The team's colour, for its end, key or dugout. */
|
|
367
522
|
color?: string;
|
|
368
523
|
/** The colour of the words on that colour. Black or white by the colour's lightness when missing. */
|
|
@@ -411,6 +566,8 @@ export interface SurfaceOptions {
|
|
|
411
566
|
description?: string;
|
|
412
567
|
/** A prefix for the ids inside the drawing. Made from the options when missing, so that the same call gives the same drawing. */
|
|
413
568
|
id?: string;
|
|
569
|
+
/** A renderer of ready-made emblems for this drawing alone, so that a `logo`, an `emblem` or a mark may be an emblem's id: `emblems: renderEmblem` from `@johnmorrisdotca/dougu-sports/emblems`. Over the one the page plugged in with `useEmblems`. */
|
|
570
|
+
emblems?: EmblemRenderer;
|
|
414
571
|
/** The ground to draw round the playing surface, in `units` (feet by default). A default for each sport. */
|
|
415
572
|
margin?: number;
|
|
416
573
|
/**
|
|
@@ -471,16 +628,33 @@ export interface SurfaceOptions {
|
|
|
471
628
|
quirks?: boolean | QuirkOptions;
|
|
472
629
|
/** The look of an NBA court. */
|
|
473
630
|
court?: CourtStyle;
|
|
631
|
+
/**
|
|
632
|
+
* The stands and the crowd round the surface, for a venue that has spectators: a bowl, two sides, a horseshoe or a ballpark's grandstands, with the people as heads and
|
|
633
|
+
* shoulders in the home colours and a visitors' end. `true` for the defaults, or `CrowdOptions`. Off by default, and then the drawing is byte for byte as it was.
|
|
634
|
+
*/
|
|
635
|
+
crowd?: boolean | CrowdOptions;
|
|
474
636
|
/** The size and look of a curling sheet. */
|
|
475
637
|
sheet?: SheetStyle;
|
|
476
|
-
/** The look and the variants of a tennis, volleyball, badminton, pickleball
|
|
638
|
+
/** The look and the variants of a tennis, volleyball, badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet or netball court. */
|
|
477
639
|
net?: NetStyle;
|
|
478
640
|
/** The size and the variants of a lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey or handball surface. */
|
|
479
641
|
field?: FieldStyle;
|
|
642
|
+
/** The pool of a swimming, water polo, diving or artistic swimming drawing: the course and the lanes, the look of the water and the deck, a side section, the lanes of a race with its results and splits, and several pools in one hall. */
|
|
643
|
+
pool?: PoolStyle;
|
|
644
|
+
/** The athletics stadium: the number of lanes, the colour of the track, what is in the infield, the races and the field events marked. See `AthleticsStyle`. */
|
|
645
|
+
athletics?: AthleticsStyle;
|
|
646
|
+
/** The skating rink: the long track's radius and lanes, the short track's tracks, the figure skating rink's size and furniture, the races marked. See `SkatingStyle`; the discipline is the `league`. */
|
|
647
|
+
skating?: SkatingStyle;
|
|
648
|
+
/** The budō surfaces (judo, karate, kendo, sumo, kyudo): the size of the area, the marks, the number of areas, the look. See `BudoStyle`; the rulebook is the `league`. */
|
|
649
|
+
budo?: BudoStyle;
|
|
650
|
+
/** A dojo of tatami (`sport: "dojo"`): the mats, the pattern, the walls, the kamiza. See `DojoSpec` and `dojo()`. */
|
|
651
|
+
dojo?: DojoSpec;
|
|
480
652
|
/** The soccer pitch: a preset (`fifa`, `uefa`, `mls`, `nwsl`, `ncaa`, `law-min`, `law-max`, `9-a-side`, `7-a-side`, `5-a-side`, `futsal`) or a size, `{ length, width, unit }`. The international 105 by 68 m by default. */
|
|
481
653
|
pitch?: SoccerPitchId | SoccerSize;
|
|
482
654
|
/** The soccer ground to draw: a key of `GROUNDS`. The pitch has the size its article publishes (the international 105 by 68 m where none is), and the drawing carries the ground's name for `year`. A `pitch` of your own wins over the ground's size. */
|
|
483
655
|
ground?: string;
|
|
656
|
+
/** The arena to draw an NHL rink or an NBA court of: a key of `ARENAS`. The rink or the court has the size its sources publish where that differs from the league's (the league's where none does), the markings are those of `year`, and the drawing carries the arena's name for `year`. A `league` of your own wins over the arena's size. */
|
|
657
|
+
arena?: string;
|
|
484
658
|
/** Draw a soccer pitch in a data provider's own coordinates (`opta`, `statsbomb`, `wyscout`, `tracab`, `metrica`, `skillcorner`, `secondspectrum`, `impect`, `uefa`, `international`), or in a frame of your own: the lines stand where the provider puts them, and an empty `ky-data` group in its units is put in the drawing for raw data. */
|
|
485
659
|
pitchType?: SoccerProviderId | SoccerFrame;
|
|
486
660
|
/** Only half of a soccer pitch: the `left` half or the `right` one. Ignored when the drawing has teams. `range: "half"` does the same for every sport and for a score too. */
|
|
@@ -503,6 +677,11 @@ export interface SurfaceOptions {
|
|
|
503
677
|
* Unset, the drawing is byte for byte as before. See `BackgroundOptions`.
|
|
504
678
|
*/
|
|
505
679
|
background?: Background;
|
|
680
|
+
/**
|
|
681
|
+
* The pageant: each team's flag or logo laid large over its half (a `carpet`) or on a round disc (a `stage`), with an emblem in the centre. `"carpet"`, `"stage"`, `true` (a carpet) or `PageantOptions`.
|
|
682
|
+
* Off by default; a score drawing only. See `PageantOptions`.
|
|
683
|
+
*/
|
|
684
|
+
pageant?: PageantStyle | boolean | PageantOptions;
|
|
506
685
|
/** A named look: the surface, the lines and the ground round it in one palette, light and dark. See `LOOKS`. Over the theme's colours, under `colors`. */
|
|
507
686
|
look?: LookName;
|
|
508
687
|
/** The width of the lines (see `LineWidth`): a multiple of the width they are drawn at, or an absolute width. */
|
|
@@ -526,6 +705,20 @@ export interface SurfaceOptions {
|
|
|
526
705
|
* under a score's panel), cut to the surface's outline, and described in the drawing's description. See `drawLayers` and `layerTable`.
|
|
527
706
|
*/
|
|
528
707
|
layers?: readonly Layer[];
|
|
708
|
+
/**
|
|
709
|
+
* Write what `clientPointToField` (the `pointer` entry) needs on the drawing's surface group: the box of the playing surface and the options that decide its rules (the league, the
|
|
710
|
+
* season, the park, the pitch). Off by default, so that a drawing without data is the same text as ever; a page that asks where a click is turns it on.
|
|
711
|
+
*/
|
|
712
|
+
pointer?: boolean;
|
|
713
|
+
/** Write `data-mark-id`, `data-index` and `data-zone` on every mark of every data layer, for one listener to link a mark to a table (about 55 bytes a mark). Off by default; a layer whose data has an `id` has them anyway, and `pointer: true` turns them on. */
|
|
714
|
+
marks?: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* The situation of the game, drawn on the surface, in the badge and in the compact card: hockey's skaters (a power play or an empty net as a pill, the attacking zone tinted) and its
|
|
717
|
+
* shootout as a strip of dots across centre ice; baseball's runners (the bases lit), outs, inning and count (a scorebug in the badge); football's down and distance (the line of scrimmage
|
|
718
|
+
* in blue, the first-down line in yellow, the red zone tinted, a tag) and a drive chart. For `nhl`, `mlb`, and the football fields; any other sport, and a special game, draws none.
|
|
719
|
+
* Off by default, and then the drawing is byte for byte as it was. See `docs/situation.md`.
|
|
720
|
+
*/
|
|
721
|
+
situation?: Situation;
|
|
529
722
|
/** `embed` (the default) writes the stylesheet into the drawing so that it stands alone; `none` leaves it to the page. */
|
|
530
723
|
style?: "embed" | "none";
|
|
531
724
|
/** An extra class on the `svg`. */
|
|
@@ -562,4 +755,12 @@ export interface ScoreOptions extends SurfaceOptions {
|
|
|
562
755
|
uppercase?: boolean;
|
|
563
756
|
/** The shape of both teams' marks, unless a team's own `mark` says otherwise: `plain` (the default) or `round`, a flag or logo in a circle with a ring. */
|
|
564
757
|
markShape?: TeamMark;
|
|
758
|
+
/**
|
|
759
|
+
* Where the score goes: `centre` (the panel stands on the middle of the surface), `strip` (the compact strip under the drawing, as a pageant's `score: "strip"` does) or `auto` (the default:
|
|
760
|
+
* the centre, unless the drawing has a `lineup` layer, whose players the panel would hide, and then the strip). The strip also carries the situation's pill, scorebug or tag, which a drawing
|
|
761
|
+
* with a lineup then leaves off the surface. A pageant has its own `pageant.score`, which says it for the drawing.
|
|
762
|
+
*/
|
|
763
|
+
score?: "auto" | "centre" | "strip";
|
|
764
|
+
/** Draw the score's panel (or board) on the surface. On by default; `false` leaves the teams' names and the rest and no panel, as the 3D view does when it hangs the score up as a scoreboard. */
|
|
765
|
+
plate?: boolean;
|
|
565
766
|
}
|
package/dist/units.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const UNITS: readonly Unit[];
|
|
|
7
7
|
export declare const FEET_PER: Readonly<Record<Unit, number>>;
|
|
8
8
|
/**
|
|
9
9
|
* The unit each surface's rulebook states its dimensions in: the NFL's and the CFL's fields in yards (and the IFAF's, which
|
|
10
|
-
* follows them), the NHL's rink, the NBA's court and the baseball field in feet, a soccer pitch in metres (the Laws'), a tennis court and a
|
|
10
|
+
* follows them), the NHL's rink, the NBA's court and the baseball field in feet, a soccer pitch in metres (the Laws'), a tennis court, a pickleball court and a racquetball court in feet (the ITF's, USA Pickleball's and the IRF's), a volleyball court, a badminton court, a table, a padel court, a squash court, a sepak takraw court, a teqball court, a roundnet court and a netball court in metres (FIVB's, BWF's, ITTF's, FIP's, World Squash's, ISTAF's, FITEQ's, the International Roundnet Federation's and World Netball's), a curling sheet in metres (World Curling's rules give metres with feet beside them; Curling Canada's give feet first, and its league `curling-canada` has feet), a rugby field, an Australian football ground, a Gaelic field, a hockey pitch and a handball court in metres (the rulebooks'), a swimming pool, a water polo field, a diving well and an artistic swimming area in metres (World Aquatics') and a cricket ground in yards (the Laws' and the ICC's; the NLL's box floor and the PLL's and the NCAA men's fields are in the leagues' own feet and yards). A Japanese park's fence is measured in
|
|
11
11
|
* metres and converted once: see `parkUnit`.
|
|
12
12
|
*/
|
|
13
13
|
export declare const SURFACE_UNITS: Readonly<Record<Sport, Unit>>;
|
package/dist/units.js
CHANGED
|
@@ -11,7 +11,7 @@ export const FEET_PER = Object.freeze({
|
|
|
11
11
|
});
|
|
12
12
|
/**
|
|
13
13
|
* The unit each surface's rulebook states its dimensions in: the NFL's and the CFL's fields in yards (and the IFAF's, which
|
|
14
|
-
* follows them), the NHL's rink, the NBA's court and the baseball field in feet, a soccer pitch in metres (the Laws'), a tennis court and a
|
|
14
|
+
* follows them), the NHL's rink, the NBA's court and the baseball field in feet, a soccer pitch in metres (the Laws'), a tennis court, a pickleball court and a racquetball court in feet (the ITF's, USA Pickleball's and the IRF's), a volleyball court, a badminton court, a table, a padel court, a squash court, a sepak takraw court, a teqball court, a roundnet court and a netball court in metres (FIVB's, BWF's, ITTF's, FIP's, World Squash's, ISTAF's, FITEQ's, the International Roundnet Federation's and World Netball's), a curling sheet in metres (World Curling's rules give metres with feet beside them; Curling Canada's give feet first, and its league `curling-canada` has feet), a rugby field, an Australian football ground, a Gaelic field, a hockey pitch and a handball court in metres (the rulebooks'), a swimming pool, a water polo field, a diving well and an artistic swimming area in metres (World Aquatics') and a cricket ground in yards (the Laws' and the ICC's; the NLL's box floor and the PLL's and the NCAA men's fields are in the leagues' own feet and yards). A Japanese park's fence is measured in
|
|
15
15
|
* metres and converted once: see `parkUnit`.
|
|
16
16
|
*/
|
|
17
17
|
export const SURFACE_UNITS = Object.freeze({
|
|
@@ -28,6 +28,13 @@ export const SURFACE_UNITS = Object.freeze({
|
|
|
28
28
|
badminton: "m",
|
|
29
29
|
pickleball: "ft",
|
|
30
30
|
tabletennis: "m",
|
|
31
|
+
padel: "m",
|
|
32
|
+
squash: "m",
|
|
33
|
+
racquetball: "ft",
|
|
34
|
+
sepaktakraw: "m",
|
|
35
|
+
teqball: "m",
|
|
36
|
+
roundnet: "m",
|
|
37
|
+
netball: "m",
|
|
31
38
|
lacrosse: "m",
|
|
32
39
|
rugby: "m",
|
|
33
40
|
afl: "m",
|
|
@@ -35,6 +42,20 @@ export const SURFACE_UNITS = Object.freeze({
|
|
|
35
42
|
cricket: "yd",
|
|
36
43
|
fieldhockey: "m",
|
|
37
44
|
handball: "m",
|
|
45
|
+
// The pools: World Aquatics' Competition Regulations print every figure in metres.
|
|
46
|
+
swimming: "m",
|
|
47
|
+
waterpolo: "m",
|
|
48
|
+
diving: "m",
|
|
49
|
+
artisticswimming: "m",
|
|
50
|
+
athletics: "m",
|
|
51
|
+
skating: "m",
|
|
52
|
+
// The budō: the federations print their figures in metres (the kyūdōjō's and the dohyō's too), and a dojo is counted in mats of metres.
|
|
53
|
+
judo: "m",
|
|
54
|
+
karate: "m",
|
|
55
|
+
kendo: "m",
|
|
56
|
+
sumo: "m",
|
|
57
|
+
kyudo: "m",
|
|
58
|
+
dojo: "m",
|
|
38
59
|
});
|
|
39
60
|
/** True when `unit` is one of the six. */
|
|
40
61
|
export const isUnit = (unit) => typeof unit === "string" && Object.prototype.hasOwnProperty.call(FEET_PER, unit);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Upright } from "./turn.kit.ts";
|
|
2
|
+
/** Where the board goes: `hung` over the middle, or `standing` behind an end (behind centre field in a ballpark). */
|
|
3
|
+
export declare const boardKind: (sport: string) => "hung" | "standing";
|
|
4
|
+
/** What a badge drawing is, taken apart: its size, the attributes of its root (the colours and the look, which its rules read) and what is drawn in it. */
|
|
5
|
+
export declare function badgeParts(svg: string): {
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
attrs: string;
|
|
9
|
+
inner: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
/** The scoreboard of a surface: its badge on a board, hung or standing, as one plane that faces the eye. */
|
|
12
|
+
export declare function scoreboard(badge: string, sport: string, area: {
|
|
13
|
+
x0: number;
|
|
14
|
+
y0: number;
|
|
15
|
+
x1: number;
|
|
16
|
+
y1: number;
|
|
17
|
+
}, thin: number): Upright | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// The score, stood up: in the 3D view the score is not a panel lying on the floor but a scoreboard. A court or a rink has one hung over its middle on cables; a
|
|
2
|
+
// field has one standing behind an end (a ballpark's behind centre field). It is the score's badge (the compact strip `size: "badge"` draws) on a dark board that
|
|
3
|
+
// turns to face the eye, so that it can be read from wherever the view is. Nothing here is a rule: the sizes and the heights are ours.
|
|
4
|
+
import { plane, n } from "./turn.kit.js";
|
|
5
|
+
/** The sports that hang their board over the middle: the indoor ones with a floor in the middle of a hall. */
|
|
6
|
+
const HUNG = ["nba", "nhl", "volleyball", "badminton", "handball", "tennis", "pickleball", "sepaktakraw", "netball"];
|
|
7
|
+
/** Where the board goes: `hung` over the middle, or `standing` behind an end (behind centre field in a ballpark). */
|
|
8
|
+
export const boardKind = (sport) => (HUNG.includes(sport) ? "hung" : "standing");
|
|
9
|
+
/** What a badge drawing is, taken apart: its size, the attributes of its root (the colours and the look, which its rules read) and what is drawn in it. */
|
|
10
|
+
export function badgeParts(svg) {
|
|
11
|
+
const root = /^<svg\s([^>]*)>/.exec(svg);
|
|
12
|
+
if (root === null)
|
|
13
|
+
return undefined;
|
|
14
|
+
const box = /viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(root[1]);
|
|
15
|
+
if (box === null)
|
|
16
|
+
return undefined;
|
|
17
|
+
const keep = [...root[1].matchAll(/([\w:-]+)="([^"]*)"/g)]
|
|
18
|
+
.filter(([, name]) => !/^(xmlns|viewBox|width|height|role|aria-labelledby|class|part|data-version)$/.test(name))
|
|
19
|
+
.map(([, name, value]) => `${name}="${value}"`)
|
|
20
|
+
.join(" ");
|
|
21
|
+
const inner = svg
|
|
22
|
+
.slice(root[0].length, svg.lastIndexOf("</svg>"))
|
|
23
|
+
.replace(/<title[\s\S]*?<\/title>/, "")
|
|
24
|
+
.replace(/<desc[\s\S]*?<\/desc>/, "")
|
|
25
|
+
.replace(/<style[\s\S]*?<\/style>/, "");
|
|
26
|
+
return { w: Number(box[1]), h: Number(box[2]), attrs: keep, inner };
|
|
27
|
+
}
|
|
28
|
+
/** The scoreboard of a surface: its badge on a board, hung or standing, as one plane that faces the eye. */
|
|
29
|
+
export function scoreboard(badge, sport, area, thin) {
|
|
30
|
+
const parts = badgeParts(badge);
|
|
31
|
+
if (parts === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
const L = area.x1 - area.x0;
|
|
34
|
+
const W = area.y1 - area.y0;
|
|
35
|
+
const kind = boardKind(sport);
|
|
36
|
+
// The board: as wide as a third of a court's length or nearly half a field's width, and a third as tall, with the badge inside a margin.
|
|
37
|
+
const wide = kind === "hung" ? Math.min(0.3 * L, 44) : sport === "tabletennis" ? 0.6 * L : sport === "mlb" ? 0.24 * L : Math.min(0.36 * W, 80);
|
|
38
|
+
const tall = wide * 0.32;
|
|
39
|
+
const margin = wide * 0.025;
|
|
40
|
+
const scale = (wide - 2 * margin) / parts.w;
|
|
41
|
+
const lift = kind === "hung" ? Math.min(30, 12 + 0.1 * L) : tall * 0.9;
|
|
42
|
+
// Hung: cables from the board's top corners up; standing: legs from its bottom corners down to the ground.
|
|
43
|
+
const extra = kind === "hung" ? tall * 0.9 : lift;
|
|
44
|
+
const total = tall + extra;
|
|
45
|
+
const line = Math.max(thin * 2.5, wide * 0.008);
|
|
46
|
+
const board = `<rect x="0" y="${n(kind === "hung" ? extra : 0)}" width="${n(wide)}" height="${n(tall)}" rx="${n(wide * 0.02)}" class="u-sbframe"/>`;
|
|
47
|
+
const top = kind === "hung" ? extra : 0;
|
|
48
|
+
const badgeAt = `<g class="kyogijo" ${parts.attrs} transform="translate(${n(margin)} ${n(top + (tall - parts.h * scale) / 2)}) scale(${n(scale)})">${parts.inner}</g>`;
|
|
49
|
+
const holds = kind === "hung"
|
|
50
|
+
? `<path d="M${n(wide * 0.12)} 0V${n(extra)}M${n(wide * 0.88)} 0V${n(extra)}" class="u-sbline" fill="none" stroke-width="${n(line)}"/>`
|
|
51
|
+
: `<path d="M${n(wide * 0.14)} ${n(tall)}V${n(total)}M${n(wide * 0.86)} ${n(tall)}V${n(total)}" class="u-sbline" fill="none" stroke-width="${n(line * 1.6)}"/>`;
|
|
52
|
+
// Where it is: over the middle of the surface, or behind an end (behind the centre-field fence in a ballpark, where the surface's top edge is the far side).
|
|
53
|
+
const cx = sport === "mlb" ? (area.x0 + area.x1) / 2 : kind === "hung" ? (area.x0 + area.x1) / 2 : area.x1 + 10 + 0.04 * L;
|
|
54
|
+
const cy = sport === "mlb" ? area.y0 - 14 : (area.y0 + area.y1) / 2;
|
|
55
|
+
const bottom = kind === "hung" ? lift : 0;
|
|
56
|
+
const high = bottom + total;
|
|
57
|
+
const planes = [{ ...plane("scoreboard", "screen", [cx - wide / 2, cy, high], [wide, 0, 0], [0, 0, -total], `${holds}${board}${badgeAt}`), billboard: true }];
|
|
58
|
+
return { id: "scoreboard", kind: "scoreboard", at: [cx, cy], height: kind === "hung" ? lift : lift, planes };
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Upright } from "./turn.kit.ts";
|
|
2
|
+
import type { SurfaceOptions } from "./types.ts";
|
|
3
|
+
/** What the 3D view makes of a budō surface: the things that stand, how high the surface itself stands, and the box the view is fitted to. */
|
|
4
|
+
export interface BudoUprights {
|
|
5
|
+
items: Upright[];
|
|
6
|
+
lift: number;
|
|
7
|
+
area: {
|
|
8
|
+
x0: number;
|
|
9
|
+
y0: number;
|
|
10
|
+
x1: number;
|
|
11
|
+
y1: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** The walls of a dojo, 3 m high (ours). */
|
|
15
|
+
export declare const DOJO_WALL = 3;
|
|
16
|
+
/** What stands on the budō surface the options draw. */
|
|
17
|
+
export declare function budoUprights(o: Pick<SurfaceOptions, "sport" | "league" | "budo" | "dojo" | "detail">, thin: number): BudoUprights;
|