@johnmorrisdotca/kyogijo-stadiums 0.5.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 +58 -0
- package/NOTICE.md +179 -3
- package/README.md +43 -11
- 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/atlas-entry.d.ts +3 -1
- package/dist/atlas-entry.js +3 -2
- package/dist/atlas.d.ts +37 -19
- package/dist/atlas.js +92 -7
- 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.baseball.js +1 -1
- package/dist/charts.js +4 -4
- package/dist/charts.soccer.js +3 -3
- package/dist/charts.types.d.ts +10 -0
- package/dist/colour.d.ts +4 -4
- package/dist/colour.js +4 -4
- package/dist/crowd.d.ts +11 -1
- package/dist/crowd.draw.js +15 -9
- package/dist/crowd.js +17 -2
- package/dist/draw.js +156 -31
- package/dist/element-entry.d.ts +2 -0
- package/dist/element-entry.js +1 -0
- package/dist/element.d.ts +2 -2
- package/dist/element.js +2 -1
- 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 +73 -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 +9 -3
- 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 +9 -1
- package/dist/halls.d.ts +65 -0
- package/dist/halls.js +122 -0
- package/dist/heat.js +17 -10
- package/dist/heat.zones.d.ts +4 -2
- package/dist/heat.zones.js +55 -3
- package/dist/homeside.js +7 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +8 -1
- 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 +10 -1
- package/dist/layers.env.js +33 -3
- package/dist/layers.js +30 -11
- package/dist/layers.types.d.ts +9 -2
- package/dist/leagues/budo.d.ts +196 -0
- package/dist/leagues/budo.js +105 -0
- package/dist/leagues/hockey.js +41 -19
- package/dist/leagues/sources.js +21 -0
- package/dist/leagues/types.d.ts +1 -1
- package/dist/leagues.d.ts +4 -1
- package/dist/leagues.js +102 -2
- 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/outline.d.ts +1 -1
- package/dist/outline.js +17 -3
- package/dist/pageant.js +7 -3
- 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 +7 -7
- package/dist/pool.figures.d.ts +57 -55
- package/dist/pool.figures.js +59 -55
- package/dist/pool.js +7 -7
- package/dist/pool.labels.js +2 -1
- package/dist/ranges.names.js +6 -0
- 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 +23 -1
- 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/strings.d.ts +175 -1
- package/dist/strings.js +364 -20
- package/dist/style.js +9 -2
- package/dist/surfaces/artistic.d.ts +3 -3
- package/dist/surfaces/artistic.js +3 -3
- package/dist/surfaces/baseball.js +2 -0
- package/dist/surfaces/basketball.js +1 -1
- package/dist/surfaces/budo.d.ts +6 -0
- package/dist/surfaces/budo.js +104 -0
- package/dist/surfaces/dive.d.ts +3 -3
- package/dist/surfaces/dive.js +3 -3
- package/dist/surfaces/football.js +7 -0
- package/dist/surfaces/hockey.js +3 -2
- package/dist/surfaces/polo.d.ts +4 -4
- package/dist/surfaces/polo.js +5 -5
- package/dist/surfaces/pool.d.ts +1 -1
- package/dist/surfaces/pool.js +3 -3
- package/dist/surfaces/surface.d.ts +32 -0
- package/dist/surfaces/venue.d.ts +1 -1
- package/dist/surfaces/venue.js +1 -1
- 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.data.js +848 -0
- package/dist/turn-entry.d.ts +2 -2
- package/dist/turn-entry.js +1 -1
- package/dist/turn.camera.d.ts +12 -1
- package/dist/turn.camera.js +18 -2
- package/dist/turn.dom.js +11 -9
- package/dist/turn.kit.d.ts +2 -2
- package/dist/turn.style.js +4 -3
- package/dist/types.d.ts +43 -7
- package/dist/units.js +7 -0
- package/dist/uprights.budo.d.ts +17 -0
- package/dist/uprights.budo.js +87 -0
- package/dist/uprights.js +10 -1
- package/dist/uprights.pools.js +4 -4
- 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 +39 -3
package/dist/style.js
CHANGED
|
@@ -5,6 +5,7 @@ import { KYOGIJO_FIELDS_STYLE } from "./fields.style.js";
|
|
|
5
5
|
import { KYOGIJO_HARDWOOD_STYLE } from "./hardwood.js";
|
|
6
6
|
import { KYOGIJO_ATHLETICS_STYLE, KYOGIJO_TRACK_STYLE } from "./athletics.style.js";
|
|
7
7
|
import { KYOGIJO_SKATING_STYLE } from "./skating.style.js";
|
|
8
|
+
import { KYOGIJO_BUDO_STYLE } from "./budo.style.js";
|
|
8
9
|
import { KYOGIJO_FEATURE_STYLE } from "./features.js";
|
|
9
10
|
import { KYOGIJO_GRID_STYLE } from "./layout.style.js";
|
|
10
11
|
import { KYOGIJO_LOOK_STYLE } from "./look.js";
|
|
@@ -12,6 +13,7 @@ import { KYOGIJO_MARK_STYLE } from "./mark.js";
|
|
|
12
13
|
import { KYOGIJO_PAGEANT_MOTION, KYOGIJO_PAGEANT_STYLE } from "./pageant.style.js";
|
|
13
14
|
import { KYOGIJO_POOL_STYLE } from "./pool.style.js";
|
|
14
15
|
import { KYOGIJO_ROAD_STYLE } from "./road.style.js";
|
|
16
|
+
import { KYOGIJO_SITUATION_STYLE } from "./situation.style.js";
|
|
15
17
|
import { KYOGIJO_SPECIAL_STYLE } from "./special.style.js";
|
|
16
18
|
/**
|
|
17
19
|
* The drawing's stylesheet, without the heat layers' rules: custom properties for every colour, in light and dark, and the rule of each class. It is
|
|
@@ -170,7 +172,12 @@ export const KYOGIJO_TEAM_STYLE = `
|
|
|
170
172
|
.kyogijo .ky-ro{fill:var(--c,var(--ky-layer));fill-opacity:.7;stroke:var(--ky-layer-edge);stroke-width:calc(var(--w,.3)*1px);stroke-linejoin:round}
|
|
171
173
|
.kyogijo .ky-ro-r{fill:none;stroke:var(--c,var(--ky-layer));stroke-opacity:.45;stroke-dasharray:calc(var(--w,.3)*3px) calc(var(--w,.3)*3px);stroke-width:calc(var(--w,.3)*1px)}
|
|
172
174
|
.kyogijo .ky-fm>*{fill:var(--c,var(--ky-layer));stroke:var(--ky-layer-edge);stroke-width:calc(var(--w,.3)*1px)}
|
|
173
|
-
.kyogijo .ky-fm>.ky-e{fill:var(--ky-layer-hollow);stroke:var(--c,var(--ky-layer));stroke-width:calc(var(--w,.3)*2.2px)}
|
|
175
|
+
.kyogijo .ky-fm>.ky-e{fill:var(--ky-layer-hollow);stroke:var(--c,var(--ky-layer));stroke-width:calc(var(--w,.3)*2.2px)}
|
|
176
|
+
.kyogijo .ky-fm>path{stroke-linejoin:round}
|
|
177
|
+
.kyogijo .ky-nm{fill:var(--ky-plate-ink);stroke:var(--ky-plate);stroke-width:.14em;paint-order:stroke;stroke-linejoin:round;font-family:var(--ky-font);font-weight:700;font-variant-numeric:tabular-nums}
|
|
178
|
+
.kyogijo .ky-lc{fill:var(--ky-post);stroke:var(--ky-layer-edge);stroke-width:calc(var(--w,.3)*1px)}
|
|
179
|
+
.kyogijo .ky-cl{fill:var(--ky-plate);stroke:none;font-family:var(--ky-font);font-weight:700}
|
|
180
|
+
.kyogijo .ky-lf{fill:none;stroke:var(--ky-layer-edge);stroke-width:calc(var(--w,.3)*1px)}`.trim();
|
|
174
181
|
/**
|
|
175
182
|
* The rules of the annotations (the arrows of `direction`, the axes of `axes` and the labels and leaders of `landmarks`): words in the ink of the page with an outline in the
|
|
176
183
|
* apron's colour, thin leaders, and the arrows in the home and away colours. A drawing that has an annotation writes them in; `KYOGIJO_STYLE` has them for a page.
|
|
@@ -184,4 +191,4 @@ export const KYOGIJO_NOTE_STYLE = `
|
|
|
184
191
|
.kyogijo .ky-an-ar{stroke:var(--c);fill:none}
|
|
185
192
|
.kyogijo .ky-an-hd{fill:var(--c)}`.trim();
|
|
186
193
|
/** Every rule of the package, for a page that draws with `style: "none"` and supplies the stylesheet itself. */
|
|
187
|
-
export const KYOGIJO_STYLE = `${KYOGIJO_BASE_STYLE}\n${KYOGIJO_HEAT_STYLE}\n${KYOGIJO_TEAM_STYLE}\n${KYOGIJO_CURLING_STYLE}\n${KYOGIJO_FOLD_STYLE}\n${KYOGIJO_WALLS_STYLE}\n${KYOGIJO_COURTS_STYLE}\n${KYOGIJO_FIELDS_STYLE}\n${KYOGIJO_POOL_STYLE}\n${KYOGIJO_ATHLETICS_STYLE}\n${KYOGIJO_SKATING_STYLE}\n${KYOGIJO_LOOK_STYLE}\n${KYOGIJO_HARDWOOD_STYLE}\n${KYOGIJO_TRACK_STYLE}\n${KYOGIJO_FEATURE_STYLE}\n${KYOGIJO_NOTE_STYLE}\n${KYOGIJO_SPECIAL_STYLE}\n${KYOGIJO_BACKGROUND_STYLE}\n${KYOGIJO_CROWD_STYLE}\n${KYOGIJO_GRID_STYLE}\n${KYOGIJO_MARK_STYLE}\n${KYOGIJO_PAGEANT_STYLE}\n${KYOGIJO_PAGEANT_MOTION}\n${KYOGIJO_ROAD_STYLE}`;
|
|
194
|
+
export const KYOGIJO_STYLE = `${KYOGIJO_BASE_STYLE}\n${KYOGIJO_HEAT_STYLE}\n${KYOGIJO_TEAM_STYLE}\n${KYOGIJO_CURLING_STYLE}\n${KYOGIJO_FOLD_STYLE}\n${KYOGIJO_WALLS_STYLE}\n${KYOGIJO_COURTS_STYLE}\n${KYOGIJO_FIELDS_STYLE}\n${KYOGIJO_POOL_STYLE}\n${KYOGIJO_ATHLETICS_STYLE}\n${KYOGIJO_SKATING_STYLE}\n${KYOGIJO_BUDO_STYLE}\n${KYOGIJO_LOOK_STYLE}\n${KYOGIJO_HARDWOOD_STYLE}\n${KYOGIJO_TRACK_STYLE}\n${KYOGIJO_FEATURE_STYLE}\n${KYOGIJO_NOTE_STYLE}\n${KYOGIJO_SPECIAL_STYLE}\n${KYOGIJO_BACKGROUND_STYLE}\n${KYOGIJO_CROWD_STYLE}\n${KYOGIJO_GRID_STYLE}\n${KYOGIJO_MARK_STYLE}\n${KYOGIJO_PAGEANT_STYLE}\n${KYOGIJO_PAGEANT_MOTION}\n${KYOGIJO_SITUATION_STYLE}\n${KYOGIJO_ROAD_STYLE}`;
|
|
@@ -2,8 +2,8 @@ import type { ArtisticPlan } from "../pool.ts";
|
|
|
2
2
|
import { type PoolCtx } from "../pool.kit.ts";
|
|
3
3
|
import { type BuildOptions, type Surface } from "./surface.ts";
|
|
4
4
|
/**
|
|
5
|
-
* An artistic swimming area lying wide, from World Aquatics' rules (Part Seven, Article
|
|
6
|
-
* deep part (
|
|
7
|
-
* stage (
|
|
5
|
+
* An artistic swimming area lying wide, from World Aquatics' rules (Part Seven, Article 12): 30 by 20 m for the Olympic Games and the World Championships (12.2.2), or the least, 25 by 15 m of which 12 by 12 m is the
|
|
6
|
+
* deep part (12.1.1), the floor marked with contrasting lines in one direction along its length (12.1.3), the judges' (Technical Officials') platform not more than 2 m from the pool's edge (12.2.5) and the starting platform at centre
|
|
7
|
+
* stage (12.1.7). The sizes of the two platforms are ours: the rules give their heights.
|
|
8
8
|
*/
|
|
9
9
|
export declare function artistic(o: BuildOptions, plan: ArtisticPlan, ctx?: PoolCtx): Surface;
|
|
@@ -5,9 +5,9 @@ import { ARTISTIC, SWIMMING } from "../pool.figures.js";
|
|
|
5
5
|
import { GUTTER } from "./pool.js";
|
|
6
6
|
import { atEnds, edges, ft, quarterTurn, textOn } from "./surface.js";
|
|
7
7
|
/**
|
|
8
|
-
* An artistic swimming area lying wide, from World Aquatics' rules (Part Seven, Article
|
|
9
|
-
* deep part (
|
|
10
|
-
* stage (
|
|
8
|
+
* An artistic swimming area lying wide, from World Aquatics' rules (Part Seven, Article 12): 30 by 20 m for the Olympic Games and the World Championships (12.2.2), or the least, 25 by 15 m of which 12 by 12 m is the
|
|
9
|
+
* deep part (12.1.1), the floor marked with contrasting lines in one direction along its length (12.1.3), the judges' (Technical Officials') platform not more than 2 m from the pool's edge (12.2.5) and the starting platform at centre
|
|
10
|
+
* stage (12.1.7). The sizes of the two platforms are ours: the rules give their heights.
|
|
11
11
|
*/
|
|
12
12
|
export function artistic(o, plan, ctx = {}) {
|
|
13
13
|
const L = plan.length;
|
|
@@ -179,6 +179,8 @@ export function baseball(points, o, era, diamond = MLB_DIAMOND) {
|
|
|
179
179
|
Object.assign(right, { cx: (umax + m - 6 + 62) / 2, cy, w, h: 58 });
|
|
180
180
|
}
|
|
181
181
|
const surface = { sport: "mlb", view, base, lines, defs: clip, left, right, plate: { cx: 0, cy: -Math.round(vmax * 0.42), w: 150, h: 62 }, turned: false, lineRef: { width: thin, feet: 1 }, box: { x: umin, y: -vmax, w: umax - umin, h: vmax } };
|
|
182
|
+
// The bases as drawn (first, second, third) for a situation to light.
|
|
183
|
+
surface.anchors = { kind: "baseball", bases: bases.map(([u, v]) => [u, -v]), half: h, backstop };
|
|
182
184
|
// A pageant: the home team's picture on the infield, the visitors' in the outfield beyond the plate, and the emblem on the mound.
|
|
183
185
|
{
|
|
184
186
|
const inW = 2 * centreV * 0.6 * 0.95;
|
|
@@ -10,7 +10,7 @@ import { atEnds, edges, ft, quarterTurn, textOn } from "./surface.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export function basketball(o, era, court = NBA_COURT) {
|
|
12
12
|
// The NBA's court has a history of its own (eras.ts); a league's, if it has one, is already in its `court`.
|
|
13
|
-
const nba = court === NBA_COURT ? (era ?? rulesFor("nba").rules) : undefined;
|
|
13
|
+
const nba = court === NBA_COURT || era !== undefined ? (era ?? rulesFor("nba").rules) : undefined;
|
|
14
14
|
const { length: L, width: W } = court;
|
|
15
15
|
const m = o.margin ?? 7;
|
|
16
16
|
const view0 = { x: -m, y: -m, w: L + 2 * m, h: W + 2 * m };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BudoPlan } from "../budo/plan.ts";
|
|
2
|
+
import { type BuildOptions, type Surface } from "./surface.ts";
|
|
3
|
+
/** Feet in a metre. */
|
|
4
|
+
export declare const K: number;
|
|
5
|
+
/** The surface of the plan lying wide. `margin` is the ground round what is drawn, in feet. */
|
|
6
|
+
export declare function budoSurface(o: BuildOptions, plan: BudoPlan, margin: number): Surface;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// A budō surface lying wide, from its plan (budo/plan.ts): the floor and the free zone, the mats in their tones with their heri and their seams, the walls, the clay and the straw of a dohyō, the tape,
|
|
2
|
+
// the targets. The plan is in metres; the drawing is in feet, as every surface lies, so the whole is drawn inside a group that scales metres to feet and moves the surface's box to the origin.
|
|
3
|
+
import { el } from "../format.js";
|
|
4
|
+
import { areaD, marks, strokes } from "./field.js";
|
|
5
|
+
import { atEnds, edges, ft, quarterTurn } from "./surface.js";
|
|
6
|
+
/** Feet in a metre. */
|
|
7
|
+
export const K = 1 / 0.3048;
|
|
8
|
+
const feetBox = (b, ox, oy) => edges((b.x0 - ox) * K, (b.y0 - oy) * K, (b.x1 - ox) * K, (b.y1 - oy) * K);
|
|
9
|
+
/** A plan's named range in feet, as a surface lists them. */
|
|
10
|
+
function rangeOf(r, ox, oy) {
|
|
11
|
+
return "left" in r ? atEnds((end) => feetBox(end === "left" ? r.left : r.right, ox, oy)) : feetBox(r, ox, oy);
|
|
12
|
+
}
|
|
13
|
+
/** The surface of the plan lying wide. `margin` is the ground round what is drawn, in feet. */
|
|
14
|
+
export function budoSurface(o, plan, margin) {
|
|
15
|
+
const ox = plan.box.x0;
|
|
16
|
+
const oy = plan.box.y0;
|
|
17
|
+
const full = o.detail === "full";
|
|
18
|
+
const view0 = { x: (plan.extent.x0 - ox) * K - margin, y: (plan.extent.y0 - oy) * K - margin, w: (plan.extent.x1 - plan.extent.x0) * K + 2 * margin, h: (plan.extent.y1 - plan.extent.y0) * K + 2 * margin };
|
|
19
|
+
const place = `scale(${K.toFixed(6)}) translate(${(-ox).toFixed(4)} ${(-oy).toFixed(4)})`;
|
|
20
|
+
const group = (inner, cls) => el("g", { class: cls, transform: place }, inner);
|
|
21
|
+
const turned = o.portrait;
|
|
22
|
+
let base = el("rect", { class: ft(o, "apron", "ky-apron"), x: view0.x, y: view0.y, width: view0.w, height: view0.h });
|
|
23
|
+
let ground = "";
|
|
24
|
+
let defs = "";
|
|
25
|
+
// The weave of a mat, over the tones and under the heri and the seams: a ridge and its highlight, a repeating gradient that every mat shares (one `<defs>` entry, which a `<pattern>` would
|
|
26
|
+
// have to share with the background's), turned a quarter for a mat that lies across. Drawn only at full detail.
|
|
27
|
+
const pieces = plan.dojo?.pieces ?? plan.judo?.pieces ?? [];
|
|
28
|
+
const weave = full && plan.texture && pieces.length > 0;
|
|
29
|
+
const stripe = (at, colour, opacity, width) => el("stop", { offset: at, "stop-color": colour, "stop-opacity": 0 }) + el("stop", { offset: at, "stop-color": colour, "stop-opacity": opacity }) + el("stop", { offset: at + width, "stop-color": colour, "stop-opacity": opacity }) + el("stop", { offset: at + width, "stop-color": colour, "stop-opacity": 0 });
|
|
30
|
+
const woven = () => {
|
|
31
|
+
defs += el("linearGradient", { id: `${o.id}-weave`, x1: 0, y1: 0, x2: 0, y2: 0.1, gradientUnits: "userSpaceOnUse", spreadMethod: "repeat" }, stripe(0.1, "#000000", 0.16, 0.22) + stripe(0.52, "#ffffff", 0.14, 0.16));
|
|
32
|
+
const rect = (p) => `M${p.x0} ${p.y0}H${p.x1}V${p.y1}H${p.x0}Z`;
|
|
33
|
+
// A mat that lies across is drawn in a group turned a quarter, with its corners turned back, so that its ridges run along it.
|
|
34
|
+
const turned = (p) => `M${p.y0} ${-p.x0}H${p.y1}V${-p.x1}H${p.y0}Z`;
|
|
35
|
+
const across = pieces.filter((p) => p.along === "x");
|
|
36
|
+
const down = pieces.filter((p) => p.along === "y");
|
|
37
|
+
let out = "";
|
|
38
|
+
if (across.length > 0)
|
|
39
|
+
out += el("path", { class: "ky-bud-weave", d: across.map(rect).join(""), fill: `url(#${o.id}-weave)` });
|
|
40
|
+
if (down.length > 0)
|
|
41
|
+
out += el("g", { transform: "rotate(90)" }, el("path", { class: "ky-bud-weave", d: down.map(turned).join(""), fill: `url(#${o.id}-weave)` }));
|
|
42
|
+
// A faint light line along the edge of each mat, where its rounded edge catches the light.
|
|
43
|
+
out += el("path", { class: "ky-bud-edge", d: pieces.map(rect).join(""), fill: "none" });
|
|
44
|
+
return out;
|
|
45
|
+
};
|
|
46
|
+
let pending = false;
|
|
47
|
+
let wove = false;
|
|
48
|
+
for (const a of plan.areas) {
|
|
49
|
+
const tone = a.cls === "ky-bud-t1" || a.cls === "ky-bud-t2" || a.cls === "ky-bud-t3";
|
|
50
|
+
if (weave && !wove && pending && !tone) {
|
|
51
|
+
wove = true;
|
|
52
|
+
ground += woven();
|
|
53
|
+
}
|
|
54
|
+
if (tone)
|
|
55
|
+
pending = true;
|
|
56
|
+
ground += el("path", { class: ft(o, a.feature, a.cls), d: areaD(a), "fill-rule": a.evenodd === true ? "evenodd" : undefined });
|
|
57
|
+
}
|
|
58
|
+
if (weave && !wove)
|
|
59
|
+
ground += woven();
|
|
60
|
+
base += group(ground, "ky-bud-ground");
|
|
61
|
+
const thick = o.exact ? plan.lineWidth : plan.drawnLine;
|
|
62
|
+
// The seams are the plan's finest lines: left out of a drawing that asks for the simple detail.
|
|
63
|
+
const shown = full ? plan : { ...plan, shapes: plan.shapes.filter((s) => s.feature !== "seams" && s.feature !== "boards") };
|
|
64
|
+
const lines = group(strokes(shown, o) + marks(shown, o), "ky-bud-lines");
|
|
65
|
+
const W = (plan.box.x1 - plan.box.x0) * K;
|
|
66
|
+
const H = (plan.box.y1 - plan.box.y0) * K;
|
|
67
|
+
const cx = (plan.centre.x - ox) * K;
|
|
68
|
+
const cy = (plan.centre.y - oy) * K;
|
|
69
|
+
// The score's board lies on the middle of the surface; the teams are named on it, not painted on the mats.
|
|
70
|
+
const plateW = Math.min(W * 0.52, 190);
|
|
71
|
+
// The names a score paints (kyūdō's and a dojo's: the others have a board): on the shajō's floor and over the yamichi, or either side of the middle.
|
|
72
|
+
const kyu = plan.kyudo;
|
|
73
|
+
const places = kyu === undefined ? { left: { cx: W * 0.27, cy: H / 2, w: W * 0.2, h: H * 0.11, rot: 0 }, right: { cx: W * 0.73, cy: H / 2, w: W * 0.2, h: H * 0.11, rot: 0 } } : { left: { cx: ((kyu.shajo.x0 + kyu.shajo.x1) / 2 - ox) * K, cy: H * 0.3, w: (kyu.shajo.x1 - kyu.shajo.x0) * K * 0.5, h: H * 0.09, rot: 0 }, right: { cx: ((kyu.yamichi.x0 + kyu.yamichi.x1) / 2 + (kyu.yamichi.x1 - kyu.yamichi.x0) / 4 - ox) * K, cy: (((kyu.yamichi.y0 + kyu.yamichi.y1) / 2) - oy) * K, w: (kyu.yamichi.x1 - kyu.yamichi.x0) * K * 0.3, h: H * 0.09, rot: 0 } };
|
|
74
|
+
const surface = {
|
|
75
|
+
sport: plan.sport,
|
|
76
|
+
view: view0,
|
|
77
|
+
base,
|
|
78
|
+
lines,
|
|
79
|
+
defs,
|
|
80
|
+
left: places.left,
|
|
81
|
+
right: places.right,
|
|
82
|
+
plate: { cx, cy, w: plateW, h: plateW * 0.55 },
|
|
83
|
+
turned,
|
|
84
|
+
bannersOver: true,
|
|
85
|
+
onColour: false,
|
|
86
|
+
centreRadius: plan.centre.r * K,
|
|
87
|
+
};
|
|
88
|
+
surface.box = { x: 0, y: 0, w: W, h: H };
|
|
89
|
+
surface.lineRef = { width: thick, feet: K };
|
|
90
|
+
const ranges = {};
|
|
91
|
+
for (const [name, r] of Object.entries(plan.ranges))
|
|
92
|
+
ranges[name] = rangeOf(r, ox, oy);
|
|
93
|
+
surface.ranges = ranges;
|
|
94
|
+
if (o.landmarks === true) {
|
|
95
|
+
const m = plan.marks.map((p) => ({ id: p.id, x: (p.x - ox) * K, y: (p.y - oy) * K, side: p.side }));
|
|
96
|
+
surface.marks = full ? m : m.filter((p) => !p.id.startsWith("~"));
|
|
97
|
+
}
|
|
98
|
+
if (turned) {
|
|
99
|
+
const t = quarterTurn(view0);
|
|
100
|
+
surface.view = t.view;
|
|
101
|
+
surface.turn = t.turn;
|
|
102
|
+
}
|
|
103
|
+
return surface;
|
|
104
|
+
}
|
package/dist/surfaces/dive.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { DivePlan } from "../pool.ts";
|
|
|
2
2
|
import { type PoolCtx } from "../pool.kit.ts";
|
|
3
3
|
import { type BuildOptions, type Surface } from "./surface.ts";
|
|
4
4
|
/**
|
|
5
|
-
* A diving well seen from above, from World Aquatics' rules (Part Four, Article
|
|
6
|
-
* long and 0.50 m wide with its front edge, the plummet, 2.22 m beyond the wall; each platform has the length and width of the table, its front edge 0.75 to 1.50 m beyond the wall (
|
|
7
|
-
* distance (Appendix 2, B and C) from the side wall and from each other. The three lines across the well (
|
|
5
|
+
* A diving well seen from above, from World Aquatics' rules (Part Four, Article 15 and Appendix 2): the pool wall the boards stand at on the left, the diving direction towards the right. Every springboard is 4.88 m
|
|
6
|
+
* long and 0.50 m wide with its front edge, the plummet, 2.22 m beyond the wall; each platform has the length and width of the table, its front edge 0.75 to 1.50 m beyond the wall (15.4.9); the boards stand the preferred
|
|
7
|
+
* distance (Appendix 2, B and C) from the side wall and from each other. The three lines across the well (15.6.3.1) are 21 m long, 2.5 m apart, the first under the plummet of the 3 m springboard.
|
|
8
8
|
*/
|
|
9
9
|
export declare function diving(o: BuildOptions, plan: DivePlan, ctx?: PoolCtx): Surface;
|
package/dist/surfaces/dive.js
CHANGED
|
@@ -8,9 +8,9 @@ import { edges, ft, quarterTurn, textOn } from "./surface.js";
|
|
|
8
8
|
/** The name a board goes by in the words of the landmarks. */
|
|
9
9
|
const markId = (b) => (b.kind === "springboard" ? `springboard-${b.height}m` : `platform-${String(b.height).replace(".", "-")}m`);
|
|
10
10
|
/**
|
|
11
|
-
* A diving well seen from above, from World Aquatics' rules (Part Four, Article
|
|
12
|
-
* long and 0.50 m wide with its front edge, the plummet, 2.22 m beyond the wall; each platform has the length and width of the table, its front edge 0.75 to 1.50 m beyond the wall (
|
|
13
|
-
* distance (Appendix 2, B and C) from the side wall and from each other. The three lines across the well (
|
|
11
|
+
* A diving well seen from above, from World Aquatics' rules (Part Four, Article 15 and Appendix 2): the pool wall the boards stand at on the left, the diving direction towards the right. Every springboard is 4.88 m
|
|
12
|
+
* long and 0.50 m wide with its front edge, the plummet, 2.22 m beyond the wall; each platform has the length and width of the table, its front edge 0.75 to 1.50 m beyond the wall (15.4.9); the boards stand the preferred
|
|
13
|
+
* distance (Appendix 2, B and C) from the side wall and from each other. The three lines across the well (15.6.3.1) are 21 m long, 2.5 m apart, the first under the plummet of the 3 m springboard.
|
|
14
14
|
*/
|
|
15
15
|
export function diving(o, plan, ctx = {}) {
|
|
16
16
|
const L = plan.length;
|
|
@@ -93,6 +93,8 @@ export function football(spec, o, marks = { hashMarks: true, postShape: "slingsh
|
|
|
93
93
|
if (numbered && spec.id === "cfl" && (yardsLong / 2) % 10 !== 0)
|
|
94
94
|
positions.push({ x: e + (yardsLong / 2) * 3, label: spec.centre, pos: yardsLong / 2 });
|
|
95
95
|
let numbers = "";
|
|
96
|
+
const arrows = [];
|
|
97
|
+
const numerals = [];
|
|
96
98
|
for (const side of ["near", "far"]) {
|
|
97
99
|
const y = side === "near" ? W - centreY : centreY;
|
|
98
100
|
for (const p of positions) {
|
|
@@ -100,6 +102,9 @@ export function football(spec, o, marks = { hashMarks: true, postShape: "slingsh
|
|
|
100
102
|
const centre = p.label === spec.centre || p.pos === yardsLong / 2;
|
|
101
103
|
const digits = [...p.label];
|
|
102
104
|
const flip = side === "far";
|
|
105
|
+
// The numeral's box in the wide frame: the digits stand along the field, or across it when the field is turned.
|
|
106
|
+
const spread = digits.length === 1 ? 3 : 5.9;
|
|
107
|
+
numerals.push([p.x, y, turned ? DIGIT_HEIGHT / 2 : spread, turned ? spread : DIGIT_HEIGHT / 2]);
|
|
103
108
|
if (digits.length === 1)
|
|
104
109
|
numbers += textOn(turned, p.x, y + DIGIT_HEIGHT / 2, p.label, { size, anchor: "middle", cls: numCls, flip, weight: 700 });
|
|
105
110
|
else {
|
|
@@ -118,6 +123,7 @@ export function football(spec, o, marks = { hashMarks: true, postShape: "slingsh
|
|
|
118
123
|
if (full && !centre && Number(p.label) < 50) {
|
|
119
124
|
const ax = nearGoalLeft ? p.x - 8.4 : p.x + 8.4;
|
|
120
125
|
const dir = nearGoalLeft ? -1 : 1;
|
|
126
|
+
arrows.push([ax, y, 1.5, 1.6]);
|
|
121
127
|
numbers += el("path", { class: ft(o, "numbers", "ky-fill-line"), d: `M${num(ax + dir * 1.5)} ${num(y)}L${num(ax - dir * 1.5)} ${num(y - 1.6)}V${num(y + 1.6)}Z` });
|
|
122
128
|
}
|
|
123
129
|
}
|
|
@@ -169,6 +175,7 @@ export function football(spec, o, marks = { hashMarks: true, postShape: "slingsh
|
|
|
169
175
|
};
|
|
170
176
|
surface.lineRef = { width: lw, feet: 1 };
|
|
171
177
|
surface.box = { x: 0, y: 0, w: L, h: W };
|
|
178
|
+
surface.anchors = { kind: "football", length: spec.length, endZone: e, width: W, arrows, numerals };
|
|
172
179
|
// The red zone is the 20 yards before a goal line and the end zone behind it; the half is from an end line to midfield.
|
|
173
180
|
const twenty = 60;
|
|
174
181
|
const half = atEnds((end) => (end === "left" ? edges(0, 0, L / 2, W) : edges(L / 2, 0, L, W)));
|
package/dist/surfaces/hockey.js
CHANGED
|
@@ -15,8 +15,8 @@ export function boardsY(x, radius = NHL.cornerRadius) {
|
|
|
15
15
|
* season (today's by default) marked it; with a `rink` (leagues.ts), that league's, in feet.
|
|
16
16
|
*/
|
|
17
17
|
export function hockey(o, era, rink = NHL_RINK) {
|
|
18
|
-
// The NHL's rink has a history of its own (eras.ts); a league's, if it has one, is already in its `rink`.
|
|
19
|
-
const nhl = rink === NHL_RINK ? (era ?? rulesFor("nhl").rules) : undefined;
|
|
18
|
+
// The NHL's rink has a history of its own (eras.ts), and so has an arena's rink of another size (an `era` given with it); a league's, if it has one, is already in its `rink`.
|
|
19
|
+
const nhl = rink === NHL_RINK || era !== undefined ? (era ?? rulesFor("nhl").rules) : undefined;
|
|
20
20
|
const { length: L, width: W, cornerRadius: r } = rink;
|
|
21
21
|
const g = nhl?.goalLine ?? rink.goalLine;
|
|
22
22
|
const blueLine = nhl?.blueLine ?? rink.blueLine;
|
|
@@ -129,6 +129,7 @@ export function hockey(o, era, rink = NHL_RINK) {
|
|
|
129
129
|
surface.lineRef = { width: thin, feet: 1 };
|
|
130
130
|
surface.box = { x: 0, y: 0, w: L, h: W };
|
|
131
131
|
surface.centreRadius = rink.circleRadius;
|
|
132
|
+
surface.anchors = { kind: "hockey", length: L, width: W, blueLine, goalLine: g, cornerRadius: r, net: net_ };
|
|
132
133
|
// The zones of the ice: from the end boards to a blue line, and between the blue lines.
|
|
133
134
|
const zone = atEnds((end) => (end === "left" ? edges(0, 0, blueLine, W) : edges(L - blueLine, 0, L, W)));
|
|
134
135
|
surface.ranges = {
|
package/dist/surfaces/polo.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { PoloPlan } from "../pool.ts";
|
|
2
2
|
import { type PoolCtx } from "../pool.kit.ts";
|
|
3
3
|
import { type BuildOptions, type Surface } from "./surface.ts";
|
|
4
|
-
/** The space behind each goal line where the goal's net hangs, in metres (
|
|
4
|
+
/** The space behind each goal line where the goal's net hangs, in metres (Part Six 21.6.5 and 21.7.2.1: the goal at least 0.3 m deep, the lane rope 0.3 m behind the goal line): the pool is the field of play, 25 m between the goal lines (Part Six 20.2.2.1), and this behind each of them. */
|
|
5
5
|
export declare const POLO_BEHIND: 0.3;
|
|
6
6
|
/**
|
|
7
7
|
* A water polo field of play lying wide, from World Aquatics' rules: 25 by 20 m between the goal lines; lane ropes along both sides whose floats are white at the goal line and the half distance line, red to
|
|
8
|
-
* the 2 m mark, yellow from 2 to 6 m and green from 6 m to the half distance line, with a red mark at 5 m (
|
|
9
|
-
* (20.4.1.2); the goals, 3 m between the posts (
|
|
10
|
-
* as the ropes are (
|
|
8
|
+
* the 2 m mark, yellow from 2 to 6 m and green from 6 m to the half distance line, with a red mark at 5 m (Part Six 21.7.1 and 21.7.2); the 2 m lines from the goal posts that make the goal areas
|
|
9
|
+
* (Part Six 20.4 and 21.7.2.1.2); the goals, 3 m between the posts (21.6.3.2); the re-entry area 2.0 by 1.08 m in each corner on the side away from the official table (20.7); the referees' platforms 1 m wide along both sides, coloured
|
|
10
|
+
* as the ropes are (21.9.3); the official table (21.10) and the area for flying substitutions on the side of the benches (20.6).
|
|
11
11
|
*/
|
|
12
12
|
export declare function waterPolo(o: BuildOptions, plan: PoloPlan, ctx?: PoolCtx): Surface;
|
package/dist/surfaces/polo.js
CHANGED
|
@@ -4,13 +4,13 @@ import { box, deckMarkup, leastWidth, paintDefs, poolIds, ropeMarkup, waterMarku
|
|
|
4
4
|
import { WATER_POLO } from "../pool.figures.js";
|
|
5
5
|
import { GUTTER } from "./pool.js";
|
|
6
6
|
import { atEnds, edges, ft, quarterTurn } from "./surface.js";
|
|
7
|
-
/** The space behind each goal line where the goal's net hangs, in metres (
|
|
7
|
+
/** The space behind each goal line where the goal's net hangs, in metres (Part Six 21.6.5 and 21.7.2.1: the goal at least 0.3 m deep, the lane rope 0.3 m behind the goal line): the pool is the field of play, 25 m between the goal lines (Part Six 20.2.2.1), and this behind each of them. */
|
|
8
8
|
export const POLO_BEHIND = WATER_POLO.goal.netClear;
|
|
9
9
|
/**
|
|
10
10
|
* A water polo field of play lying wide, from World Aquatics' rules: 25 by 20 m between the goal lines; lane ropes along both sides whose floats are white at the goal line and the half distance line, red to
|
|
11
|
-
* the 2 m mark, yellow from 2 to 6 m and green from 6 m to the half distance line, with a red mark at 5 m (
|
|
12
|
-
* (20.4.1.2); the goals, 3 m between the posts (
|
|
13
|
-
* as the ropes are (
|
|
11
|
+
* the 2 m mark, yellow from 2 to 6 m and green from 6 m to the half distance line, with a red mark at 5 m (Part Six 21.7.1 and 21.7.2); the 2 m lines from the goal posts that make the goal areas
|
|
12
|
+
* (Part Six 20.4 and 21.7.2.1.2); the goals, 3 m between the posts (21.6.3.2); the re-entry area 2.0 by 1.08 m in each corner on the side away from the official table (20.7); the referees' platforms 1 m wide along both sides, coloured
|
|
13
|
+
* as the ropes are (21.9.3); the official table (21.10) and the area for flying substitutions on the side of the benches (20.6).
|
|
14
14
|
*/
|
|
15
15
|
export function waterPolo(o, plan, ctx = {}) {
|
|
16
16
|
const Lp = plan.length;
|
|
@@ -56,7 +56,7 @@ export function waterPolo(o, plan, ctx = {}) {
|
|
|
56
56
|
lines += across("six-metre-lines", "yellow", at(WATER_POLO.sixMetre, from));
|
|
57
57
|
lines += across("five-metre-marks", "red", at(WATER_POLO.fiveMetre, from), `${num(feet(0.5))} ${num(feet(0.5))}`);
|
|
58
58
|
}
|
|
59
|
-
// The goal areas: red lines 2 m long from the outer faces of the goal posts (
|
|
59
|
+
// The goal areas: red lines 2 m long from the outer faces of the goal posts (Part Six 20.4.1 and 21.7.2.1.2).
|
|
60
60
|
const post = WATER_POLO.goal.post;
|
|
61
61
|
const half = WATER_POLO.goal.width / 2;
|
|
62
62
|
for (const from of ["left", "right"]) {
|
package/dist/surfaces/pool.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface SwimBody {
|
|
|
15
15
|
/** The gutter round the water, in metres: the width of the coping the pool is drawn with. */
|
|
16
16
|
export declare const GUTTER = 0.4;
|
|
17
17
|
/**
|
|
18
|
-
* The body of a swimming pool: every figure is the rules' (`SWIMMING`, pool.figures.ts). The lane markings on the floor are 46 m (21 m in a 25 m pool) long and end 2 m from the walls in a cross line 1 m long (
|
|
18
|
+
* The body of a swimming pool: every figure is the rules' (`SWIMMING`, pool.figures.ts). The lane markings on the floor are 46 m (21 m in a 25 m pool) long and end 2 m from the walls in a cross line 1 m long (Part Two 15.13.1 and 15.13.2); a
|
|
19
19
|
* cross line 0.5 m long at 15 m from each end; the touch panels 2.4 m wide at the walls with the target lines; the ropes in the rules' colours with red floats within 5 m of the walls and a mark at 15 m and 25 m;
|
|
20
20
|
* the starting blocks with their lane numbers; the backstroke flags 5 m from each end, and the false start rope 15 m from the starting end.
|
|
21
21
|
*/
|
package/dist/surfaces/pool.js
CHANGED
|
@@ -8,7 +8,7 @@ import { atEnds, edges, ft, quarterTurn, textOn } from "./surface.js";
|
|
|
8
8
|
/** The gutter round the water, in metres: the width of the coping the pool is drawn with. */
|
|
9
9
|
export const GUTTER = 0.4;
|
|
10
10
|
/**
|
|
11
|
-
* The body of a swimming pool: every figure is the rules' (`SWIMMING`, pool.figures.ts). The lane markings on the floor are 46 m (21 m in a 25 m pool) long and end 2 m from the walls in a cross line 1 m long (
|
|
11
|
+
* The body of a swimming pool: every figure is the rules' (`SWIMMING`, pool.figures.ts). The lane markings on the floor are 46 m (21 m in a 25 m pool) long and end 2 m from the walls in a cross line 1 m long (Part Two 15.13.1 and 15.13.2); a
|
|
12
12
|
* cross line 0.5 m long at 15 m from each end; the touch panels 2.4 m wide at the walls with the target lines; the ropes in the rules' colours with red floats within 5 m of the walls and a mark at 15 m and 25 m;
|
|
13
13
|
* the starting blocks with their lane numbers; the backstroke flags 5 m from each end, and the false start rope 15 m from the starting end.
|
|
14
14
|
*/
|
|
@@ -76,7 +76,7 @@ export function swimBody(o, plan, ids) {
|
|
|
76
76
|
runs.push(["white", Math.max(0, x - run), Math.min(L, x + run), rope.y]);
|
|
77
77
|
}
|
|
78
78
|
lines += ropeMarkup(o, runs, SWIMMING.floatDiameter, 0.45);
|
|
79
|
-
// The marks on the deck at 15 m (and 25 m) from the walls, and the standards of the flags: on both sides of the pool (
|
|
79
|
+
// The marks on the deck at 15 m (and 25 m) from the walls, and the standards of the flags: on both sides of the pool (Part Two 15.9.1).
|
|
80
80
|
if (full && !neutral) {
|
|
81
81
|
let ticks = "";
|
|
82
82
|
for (const x of [SWIMMING.markAt15, L - SWIMMING.markAt15, ...(plan.course === "long" ? [SWIMMING.markAt25] : [])]) {
|
|
@@ -104,7 +104,7 @@ export function swimBody(o, plan, ids) {
|
|
|
104
104
|
lines += el("circle", { class: "ky-pl-st", cx: fx, cy: feet(y), r: feet(0.22) * s });
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
// The starting blocks, 0.5 by 0.6 m, one in each lane at each end, numbered on the top (
|
|
107
|
+
// The starting blocks, 0.5 by 0.5 m (Part Two 15.8.1 asks at least that; the June 2025 edition asked 0.6 m long at the Olympic Games and the World Championships), one in each lane at each end, numbered on the top (Part Two 15.8.1 and 15.8.6).
|
|
108
108
|
if (plan.blocks && !neutral) {
|
|
109
109
|
const bw = SWIMMING.block.width * s;
|
|
110
110
|
const bl = SWIMMING.block.length * s;
|
|
@@ -46,6 +46,36 @@ export type SurfaceRanges = Readonly<Record<string, Box | {
|
|
|
46
46
|
left: Box;
|
|
47
47
|
right: Box;
|
|
48
48
|
}>>;
|
|
49
|
+
/** The places of a surface's own parts that a game's situation (`situation`) is drawn against, in the wide frame, in feet. */
|
|
50
|
+
export type SituationAnchors = {
|
|
51
|
+
kind: "hockey";
|
|
52
|
+
length: number;
|
|
53
|
+
width: number;
|
|
54
|
+
blueLine: number;
|
|
55
|
+
goalLine: number;
|
|
56
|
+
cornerRadius: number;
|
|
57
|
+
net: {
|
|
58
|
+
width: number;
|
|
59
|
+
depth: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** The centre of each base, as the drawing has it (first, second, third), and half the diagonal of a base as drawn; where the backstop stands behind home plate. */
|
|
63
|
+
| {
|
|
64
|
+
kind: "baseball";
|
|
65
|
+
bases: readonly (readonly [number, number])[];
|
|
66
|
+
half: number;
|
|
67
|
+
backstop: number;
|
|
68
|
+
}
|
|
69
|
+
/** The field of play from goal line to goal line, with its end zones. */
|
|
70
|
+
/** `arrows` and `numerals`: what a tag must not cover, each as its centre and half its size along the field and across it (`[x, y, hx, hy]`): the arrows beside the yard numbers that point to a goal line, when the field draws them, and the numbers. */
|
|
71
|
+
| {
|
|
72
|
+
kind: "football";
|
|
73
|
+
length: number;
|
|
74
|
+
endZone: number;
|
|
75
|
+
width: number;
|
|
76
|
+
arrows: readonly (readonly [number, number, number, number])[];
|
|
77
|
+
numerals: readonly (readonly [number, number, number, number])[];
|
|
78
|
+
};
|
|
49
79
|
/** A surface, ready for the teams and the score to be laid on it. */
|
|
50
80
|
export interface Surface {
|
|
51
81
|
sport: Sport;
|
|
@@ -127,6 +157,8 @@ export interface Surface {
|
|
|
127
157
|
};
|
|
128
158
|
/** For a surface with a crowd: the margin it was drawn with, which holds the stands. */
|
|
129
159
|
crowdMargin?: number;
|
|
160
|
+
/** Where the parts a situation is drawn against are: a rink's lines and nets, a diamond's bases, a gridiron's goal lines. */
|
|
161
|
+
anchors?: SituationAnchors;
|
|
130
162
|
}
|
|
131
163
|
/** A part of a surface to label: its anchor on the surface in feet and the margin its label stands in (the top or the bottom as the surface lies wide). */
|
|
132
164
|
export interface Mark {
|
package/dist/surfaces/venue.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare function venueName(item: VenueLayout["items"][number], language:
|
|
|
6
6
|
/**
|
|
7
7
|
* Several pools in one hall, to scale: each pool is drawn by its own sport's builder (the competition pool of 8 lanes, a diving well, a warm-up pool, a water polo pool or an artistic swimming area) and set at its place,
|
|
8
8
|
* with the deck round the hall drawn once and the paint of the water and the deck defined once for all of them. The pools stand at least 8 m apart, 10 m by default, as the rules keep a swimming pool and a diving well
|
|
9
|
-
* (
|
|
9
|
+
* (Part Two 15.15.1). The water of the whole hall is the surface's `box`.
|
|
10
10
|
*/
|
|
11
11
|
export declare function natatorium(o: BuildOptions, style: PoolStyle, look: {
|
|
12
12
|
look: "flat" | "water" | "tiled";
|
package/dist/surfaces/venue.js
CHANGED
|
@@ -31,7 +31,7 @@ export function venueName(item, language) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Several pools in one hall, to scale: each pool is drawn by its own sport's builder (the competition pool of 8 lanes, a diving well, a warm-up pool, a water polo pool or an artistic swimming area) and set at its place,
|
|
33
33
|
* with the deck round the hall drawn once and the paint of the water and the deck defined once for all of them. The pools stand at least 8 m apart, 10 m by default, as the rules keep a swimming pool and a diving well
|
|
34
|
-
* (
|
|
34
|
+
* (Part Two 15.15.1). The water of the whole hall is the surface's `box`.
|
|
35
35
|
*/
|
|
36
36
|
export function natatorium(o, style, look, language) {
|
|
37
37
|
const layout = venueLayout(style);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { GOAL_SPORTS, KYOGIJO_TARGET_STYLE, LENGTH_ZONES, TARGET_SPORTS, drawGoalMouth, drawStrikeZone, drawStumps, drawTarget, goalSize, goalZoneIds, lengthZoneOf, targetZoneAt } from "./target.ts";
|
|
2
|
+
export type { GoalSport, TargetDrawing, TargetFrame, TargetOptions, TargetPlace, TargetShot, TargetSport, TargetUnit } from "./target.ts";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// The targets seen end-on: the mouth of a goal from the shooter's side, the stumps from the bowler's end and the strike zone from the catcher's, with the shots, deliveries and pitches on them.
|
|
2
|
+
export { GOAL_SPORTS, KYOGIJO_TARGET_STYLE, LENGTH_ZONES, TARGET_SPORTS, drawGoalMouth, drawStrikeZone, drawStumps, drawTarget, goalSize, goalZoneIds, lengthZoneOf, targetZoneAt } from "./target.js";
|