@johnmorrisdotca/kyogijo-stadiums 0.4.0 → 0.5.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.
Files changed (244) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/NOTICE.md +4 -0
  3. package/README.md +71 -16
  4. package/dist/annotate.js +1 -1
  5. package/dist/athletics/describe.d.ts +8 -0
  6. package/dist/athletics/describe.js +41 -0
  7. package/dist/athletics/events.d.ts +17 -0
  8. package/dist/athletics/events.js +48 -0
  9. package/dist/athletics/facilities.d.ts +80 -0
  10. package/dist/athletics/facilities.js +176 -0
  11. package/dist/athletics/infield.d.ts +79 -0
  12. package/dist/athletics/infield.js +166 -0
  13. package/dist/athletics/layout.d.ts +13 -0
  14. package/dist/athletics/layout.js +98 -0
  15. package/dist/athletics/oval.d.ts +57 -0
  16. package/dist/athletics/oval.js +116 -0
  17. package/dist/athletics/plan.d.ts +97 -0
  18. package/dist/athletics/plan.js +355 -0
  19. package/dist/athletics/races.d.ts +102 -0
  20. package/dist/athletics/races.js +355 -0
  21. package/dist/athletics/steeplechase.d.ts +72 -0
  22. package/dist/athletics/steeplechase.js +196 -0
  23. package/dist/athletics/stencil.d.ts +13 -0
  24. package/dist/athletics/stencil.js +85 -0
  25. package/dist/athletics/track.d.ts +54 -0
  26. package/dist/athletics/track.js +105 -0
  27. package/dist/athletics/types.d.ts +77 -0
  28. package/dist/athletics/types.js +1 -0
  29. package/dist/athletics-entry.d.ts +17 -0
  30. package/dist/athletics-entry.js +11 -0
  31. package/dist/athletics.style.d.ts +16 -0
  32. package/dist/athletics.style.js +51 -0
  33. package/dist/atlas-entry.d.ts +4 -2
  34. package/dist/atlas-entry.js +3 -2
  35. package/dist/atlas.d.ts +83 -7
  36. package/dist/atlas.js +108 -8
  37. package/dist/charts-entry.d.ts +6 -1
  38. package/dist/charts-entry.js +3 -0
  39. package/dist/charts.athletics.d.ts +183 -0
  40. package/dist/charts.athletics.js +455 -0
  41. package/dist/charts.curling.heat.d.ts +24 -0
  42. package/dist/charts.curling.heat.js +116 -0
  43. package/dist/charts.curling.js +14 -3
  44. package/dist/charts.pool.d.ts +67 -0
  45. package/dist/charts.pool.js +76 -0
  46. package/dist/charts.skating.d.ts +204 -0
  47. package/dist/charts.skating.js +426 -0
  48. package/dist/charts.types.d.ts +53 -1
  49. package/dist/court.d.ts +85 -2
  50. package/dist/court.js +102 -7
  51. package/dist/court.more.d.ts +46 -0
  52. package/dist/court.more.js +219 -0
  53. package/dist/courts.style.d.ts +14 -2
  54. package/dist/courts.style.js +51 -4
  55. package/dist/crowd.d.ts +154 -0
  56. package/dist/crowd.draw.d.ts +17 -0
  57. package/dist/crowd.draw.js +198 -0
  58. package/dist/crowd.js +465 -0
  59. package/dist/crowd.park.d.ts +19 -0
  60. package/dist/crowd.park.js +153 -0
  61. package/dist/curling.stats.d.ts +271 -0
  62. package/dist/curling.stats.js +301 -0
  63. package/dist/draw.d.ts +16 -0
  64. package/dist/draw.js +318 -35
  65. package/dist/element-entry.d.ts +1 -1
  66. package/dist/element-entry.js +1 -1
  67. package/dist/element.d.ts +13 -2
  68. package/dist/element.js +77 -3
  69. package/dist/features.js +131 -0
  70. package/dist/fields.kit.d.ts +2 -2
  71. package/dist/fields.types.d.ts +18 -4
  72. package/dist/frames.providers.js +63 -8
  73. package/dist/geojson.js +3 -0
  74. package/dist/geometry-entry.d.ts +2 -1
  75. package/dist/geometry-entry.js +2 -1
  76. package/dist/geometry.d.ts +20 -0
  77. package/dist/geometry.js +78 -1
  78. package/dist/grounds.d.ts +4 -0
  79. package/dist/grounds.data.js +12 -0
  80. package/dist/hardwood.d.ts +31 -0
  81. package/dist/hardwood.js +157 -0
  82. package/dist/heat.js +4 -3
  83. package/dist/heat.types.d.ts +5 -0
  84. package/dist/heat.zones.d.ts +2 -2
  85. package/dist/heat.zones.js +154 -6
  86. package/dist/homeside.js +17 -0
  87. package/dist/index.d.ts +16 -2
  88. package/dist/index.js +10 -1
  89. package/dist/layers.d.ts +1 -1
  90. package/dist/layers.env.d.ts +3 -1
  91. package/dist/layers.env.js +4 -2
  92. package/dist/layers.js +4 -4
  93. package/dist/leagues/athletics.d.ts +63 -0
  94. package/dist/leagues/athletics.js +87 -0
  95. package/dist/leagues/courts.d.ts +269 -4
  96. package/dist/leagues/courts.js +155 -1
  97. package/dist/leagues/skating.d.ts +145 -0
  98. package/dist/leagues/skating.js +73 -0
  99. package/dist/leagues/sources.js +20 -0
  100. package/dist/leagues/types.d.ts +1 -1
  101. package/dist/leagues-entry.d.ts +4 -2
  102. package/dist/leagues-entry.js +2 -1
  103. package/dist/leagues.d.ts +14 -4
  104. package/dist/leagues.js +146 -5
  105. package/dist/look.d.ts +3 -3
  106. package/dist/look.js +39 -6
  107. package/dist/outline.d.ts +1 -1
  108. package/dist/outline.js +30 -2
  109. package/dist/pageant.d.ts +120 -0
  110. package/dist/pageant.draw.d.ts +21 -0
  111. package/dist/pageant.draw.js +171 -0
  112. package/dist/pageant.js +207 -0
  113. package/dist/pageant.style.d.ts +8 -0
  114. package/dist/pageant.style.js +42 -0
  115. package/dist/png.d.ts +8 -1
  116. package/dist/png.js +21 -1
  117. package/dist/pool.d.ts +176 -0
  118. package/dist/pool.figures.d.ts +304 -0
  119. package/dist/pool.figures.js +144 -0
  120. package/dist/pool.js +304 -0
  121. package/dist/pool.kit.d.ts +48 -0
  122. package/dist/pool.kit.js +141 -0
  123. package/dist/pool.labels.d.ts +20 -0
  124. package/dist/pool.labels.js +257 -0
  125. package/dist/pool.race.d.ts +65 -0
  126. package/dist/pool.race.js +140 -0
  127. package/dist/pool.replay.d.ts +46 -0
  128. package/dist/pool.replay.js +127 -0
  129. package/dist/pool.section.d.ts +13 -0
  130. package/dist/pool.section.js +83 -0
  131. package/dist/pool.style.d.ts +20 -0
  132. package/dist/pool.style.js +169 -0
  133. package/dist/pool.types.d.ts +145 -0
  134. package/dist/pool.types.js +3 -0
  135. package/dist/pool.words.d.ts +13 -0
  136. package/dist/pool.words.js +101 -0
  137. package/dist/ranges.names.js +47 -3
  138. package/dist/replay-entry.d.ts +3 -0
  139. package/dist/replay-entry.js +2 -0
  140. package/dist/restyle.js +1 -1
  141. package/dist/score.js +70 -5
  142. package/dist/sheet.d.ts +3 -0
  143. package/dist/sheet.js +7 -3
  144. package/dist/skating/describe.d.ts +7 -0
  145. package/dist/skating/describe.js +44 -0
  146. package/dist/skating/events.d.ts +24 -0
  147. package/dist/skating/events.js +47 -0
  148. package/dist/skating/figure.d.ts +24 -0
  149. package/dist/skating/figure.js +37 -0
  150. package/dist/skating/long.d.ts +54 -0
  151. package/dist/skating/long.js +111 -0
  152. package/dist/skating/parts.d.ts +43 -0
  153. package/dist/skating/parts.js +40 -0
  154. package/dist/skating/plan.d.ts +55 -0
  155. package/dist/skating/plan.js +197 -0
  156. package/dist/skating/short.d.ts +47 -0
  157. package/dist/skating/short.js +89 -0
  158. package/dist/skating/track.d.ts +66 -0
  159. package/dist/skating/track.js +94 -0
  160. package/dist/skating/types.d.ts +57 -0
  161. package/dist/skating/types.js +3 -0
  162. package/dist/skating-entry.d.ts +17 -0
  163. package/dist/skating-entry.js +11 -0
  164. package/dist/skating.style.d.ts +4 -0
  165. package/dist/skating.style.js +24 -0
  166. package/dist/strings.d.ts +296 -0
  167. package/dist/strings.js +328 -11
  168. package/dist/style.d.ts +2 -0
  169. package/dist/style.js +11 -1
  170. package/dist/surfaces/artistic.d.ts +9 -0
  171. package/dist/surfaces/artistic.js +94 -0
  172. package/dist/surfaces/athletics.d.ts +16 -0
  173. package/dist/surfaces/athletics.js +132 -0
  174. package/dist/surfaces/baseball.js +15 -0
  175. package/dist/surfaces/basketball.floor.d.ts +27 -0
  176. package/dist/surfaces/basketball.floor.js +83 -0
  177. package/dist/surfaces/basketball.gear.d.ts +27 -0
  178. package/dist/surfaces/basketball.gear.js +90 -0
  179. package/dist/surfaces/basketball.js +43 -21
  180. package/dist/surfaces/curling.d.ts +16 -0
  181. package/dist/surfaces/curling.fold.d.ts +67 -0
  182. package/dist/surfaces/curling.fold.js +107 -0
  183. package/dist/surfaces/curling.js +37 -3
  184. package/dist/surfaces/dive.d.ts +9 -0
  185. package/dist/surfaces/dive.js +128 -0
  186. package/dist/surfaces/field.d.ts +7 -2
  187. package/dist/surfaces/field.js +15 -9
  188. package/dist/surfaces/hockey.js +1 -0
  189. package/dist/surfaces/net.d.ts +2 -1
  190. package/dist/surfaces/net.js +160 -15
  191. package/dist/surfaces/polo.d.ts +12 -0
  192. package/dist/surfaces/polo.js +159 -0
  193. package/dist/surfaces/pool.d.ts +27 -0
  194. package/dist/surfaces/pool.js +198 -0
  195. package/dist/surfaces/skating.d.ts +6 -0
  196. package/dist/surfaces/skating.js +62 -0
  197. package/dist/surfaces/soccer.js +2 -1
  198. package/dist/surfaces/surface.d.ts +44 -0
  199. package/dist/surfaces/venue.d.ts +15 -0
  200. package/dist/surfaces/venue.js +95 -0
  201. package/dist/tenants.d.ts +77 -0
  202. package/dist/tenants.data.d.ts +8 -0
  203. package/dist/tenants.data.js +945 -0
  204. package/dist/tenants.js +46 -0
  205. package/dist/turn-entry.d.ts +12 -0
  206. package/dist/turn-entry.js +7 -0
  207. package/dist/turn.camera.d.ts +105 -0
  208. package/dist/turn.camera.js +168 -0
  209. package/dist/turn.dom.d.ts +40 -0
  210. package/dist/turn.dom.js +351 -0
  211. package/dist/turn.kit.d.ts +86 -0
  212. package/dist/turn.kit.js +110 -0
  213. package/dist/turn.markup.d.ts +48 -0
  214. package/dist/turn.markup.js +108 -0
  215. package/dist/turn.model.d.ts +78 -0
  216. package/dist/turn.model.js +91 -0
  217. package/dist/turn.style.d.ts +5 -0
  218. package/dist/turn.style.js +55 -0
  219. package/dist/types.d.ts +183 -18
  220. package/dist/units.d.ts +1 -1
  221. package/dist/units.js +15 -1
  222. package/dist/uprights.board.d.ts +17 -0
  223. package/dist/uprights.board.js +59 -0
  224. package/dist/uprights.d.ts +37 -0
  225. package/dist/uprights.fields.d.ts +32 -0
  226. package/dist/uprights.fields.js +172 -0
  227. package/dist/uprights.goal.d.ts +49 -0
  228. package/dist/uprights.goal.js +69 -0
  229. package/dist/uprights.js +160 -0
  230. package/dist/uprights.more.d.ts +7 -0
  231. package/dist/uprights.more.js +183 -0
  232. package/dist/uprights.net.d.ts +12 -0
  233. package/dist/uprights.net.js +109 -0
  234. package/dist/uprights.netkit.d.ts +28 -0
  235. package/dist/uprights.netkit.js +67 -0
  236. package/dist/uprights.pools.d.ts +8 -0
  237. package/dist/uprights.pools.js +190 -0
  238. package/dist/uprights.rinks.d.ts +27 -0
  239. package/dist/uprights.rinks.js +106 -0
  240. package/dist/uprights.track.d.ts +50 -0
  241. package/dist/uprights.track.js +246 -0
  242. package/dist/version.d.ts +1 -1
  243. package/dist/version.js +1 -1
  244. package/package.json +19 -2
@@ -1 +1 @@
1
- export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes } from "./element.ts";
1
+ export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes, turnSettingsFromAttributes, turnWanted } from "./element.ts";
@@ -1,2 +1,2 @@
1
1
  // The custom element's class and its registration function; importing this entry registers nothing.
2
- export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes } from "./element.js";
2
+ export { KYOGIJO_ATTRIBUTES, KYOGIJO_TAG, KyogijoField, defineKyogijoField, optionsFromAttributes, replaySettingsFromAttributes, turnSettingsFromAttributes, turnWanted } from "./element.js";
package/dist/element.d.ts CHANGED
@@ -1,10 +1,16 @@
1
1
  import { type KyogijoReplay } from "./mount.ts";
2
+ import { type KyogijoTurn } from "./turn.dom.ts";
3
+ import type { TurnSettings } from "./turn.model.ts";
2
4
  import type { ReplaySettings, ReplayTimeline } from "./replay.types.ts";
3
5
  import type { ScoreOptions, SurfaceOptions } from "./types.ts";
4
6
  /** The tag of the element. */
5
7
  export declare const KYOGIJO_TAG = "kyogijo-field";
6
8
  /** The attributes the element reads. */
7
- export declare const KYOGIJO_ATTRIBUTES: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "description", "options", "loop", "speed", "autoplay", "controls", "trail"];
9
+ export declare const KYOGIJO_ATTRIBUTES: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options", "loop", "speed", "autoplay", "controls", "trail", "turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch"];
10
+ /** The settings of a 3D view an element's attributes make: `turn-view` names the viewpoint it opens on, `turn-controls="false"` and `turn-uprights="false"` leave the buttons and what stands on the surface out, `turn-score="floor"` leaves the score panel on the floor, `turn-touch="turn"` keeps every touch for the view. */
11
+ export declare function turnSettingsFromAttributes(read: (name: string) => string | null, base?: TurnSettings): TurnSettings;
12
+ /** Whether an element's `turn` attribute asks for the 3D view: present, and not `false`. */
13
+ export declare const turnWanted: (read: (name: string) => string | null) => boolean;
8
14
  /** The settings of a replay an element's attributes make: `loop`, `autoplay` and `controls="false"` are switches, `speed` and `trail` numbers. */
9
15
  export declare function replaySettingsFromAttributes(read: (name: string) => string | null, base?: ReplaySettings): ReplaySettings;
10
16
  /** The options an element's attributes (and its `options` attribute and property) make. */
@@ -18,7 +24,7 @@ export declare function optionsFromAttributes(read: (name: string) => string | n
18
24
  declare const Base: typeof HTMLElement;
19
25
  export declare class KyogijoField extends Base {
20
26
  #private;
21
- static observedAttributes: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "description", "options", "loop", "speed", "autoplay", "controls", "trail"];
27
+ static observedAttributes: readonly ["sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase", "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks", "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color", "status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options", "loop", "speed", "autoplay", "controls", "trail", "turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch"];
22
28
  /** The options given as a property: an object, laid under the attributes. */
23
29
  get options(): Partial<ScoreOptions> | undefined;
24
30
  set options(value: Partial<ScoreOptions> | undefined);
@@ -30,6 +36,11 @@ export declare class KyogijoField extends Base {
30
36
  set replaySettings(value: ReplaySettings | undefined);
31
37
  /** The controller of the replay while there is one: play, pause, seek, step, speed. */
32
38
  get replay(): KyogijoReplay | undefined;
39
+ /** Settings of the 3D view beyond the attributes: `motion`, `lens`, `floor`, `onChange` and the rest of `TurnSettings`. */
40
+ get turnSettings(): TurnSettings | undefined;
41
+ set turnSettings(value: TurnSettings | undefined);
42
+ /** The 3D view while the element has the `turn` attribute: its viewpoints, `set`, `reset`. */
43
+ get turn(): KyogijoTurn | undefined;
33
44
  connectedCallback(): void;
34
45
  disconnectedCallback(): void;
35
46
  attributeChangedCallback(name: string): void;
package/dist/element.js CHANGED
@@ -9,11 +9,13 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
- var _KyogijoField_instances, _KyogijoField_mount, _KyogijoField_host, _KyogijoField_options, _KyogijoField_theme, _KyogijoField_timeline, _KyogijoField_replaySettings, _KyogijoField_replay, _KyogijoField_replayOf, _KyogijoField_attach, _KyogijoField_draw;
12
+ var _KyogijoField_instances, _KyogijoField_mount, _KyogijoField_host, _KyogijoField_options, _KyogijoField_theme, _KyogijoField_timeline, _KyogijoField_replaySettings, _KyogijoField_replay, _KyogijoField_replayOf, _KyogijoField_turn, _KyogijoField_turnSettings, _KyogijoField_attach, _KyogijoField_draw;
13
13
  import { SPORTS } from "./draw.js";
14
14
  import { leagueIds } from "./leagues.js";
15
15
  import { parseRange } from "./ranges.names.js";
16
16
  import { mountKyogijo } from "./mount.js";
17
+ import { TURN_PRESET_NAMES } from "./turn.camera.js";
18
+ import { mountKyogijoTurn } from "./turn.dom.js";
17
19
  /** The tag of the element. */
18
20
  export const KYOGIJO_TAG = "kyogijo-field";
19
21
  /** The attributes the element reads. */
@@ -21,11 +23,30 @@ export const KYOGIJO_ATTRIBUTES = [
21
23
  "sport", "league", "size", "theme", "language", "orientation", "park", "ground", "year", "detail", "margin", "stripes", "exact-lines", "uppercase",
22
24
  "pitch", "pitch-type", "half", "range", "range-end", "goals", "stripe-pattern", "corner-flags", "look", "line-width", "line-dash", "line-opacity", "landmarks", "walls", "quirks",
23
25
  "home", "away", "home-abbr", "away-abbr", "home-score", "away-score", "home-penalties", "away-penalties", "score", "home-logo", "away-logo", "home-color", "away-color",
24
- "status", "competition", "date", "label", "winner", "home-side", "description", "options",
26
+ "status", "competition", "date", "label", "winner", "home-side", "pageant", "description", "options",
25
27
  "loop", "speed", "autoplay", "controls", "trail",
28
+ "turn", "turn-view", "turn-controls", "turn-uprights", "turn-score", "turn-touch",
26
29
  ];
27
30
  /** The attributes that are about a replay and not about the drawing. */
28
31
  const REPLAY_ATTRIBUTES = ["loop", "speed", "autoplay", "controls", "trail"];
32
+ /** The settings of a 3D view an element's attributes make: `turn-view` names the viewpoint it opens on, `turn-controls="false"` and `turn-uprights="false"` leave the buttons and what stands on the surface out, `turn-score="floor"` leaves the score panel on the floor, `turn-touch="turn"` keeps every touch for the view. */
33
+ export function turnSettingsFromAttributes(read, base = {}) {
34
+ const out = { ...base };
35
+ const view = read("turn-view");
36
+ if (view !== null && TURN_PRESET_NAMES.includes(view))
37
+ out.preset = view;
38
+ if (read("turn-controls") === "false")
39
+ out.controls = false;
40
+ if (read("turn-uprights") === "false")
41
+ out.uprights = false;
42
+ if (read("turn-score") === "floor")
43
+ out.score = "floor";
44
+ if (read("turn-touch") === "turn")
45
+ out.touch = "turn";
46
+ return out;
47
+ }
48
+ /** Whether an element's `turn` attribute asks for the 3D view: present, and not `false`. */
49
+ export const turnWanted = (read) => read("turn") !== null && read("turn") !== "false";
29
50
  /** The settings of a replay an element's attributes make: `loop`, `autoplay` and `controls="false"` are switches, `speed` and `trail` numbers. */
30
51
  export function replaySettingsFromAttributes(read, base = {}) {
31
52
  const out = { ...base };
@@ -127,6 +148,16 @@ export function optionsFromAttributes(read, base) {
127
148
  const status = read("status");
128
149
  if (status !== null && status !== "")
129
150
  o.status = status;
151
+ // `pageant="carpet"` or `"stage"`, or `"true"` for a carpet; `"false"` leaves out what the `options` say.
152
+ const pageant = read("pageant");
153
+ if (pageant !== null) {
154
+ if (pageant === "carpet" || pageant === "stage")
155
+ o.pageant = pageant;
156
+ else if (pageant === "true" || pageant === "")
157
+ o.pageant = true;
158
+ else if (pageant === "false")
159
+ delete o.pageant;
160
+ }
130
161
  const side = read("home-side");
131
162
  if (side === "left" || side === "right")
132
163
  o.homeSide = side;
@@ -222,6 +253,8 @@ export class KyogijoField extends Base {
222
253
  _KyogijoField_replaySettings.set(this, void 0);
223
254
  _KyogijoField_replay.set(this, void 0);
224
255
  _KyogijoField_replayOf.set(this, void 0);
256
+ _KyogijoField_turn.set(this, void 0);
257
+ _KyogijoField_turnSettings.set(this, void 0);
225
258
  }
226
259
  /** The options given as a property: an object, laid under the attributes. */
227
260
  get options() {
@@ -251,6 +284,20 @@ export class KyogijoField extends Base {
251
284
  get replay() {
252
285
  return __classPrivateFieldGet(this, _KyogijoField_replay, "f");
253
286
  }
287
+ /** Settings of the 3D view beyond the attributes: `motion`, `lens`, `floor`, `onChange` and the rest of `TurnSettings`. */
288
+ get turnSettings() {
289
+ return __classPrivateFieldGet(this, _KyogijoField_turnSettings, "f");
290
+ }
291
+ set turnSettings(value) {
292
+ __classPrivateFieldSet(this, _KyogijoField_turnSettings, value, "f");
293
+ __classPrivateFieldGet(this, _KyogijoField_turn, "f")?.destroy();
294
+ __classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
295
+ __classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_draw).call(this);
296
+ }
297
+ /** The 3D view while the element has the `turn` attribute: its viewpoints, `set`, `reset`. */
298
+ get turn() {
299
+ return __classPrivateFieldGet(this, _KyogijoField_turn, "f");
300
+ }
254
301
  connectedCallback() {
255
302
  if (__classPrivateFieldGet(this, _KyogijoField_host, "f") === undefined) {
256
303
  const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
@@ -266,19 +313,27 @@ export class KyogijoField extends Base {
266
313
  __classPrivateFieldGet(this, _KyogijoField_theme, "f")?.disconnect();
267
314
  __classPrivateFieldGet(this, _KyogijoField_mount, "f")?.destroy();
268
315
  __classPrivateFieldSet(this, _KyogijoField_mount, undefined, "f");
316
+ __classPrivateFieldGet(this, _KyogijoField_turn, "f")?.destroy();
317
+ __classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
269
318
  __classPrivateFieldSet(this, _KyogijoField_replay, undefined, "f");
270
319
  __classPrivateFieldSet(this, _KyogijoField_replayOf, undefined, "f");
271
320
  }
272
321
  attributeChangedCallback(name) {
273
322
  if (!this.isConnected)
274
323
  return;
324
+ if (name === "turn-view" && __classPrivateFieldGet(this, _KyogijoField_turn, "f") !== undefined) {
325
+ const view = this.getAttribute("turn-view");
326
+ if (view !== null && TURN_PRESET_NAMES.includes(view))
327
+ __classPrivateFieldGet(this, _KyogijoField_turn, "f").preset(view);
328
+ return;
329
+ }
275
330
  if (REPLAY_ATTRIBUTES.includes(name) && __classPrivateFieldGet(this, _KyogijoField_replay, "f") !== undefined)
276
331
  __classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_attach).call(this, name !== "speed" && name !== "loop");
277
332
  else
278
333
  __classPrivateFieldGet(this, _KyogijoField_instances, "m", _KyogijoField_draw).call(this);
279
334
  }
280
335
  }
281
- _KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _KyogijoField_options = new WeakMap(), _KyogijoField_theme = new WeakMap(), _KyogijoField_timeline = new WeakMap(), _KyogijoField_replaySettings = new WeakMap(), _KyogijoField_replay = new WeakMap(), _KyogijoField_replayOf = new WeakMap(), _KyogijoField_instances = new WeakSet(), _KyogijoField_attach = function _KyogijoField_attach(again) {
336
+ _KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _KyogijoField_options = new WeakMap(), _KyogijoField_theme = new WeakMap(), _KyogijoField_timeline = new WeakMap(), _KyogijoField_replaySettings = new WeakMap(), _KyogijoField_replay = new WeakMap(), _KyogijoField_replayOf = new WeakMap(), _KyogijoField_turn = new WeakMap(), _KyogijoField_turnSettings = new WeakMap(), _KyogijoField_instances = new WeakSet(), _KyogijoField_attach = function _KyogijoField_attach(again) {
282
337
  if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") === undefined || __classPrivateFieldGet(this, _KyogijoField_timeline, "f") === undefined)
283
338
  return;
284
339
  const settings = replaySettingsFromAttributes((name) => this.getAttribute(name), __classPrivateFieldGet(this, _KyogijoField_replaySettings, "f"));
@@ -300,6 +355,25 @@ _KyogijoField_mount = new WeakMap(), _KyogijoField_host = new WeakMap(), _Kyogij
300
355
  const page = document.documentElement.getAttribute("data-theme");
301
356
  if (options.theme === undefined && (page === "light" || page === "dark"))
302
357
  options.theme = page;
358
+ if (turnWanted((name) => this.getAttribute(name))) {
359
+ // The 3D view takes the container over from the flat drawing; a replay does not play on it.
360
+ if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") !== undefined) {
361
+ __classPrivateFieldGet(this, _KyogijoField_mount, "f").destroy();
362
+ __classPrivateFieldSet(this, _KyogijoField_mount, undefined, "f");
363
+ __classPrivateFieldSet(this, _KyogijoField_replay, undefined, "f");
364
+ __classPrivateFieldSet(this, _KyogijoField_replayOf, undefined, "f");
365
+ }
366
+ const settings = turnSettingsFromAttributes((name) => this.getAttribute(name), __classPrivateFieldGet(this, _KyogijoField_turnSettings, "f"));
367
+ if (__classPrivateFieldGet(this, _KyogijoField_turn, "f") === undefined)
368
+ __classPrivateFieldSet(this, _KyogijoField_turn, mountKyogijoTurn(__classPrivateFieldGet(this, _KyogijoField_host, "f"), options, settings), "f");
369
+ else
370
+ __classPrivateFieldGet(this, _KyogijoField_turn, "f").update(options);
371
+ return;
372
+ }
373
+ if (__classPrivateFieldGet(this, _KyogijoField_turn, "f") !== undefined) {
374
+ __classPrivateFieldGet(this, _KyogijoField_turn, "f").destroy();
375
+ __classPrivateFieldSet(this, _KyogijoField_turn, undefined, "f");
376
+ }
303
377
  if (__classPrivateFieldGet(this, _KyogijoField_mount, "f") === undefined)
304
378
  __classPrivateFieldSet(this, _KyogijoField_mount, mountKyogijo(__classPrivateFieldGet(this, _KyogijoField_host, "f"), options), "f");
305
379
  else
package/dist/features.js CHANGED
@@ -38,6 +38,54 @@ const HOCKEY = [
38
38
  f("nets", "--ky-red", "The nets."),
39
39
  f("referee-crease", "--ky-red", "The referee's crease at the boards."),
40
40
  ];
41
+ const ATHLETICS = [
42
+ f("apron", "--ky-apron", "The ground round the stadium."),
43
+ f("track", "--ky-track", "The synthetic surface of the track, the straights and the segments."),
44
+ f("infield", "--ky-surface", "The turf inside the track."),
45
+ f("mowing", "--ky-surface-alt", "The lighter tone of the mown turf."),
46
+ f("kerb", LINE, "The kerb on the inside edge of the track."),
47
+ f("lane-lines", LINE, "The lines between the lanes and the track's outer edge."),
48
+ f("lane-numbers", LINE, "The lane numbers painted before the finish and the starts."),
49
+ f("finish-line", LINE, "The finish line and the short lines 1 m before it."),
50
+ f("start-lines", LINE, "The start lines: straight, staggered and curved."),
51
+ f("breakline", "--ky-ath-g", "The breakline of the 800 m and the 4 x 400 m."),
52
+ f("relay-zones", ["--ky-ath-y", "--ky-ath-b", LINE], "The takeover zones' marks and the scratch lines."),
53
+ f("hurdle-marks", ["--ky-ath-y", "--ky-ath-b", "--ky-ath-g"], "The marks of the hurdles on the track."),
54
+ f("steeplechase-hurdles", "--ky-ath-k", "The steeplechase's hurdles."),
55
+ f("water-jump", ["--ky-water", LINE, "--ky-ath-k"], "The water jump: its pit, its border and its hurdle."),
56
+ f("high-jump", ["--ky-mat", LINE, "--ky-ath-k"], "The high jump: the mat, the crossbar and the lines."),
57
+ f("pole-vault", ["--ky-mat", "--ky-pad", LINE], "The pole vault: the mats, the boxes and the runways."),
58
+ f("long-jump", ["--ky-sand", LINE], "The long jump's pits, boards and runways."),
59
+ f("triple-jump", ["--ky-sand", LINE], "The triple jump's pits, boards and runways."),
60
+ f("shot-put", ["--ky-concrete", LINE], "The shot put's circles, stop boards and sectors."),
61
+ f("discus-throw", ["--ky-concrete", LINE], "The discus throw's circle and sector."),
62
+ f("hammer-throw", ["--ky-concrete", LINE], "The hammer throw's circle and sector."),
63
+ f("javelin-throw", LINE, "The javelin's runway, arc and sector."),
64
+ f("cage", "--ky-ath-k", "The discus and hammer cage."),
65
+ f("banking", "--ky-ath-k", "The shade of the covered track's banked bends."),
66
+ ];
67
+ const SKATING = [
68
+ f("apron", "--ky-apron", "The ground round the rink."),
69
+ f("ice", "--ky-surface", "The ice."),
70
+ f("infield", "--ky-surface-alt", "The floor or the ice inside the track."),
71
+ f("warm-up", "--ky-surface-alt", "The warm-up lane of the long track."),
72
+ f("padding", "--ky-boards", "The padding round the track."),
73
+ f("boards", "--ky-boards", "The boards of a figure skating rink."),
74
+ f("lane-lines", "--ky-blue", "The lines that demarcate the lanes of the long track."),
75
+ f("track-line", ["--ky-blue", "--ky-ink"], "The line of the short track and the line between its blocks."),
76
+ f("blocks", "--ky-ink", "The blocks of a curve."),
77
+ f("cones", "--ky-red", "The cones at the entrance of a curve."),
78
+ f("finish-line", "--ky-red", "The finishing line."),
79
+ f("finish-marks", "--ky-blue", "The lines 1 m apart in the last 5 m before the finishing line."),
80
+ f("start-lines", "--ky-red", "The starting lines of the races marked."),
81
+ f("pre-start-lines", "--ky-blue", "The pre-start line 2 m before each starting line."),
82
+ f("start-positions", "--ky-ink", "The starting positions of the short track's 500 m and 1000 m."),
83
+ f("coaches-area", "--ky-red", "The coaches' area on the crossing straight."),
84
+ f("judges", "--ky-ink", "The judges' seats at the rinkboard."),
85
+ f("referee", "--ky-ink", "The referee's seat."),
86
+ f("technical-panel", "--ky-ink", "The technical panel's table."),
87
+ f("kiss-and-cry", "--ky-red", "The kiss and cry."),
88
+ ];
41
89
  const KEY = ["--ky-key", "--ky-key-left", "--ky-key-right"];
42
90
  const BASKETBALL = [
43
91
  f("apron", "--ky-apron", "The ground round the court."),
@@ -107,6 +155,63 @@ const CURLING = [
107
155
  f("hog-lines", "--ky-hog", "The hog lines."),
108
156
  f("hacks", "--ky-hack", "The hacks."),
109
157
  ];
158
+ const ROPES = ["--ky-pg", "--ky-pb", "--ky-py"];
159
+ const SWIMMING = [
160
+ f("apron", "--ky-apron", "The deck round the pool."),
161
+ f("gutter", "--ky-boards", "The gutter and the coping round the water."),
162
+ f("water", "--ky-surface", "The water."),
163
+ f("lane-lines", LINE, "The lane markings on the floor with their cross lines, the cross lines at 15 m, the marks on the deck and the target lines."),
164
+ f("touch-pads", "--ky-pd", "The touch panels on the end walls."),
165
+ f("starting-blocks", "--ky-pk", "The starting blocks."),
166
+ f("lane-ropes", ROPES, "The lane ropes' green, blue and yellow floats; the red floats near the walls are `rope-red` and the distinct marks `rope-white`."),
167
+ f("rope-green", "--ky-pg", "The green ropes of the outside lanes."),
168
+ f("rope-blue", "--ky-pb", "The blue ropes."),
169
+ f("rope-yellow", "--ky-py", "The yellow ropes of the middle lanes."),
170
+ f("rope-red", "--ky-pr", "The red floats within 5 m of each wall."),
171
+ f("rope-white", "--ky-pw", "The floats of a distinct colour at 15 m and 25 m."),
172
+ f("backstroke-flags", ["--ky-fa"], "The backstroke flags' rope 5 m from each wall."),
173
+ f("false-start-rope", "--ky-pf", "The false start rope 15 m from the starting end."),
174
+ f("pace-bars", "--ky-pe", "The outline of the split pace bars."),
175
+ ];
176
+ const WATER_POLO = [
177
+ f("apron", "--ky-apron", "The deck round the pool."),
178
+ f("gutter", "--ky-boards", "The gutter round the water."),
179
+ f("water", "--ky-surface", "The water."),
180
+ f("goal-lines", "--ky-pw", "The two goal lines."),
181
+ f("half-distance-line", "--ky-pw", "The half distance line."),
182
+ f("two-metre-lines", "--ky-pr", "The 2 m lines."),
183
+ f("five-metre-marks", "--ky-pr", "The 5 m marks, where a penalty throw is taken from."),
184
+ f("six-metre-lines", "--ky-py", "The 6 m lines."),
185
+ f("goal-area-lines", "--ky-pr", "The lines 2 m long from the goal posts that make the goal areas."),
186
+ f("re-entry-areas", "--ky-pr", "The excluded players' re-entry areas."),
187
+ f("referee-platforms", ["--ky-pr", "--ky-py", "--ky-pg"], "The referees' platforms along both sides, coloured as the ropes are."),
188
+ f("lane-ropes", ROPES, "The ropes along the sides: their green floats, their yellow floats; the red ones are `rope-red`, the white ones `rope-white`."),
189
+ f("rope-green", "--ky-pg", "The green floats from 6 m to the half distance line."),
190
+ f("rope-yellow", "--ky-py", "The yellow floats from 2 to 6 m."),
191
+ f("rope-red", "--ky-pr", "The red floats from the goal line to 2 m and the 5 m mark."),
192
+ f("rope-white", "--ky-pw", "The white floats at the goal lines and the half distance line."),
193
+ f("goals", "--ky-pw", "The goals: the crossbar and the net."),
194
+ f("goal-posts", "--ky-pw", "The goal posts."),
195
+ f("official-table", "--ky-pk", "The official table."),
196
+ f("substitution-areas", ["--ky-left", "--ky-right"], "The areas for flying substitutions, in each team's colour."),
197
+ ];
198
+ const DIVING = [
199
+ f("apron", "--ky-apron", "The deck round the well."),
200
+ f("gutter", "--ky-boards", "The gutter round the well."),
201
+ f("water", "--ky-surface", "The water."),
202
+ f("lane-lines", LINE, "The three lines across the well."),
203
+ f("stands", "--ky-boards", "The stands the boards are fixed to."),
204
+ f("platforms", "--ky-pc", "The platforms."),
205
+ f("springboards", "--ky-pbd", "The springboards."),
206
+ ];
207
+ const ARTISTIC_SWIMMING = [
208
+ f("apron", "--ky-apron", "The deck round the pool."),
209
+ f("gutter", "--ky-boards", "The gutter round the water."),
210
+ f("water", "--ky-surface", "The water."),
211
+ f("floor-lines", LINE, "The lines on the floor along the pool."),
212
+ f("judges-platform", "--ky-pk", "The judges' platform."),
213
+ f("starting-platform", "--ky-pk", "The starting platform."),
214
+ ];
110
215
  const NET = [
111
216
  f("apron", "--ky-apron", "The ground round the court."),
112
217
  f("free-zone", "--ky-free", "The free zone round the court, where the rules give one."),
@@ -117,6 +222,19 @@ const NET = [
117
222
  f("posts", "--ky-net", "The posts and the singles sticks."),
118
223
  f("antennae", "--ky-red", "The antennae of a volleyball net."),
119
224
  ];
225
+ const APRON_COURT = [f("apron", "--ky-apron", "The ground round the court."), f("court", "--ky-surface", "The court."), f("lines", LINE, "The painted lines.")];
226
+ /** A padel court: the net's features, and the walls and the metal fence of its enclosure. */
227
+ const PADEL = [...NET, f("walls", "--ky-wall", "The walls of the enclosure."), f("fence", "--ky-mesh", "The metal fence between the walls.")];
228
+ /** A squash court: no net, walls round it, and its front wall laid flat beside it, with its tin. */
229
+ const SQUASH = [...APRON_COURT, f("walls", "--ky-wall", "The walls round the court."), f("wall-face", "--ky-face", "The front wall, laid flat beside the court."), f("tin", "--ky-tin", "The tin, on the front wall."), f("wall-lines", "--ky-wall-line", "The lines on the front wall.")];
230
+ /** A racquetball court: no net, and walls round it. */
231
+ const RACQUETBALL = [...APRON_COURT, f("walls", "--ky-wall", "The walls round the court.")];
232
+ /** A teqball court: the net, the table, and the court surrounds. */
233
+ const TEQBALL = [...APRON_COURT, f("net", "--ky-net", "The net."), f("table", "--ky-table", "The teqball table."), f("walls", "--ky-wall", "The court surrounds.")];
234
+ /** A roundnet court: the ground, the lines (the circles and the service marks), and the set. */
235
+ const ROUNDNET = [...APRON_COURT, f("net", "--ky-net", "The set: its rim.")];
236
+ /** A netball court: the ground and free zone, the lines and circles, and the goalposts. */
237
+ const NETBALL = [f("apron", "--ky-apron", "The ground round the court."), f("free-zone", "--ky-free", "The court surround."), f("court", "--ky-surface", "The court."), f("lines", LINE, "The painted lines and circles."), f("posts", "--ky-net", "The goalposts.")];
120
238
  const TURF = [f("apron", "--ky-apron", "The ground round the surface."), f("turf", "--ky-surface", "The grass."), f("mowing", "--ky-surface-alt", "The lighter tone of the mown pattern.")];
121
239
  const POST = "--ky-post";
122
240
  const RUGBY = [
@@ -217,11 +335,22 @@ export const FEATURE_INFO = Object.freeze({
217
335
  mlb: BASEBALL,
218
336
  soccer: SOCCER,
219
337
  curling: CURLING,
338
+ swimming: SWIMMING,
339
+ waterpolo: WATER_POLO,
340
+ diving: DIVING,
341
+ artisticswimming: ARTISTIC_SWIMMING,
220
342
  tennis: NET,
221
343
  volleyball: NET,
222
344
  badminton: NET,
223
345
  pickleball: NET,
224
346
  tabletennis: NET,
347
+ padel: PADEL,
348
+ squash: SQUASH,
349
+ racquetball: RACQUETBALL,
350
+ sepaktakraw: NET,
351
+ teqball: TEQBALL,
352
+ roundnet: ROUNDNET,
353
+ netball: NETBALL,
225
354
  lacrosse: LACROSSE,
226
355
  rugby: RUGBY,
227
356
  afl: AFL,
@@ -229,6 +358,8 @@ export const FEATURE_INFO = Object.freeze({
229
358
  cricket: CRICKET,
230
359
  fieldhockey: FIELD_HOCKEY,
231
360
  handball: HANDBALL,
361
+ athletics: ATHLETICS,
362
+ skating: SKATING,
232
363
  });
233
364
  /**
234
365
  * The names of the features of each sport: the keys `featureColors` takes. Football's three fields have the same, and so have the five net sports.
@@ -1,4 +1,4 @@
1
- import type { ArcShape, BarShape, BoxShape, Dash, DotShape, LineShape, Outline, PathShape, PolyShape, RingShape } from "./fields.types.ts";
1
+ import type { AthleticsMark, SkatingMark, ArcShape, BarShape, BoxShape, Dash, DotShape, LineShape, Outline, PathShape, PolyShape, RingShape } from "./fields.types.ts";
2
2
  import type { Span } from "./leagues/fields.ts";
3
3
  import { type PlateSpot, type Zone } from "./surfaces/surface.ts";
4
4
  import type { Box } from "./types.ts";
@@ -8,7 +8,7 @@ interface Style {
8
8
  dash?: Dash;
9
9
  /** The least this shape is drawn at, in feet, when the drawing is not at the true widths (a crease on a pitch has to stay thin beside a ground). */
10
10
  least?: number;
11
- cls?: "ky-line" | "ky-red";
11
+ cls?: "ky-line" | "ky-red" | AthleticsMark | SkatingMark;
12
12
  }
13
13
  /** A line from one point to another. */
14
14
  export declare const line: (id: string, feature: string, x0: number, y0: number, x1: number, y1: number, style?: Style) => LineShape;
@@ -13,9 +13,15 @@ interface Stroked extends Named {
13
13
  dash?: Dash;
14
14
  /** The least this shape is drawn at, in feet, when the drawing is not at true widths: the plan's `drawnLine` when missing. */
15
15
  least?: number;
16
- /** The class it is painted with: the ordinary line (`ky-line`, white) unless it is a red line (`ky-red`). */
17
- cls?: "ky-line" | "ky-red";
16
+ /** The class it is painted with: the ordinary line (`ky-line`, white) unless it is a red line (`ky-red`), or one of athletics' coloured marks (yellow, blue, green, black or red). */
17
+ cls?: "ky-line" | "ky-red" | AthleticsMark | SkatingMark;
18
18
  }
19
+ /** The coloured marks of an athletics track: the yellow of the 4 x 100 m's takeover zones, the blue of the 4 x 400 m's and the 110 m hurdles (red on a blue track), the green of the 400 m hurdles and the breakline, black marks and red ones. */
20
+ /** The fills of an athletics track's coloured marks (a bar of yellow, blue, green, black or red). */
21
+ export type AthleticsFill = "ky-ath-y-fill" | "ky-ath-b-fill" | "ky-ath-g-fill" | "ky-ath-k-fill" | "ky-ath-r-fill";
22
+ export type AthleticsMark = "ky-ath-y" | "ky-ath-b" | "ky-ath-g" | "ky-ath-k" | "ky-ath-r" | "ky-ath-s";
23
+ /** The coloured marks of a skating rink: the blue lines that demarcate the lanes, the red starting, finishing and coaches' lines, black lines, the dotted blocks of a curve. */
24
+ export type SkatingMark = "ky-ska-b" | "ky-ska-r" | "ky-ska-k" | "ky-ska-blocks";
19
25
  /** A line from one point to another. */
20
26
  export interface LineShape extends Stroked {
21
27
  kind: "line";
@@ -62,11 +68,13 @@ export interface DotShape extends Named {
62
68
  cy: number;
63
69
  r: number;
64
70
  /** The paint: the line's (`line`, the default), or the post's. */
65
- paint?: "line" | "post";
71
+ paint?: "line" | "post" | "block" | "cone";
66
72
  }
67
73
  /** A rectangle filled in the line's colour: a short thick mark. */
68
74
  export interface BarShape extends Named {
69
75
  kind: "bar";
76
+ /** The class it is filled with, when it is not the line's colour. */
77
+ cls?: "ky-fill-line" | AthleticsFill;
70
78
  x0: number;
71
79
  y0: number;
72
80
  x1: number;
@@ -79,9 +87,15 @@ export interface PathShape extends Stroked {
79
87
  }
80
88
  /** Every shape that is a marking. */
81
89
  export type Shape = LineShape | ArcShape | RingShape | BoxShape | PolyShape | DotShape | BarShape | PathShape;
90
+ /** The areas of an athletics stadium: the track, the grass, the sand of a pit, the mat of a jump, the water of a pit, the concrete of a circle and a runway's cover. */
91
+ /** The areas of a skating rink: the ice, the floor of the infield, the warm-up lane, the padding and the furniture. */
92
+ export type SkatingArea = "ky-ska-ice" | "ky-ska-floor" | "ky-ska-warm" | "ky-ska-pad" | "ky-ska-desk" | "ky-ska-kiss";
93
+ export type AthleticsArea = "ky-ath-track" | "ky-ath-grass" | "ky-ath-sand" | "ky-ath-mat" | "ky-ath-water" | "ky-ath-concrete" | "ky-ath-pad" | "ky-ath-board" | "ky-ath-bank";
82
94
  /** A painted area, under the lines: a rectangle or an ellipse filled with a class of the stylesheet (`ky-area`, the tint of a goal area, or `ky-zone`). */
83
95
  export interface Area extends Named {
84
- cls: "ky-area" | "ky-zone" | "ky-dirt" | "ky-key" | "ky-boards";
96
+ cls: "ky-area" | "ky-zone" | "ky-dirt" | "ky-key" | "ky-boards" | AthleticsArea | SkatingArea;
97
+ /** Fill the path's insides by the even-odd rule: a ring (the track between its kerb and its outer edge). */
98
+ evenodd?: boolean;
85
99
  /** A rectangle `[x0, y0, x1, y1]`, an ellipse's centre and radii, a path of your own, or a frame: the ring between a rounded rectangle and the one `thick` outside it (boards). */
86
100
  rect?: readonly [x0: number, y0: number, x1: number, y1: number];
87
101
  ellipse?: readonly [cx: number, cy: number, rx: number, ry: number];
@@ -2,6 +2,7 @@
2
2
  // frames.ts. Each is cited in docs/sources.md ("Coordinate frames"), which says what was read, where, and what is ours.
3
3
  // Soccer's providers are registered by src/surfaces/soccer-providers.ts. Facts only: no code of sportypy, sportyR or
4
4
  // hockey_rink is used.
5
+ import { isPoolSport } from "./pool.js";
5
6
  import { CURLING, FOOTBALL, NBA, NHL, footballLength, surfaceSize } from "./geometry.js";
6
7
  import { FRAMES, registerFrame, span } from "./frames.js";
7
8
  // The surfaces in feet, in the drawing's own landscape frame: x along the surface from the left end, y across it from the top.
@@ -141,7 +142,7 @@ const curling = {
141
142
  * size of the court it is placed on. This package's own frame: no
142
143
  * tracking provider's format was read (Hawk-Eye's and the others' are not published), and a rulebook measures a court from the net.
143
144
  */
144
- function netFrame(sport, title, unit, x, y, what) {
145
+ function netFrame(sport, title, unit, x, y, what, origin = `the centre of the net, on ${what}`) {
145
146
  const per = unit === "ft" ? 1 : 0.3048;
146
147
  const map = (size) => ({ x: span(-(size.length * per) / 2, (size.length * per) / 2, 0, size.length), y: span(-(size.width * per) / 2, (size.width * per) / 2, size.width, 0) });
147
148
  return {
@@ -151,13 +152,13 @@ function netFrame(sport, title, unit, x, y, what) {
151
152
  unit,
152
153
  x: [-x, x],
153
154
  y: [-y, y],
154
- origin: `the centre of the net, on ${what}`,
155
+ origin,
155
156
  yDirection: "up",
156
- size: sport === "volleyball" ? "variable" : "fixed",
157
+ size: sport === "volleyball" || sport === "squash" ? "variable" : "fixed",
157
158
  ends: "fixed",
158
- landmarks: sport === "volleyball" ? map : map(surfaceSize(sport, "ft")),
159
- source: "this package's own frame: the centre of the net as the origin, as the rulebook measures the court from the net",
160
- note: "Positive x is towards the end drawn at the right, positive y towards the top as the court is drawn wide. The frame is not a data provider's: it is the plain reading of the rules, which measure everything from the net.",
159
+ landmarks: sport === "volleyball" || sport === "squash" ? map : map(surfaceSize(sport, "ft")),
160
+ source: sport === "squash" || sport === "racquetball" || sport === "roundnet" || sport === "netball" ? "this package's own frame: the centre of the court as the origin" : "this package's own frame: the centre of the net as the origin, as the rulebook measures the court from the net",
161
+ note: "Positive x is towards the end drawn at the right, positive y towards the top as the court is drawn wide. The frame is not a data provider's: it is the plain reading of the rules, which measure everything from the net (or, on a court without one, from its lines).",
161
162
  };
162
163
  }
163
164
  const tennisFrame = netFrame("tennis", "Tennis court, in feet from the centre of the net", "ft", 39, 18, "the court");
@@ -165,6 +166,13 @@ const volleyballFrame = netFrame("volleyball", "Volleyball court, in metres from
165
166
  const badmintonFrame = netFrame("badminton", "Badminton court, in metres from the centre of the net", "m", 6.7, 3.05, "the court");
166
167
  const pickleballFrame = netFrame("pickleball", "Pickleball court, in feet from the centre of the net", "ft", 22, 10, "the court");
167
168
  const tableTennisFrame = netFrame("tabletennis", "Table tennis table, in metres from the centre of the net", "m", 1.37, 0.7625, "the table");
169
+ const padelFrame = netFrame("padel", "Padel court, in metres from the centre of the net", "m", 10, 5, "the court");
170
+ const squashFrame = netFrame("squash", "Squash court, in metres from the centre of the court", "m", 4.875, 4.21, "the court", "the centre of the court; the front wall is at the left");
171
+ const racquetballFrame = netFrame("racquetball", "Racquetball court, in feet from the centre of the court", "ft", 20, 10, "the court", "the centre of the court; the front wall is at the left");
172
+ const sepakTakrawFrame = netFrame("sepaktakraw", "Sepak takraw court, in metres from the centre of the net", "m", 6.7, 3.05, "the court");
173
+ const teqballFrame = netFrame("teqball", "Teqball court, in metres from the centre of the table and its net", "m", 8, 6, "the court");
174
+ const roundnetFrame = netFrame("roundnet", "Roundnet court, in metres from the centre of the set", "m", 5, 5, "the court", "the centre of the set, the middle of the court");
175
+ const netballFrame = netFrame("netball", "Netball court, in metres from the centre of the court", "m", 15.25, 7.625, "the court", "the centre of the court, on the centre circle");
168
176
  /**
169
177
  * A field sport's surface in the plain frame of its middle: the centre of the surface as the origin, x along it, positive towards the end drawn at the right, y across it, positive towards the top as it is drawn wide.
170
178
  * The unit is the one the sport's rulebook prints first (metres; yards for cricket, whose frame is measured from the middle of the pitch, which is the middle of the ground). The size of these surfaces is a range, so the frame
@@ -180,7 +188,7 @@ function centreFrame(sport, title, unit, x, y) {
180
188
  unit,
181
189
  x: [-x, x],
182
190
  y: [-y, y],
183
- origin: sport === "cricket" ? "the middle of the pitch, the centre of the ground" : "the centre of the surface",
191
+ origin: sport === "cricket" ? "the middle of the pitch, the centre of the ground" : isPoolSport(sport) ? "the centre of the water" : "the centre of the surface",
184
192
  yDirection: "up",
185
193
  size: "variable",
186
194
  ends: sport === "cricket" ? "none" : "fixed",
@@ -196,7 +204,54 @@ const gaelicFrame = centreFrame("gaelic", "Gaelic games field, in metres from th
196
204
  const cricketFrame = centreFrame("cricket", "Cricket ground, in yards from the middle of the pitch", "yd", 75, 75);
197
205
  const fieldHockeyFrame = centreFrame("fieldhockey", "Field hockey pitch, in metres from the centre", "m", 45.7, 27.5);
198
206
  const handballFrame = centreFrame("handball", "Handball court, in metres from the centre", "m", 20, 10);
199
- for (const frame of [nhlApi, hockeyTech, nbaStats, nflTracking, mlbam, retrosheet, curling, tennisFrame, volleyballFrame, badmintonFrame, pickleballFrame, tableTennisFrame, lacrosseFrame, rugbyFrame, aflFrame, gaelicFrame, cricketFrame, fieldHockeyFrame, handballFrame])
207
+ // The pools: the middle of the water, x along it from the starting wall (left) towards the turning wall, y positive towards the top as the pool is drawn wide, so that lane 1 (or 0) is at the bottom. The frame of a
208
+ // race replay (`raceTimeline`) puts a swimmer's distance along the pool and the lane's place across it in this frame.
209
+ const swimmingFrame = centreFrame("swimming", "Swimming pool, in metres from the centre of the water", "m", 25, 13);
210
+ const waterPoloFrame = centreFrame("waterpolo", "Water polo pool, in metres from the centre of the water", "m", 12.8, 10);
211
+ const divingFrame = centreFrame("diving", "Diving well, in metres from the centre of the water", "m", 10.5, 13.5);
212
+ const artisticFrame = centreFrame("artisticswimming", "Artistic swimming area, in metres from the centre of the water", "m", 15, 10);
213
+ /**
214
+ * The athletics stadium in the plain frame of its middle: the middle of the track as the origin, x along the straights (positive towards the right as the stadium is drawn wide), y across them, positive
215
+ * towards the bottom: the finish straight is at positive y, with the finish line at 42.195 m (half a straight) and the athletes running to the right along it. In metres. The frame is the plan's own
216
+ * (`athleticsPlan`), so a point of a lane (`pose`) is a point of the frame. It is fitted to the stadium's box, which is the oval's outer edge, so it is for a drawing of the stadium (the covered track
217
+ * too) and not for one field event alone at a large scale. This package's own frame: no tracking provider's format was read for athletics.
218
+ */
219
+ const athleticsFrame = {
220
+ name: "athletics",
221
+ title: "Athletics stadium, in metres from the middle of the track",
222
+ sport: "athletics",
223
+ unit: "m",
224
+ x: [-100, 100],
225
+ y: [-60, 60],
226
+ origin: "the middle of the track",
227
+ yDirection: "down",
228
+ size: "variable",
229
+ ends: "none",
230
+ landmarks: (size) => ({ x: span(-size.length / (1 / 0.3048) / 2, size.length / (1 / 0.3048) / 2, 0, size.length), y: span(-size.width / (1 / 0.3048) / 2, size.width / (1 / 0.3048) / 2, 0, size.width) }),
231
+ source: "this package's own frame: the middle of the track as the origin",
232
+ note: "Positive x is towards the right as the stadium is drawn wide, positive y towards the bottom, where the finish straight is. The athletes run counter-clockwise: to the right along the finish straight. The frame is fitted to the stadium's outer edge.",
233
+ };
234
+ /**
235
+ * The skating rink in the plain frame of its middle: the middle of the rink (the long track's ice, the short track's or the figure skating rink) as the origin, x along it (positive towards the right as
236
+ * the rink is drawn wide), y across it, positive towards the bottom, where a long track's finishing straight, a short track's finishing line and a figure skating rink's judges are. In metres. The frame is
237
+ * the plan's own (`skatingPlan`): a point of a lane (`pose`) is a point of the frame. It is fitted to the rink's box. This package's own frame: no tracking provider's format was read for skating.
238
+ */
239
+ const skatingFrame = {
240
+ name: "skating",
241
+ title: "Skating rink, in metres from the middle of the rink",
242
+ sport: "skating",
243
+ unit: "m",
244
+ x: [-100, 100],
245
+ y: [-60, 60],
246
+ origin: "the middle of the rink",
247
+ yDirection: "down",
248
+ size: "variable",
249
+ ends: "none",
250
+ landmarks: (size) => ({ x: span(-size.length / (1 / 0.3048) / 2, size.length / (1 / 0.3048) / 2, 0, size.length), y: span(-size.width / (1 / 0.3048) / 2, size.width / (1 / 0.3048) / 2, 0, size.width) }),
251
+ source: "this package's own frame: the middle of the rink as the origin",
252
+ note: "Positive x is towards the right as the rink is drawn wide, positive y towards the bottom. The skaters go counter-clockwise: to the right along the finishing straight at the bottom. The frame is fitted to the rink's box.",
253
+ };
254
+ for (const frame of [nhlApi, hockeyTech, nbaStats, nflTracking, mlbam, retrosheet, curling, tennisFrame, volleyballFrame, badmintonFrame, pickleballFrame, tableTennisFrame, padelFrame, squashFrame, racquetballFrame, sepakTakrawFrame, teqballFrame, roundnetFrame, netballFrame, lacrosseFrame, rugbyFrame, aflFrame, gaelicFrame, cricketFrame, fieldHockeyFrame, handballFrame, swimmingFrame, waterPoloFrame, divingFrame, artisticFrame, athleticsFrame, skatingFrame])
200
255
  if (!Object.prototype.hasOwnProperty.call(FRAMES, frame.name))
201
256
  registerFrame(frame);
202
257
  // Retrosheet's hit-location diagram (Project Scoresheet's) draws the field in sectors: columns of the outfield from the left field
package/dist/geojson.js CHANGED
@@ -88,6 +88,9 @@ export function sceneToGeoJSON(source, options = {}) {
88
88
  visit(g.coordinates);
89
89
  };
90
90
  scene.items.forEach((item, order) => {
91
+ // A pageant's pictures are a picture laid over the surface, not a part of it: they are left out.
92
+ if (item.data?.pg !== undefined)
93
+ return;
91
94
  if (options.filter !== undefined && !options.filter(item))
92
95
  return;
93
96
  const s = item.style;
@@ -1,4 +1,5 @@
1
- export { BADMINTON, BEACH_VOLLEYBALL, CURLING, PICKLEBALL, STONE_DIAMETER, TABLE_TENNIS, TENNIS, VOLLEYBALL, DEFAULT_FENCE, FEET_PER_METRE, FEET_PER_YARD, FENCE_ANGLES, FOOTBALL, GOALPOST_WIDTH, HASH_LENGTH, MLB, NBA, NHL, fenceAt, fencePoints, dimensionsOf, fenceIn, footballLength, inch, surfaceSize, secondBase, skinJoin, threePointJoin } from "./geometry.ts";
1
+ export { ARTISTIC, DIVING, DIVING_LINES, SWIMMING, SWIMMING_WIDTHS, WATER_POLO } from "./pool.figures.ts";
2
+ export { BADMINTON, BEACH_VOLLEYBALL, CURLING, NETBALL, PADEL, PICKLEBALL, RACQUETBALL, ROUNDNET, SEPAK_TAKRAW, SITTING_VOLLEYBALL, SQUASH, STONE_DIAMETER, TABLE_TENNIS, TENNIS, TEQBALL, VOLLEYBALL, DEFAULT_FENCE, FEET_PER_METRE, FEET_PER_YARD, FENCE_ANGLES, FOOTBALL, GOALPOST_WIDTH, HASH_LENGTH, MLB, NBA, NHL, fenceAt, fencePoints, dimensionsOf, fenceIn, footballLength, inch, surfaceSize, secondBase, skinJoin, threePointJoin } from "./geometry.ts";
2
3
  export type { FencePoint, FootballSpec, SizedSport } from "./geometry.ts";
3
4
  export { boardsY } from "./surfaces/hockey.ts";
4
5
  export { FEET_PER, SURFACE_UNITS, UNITS, convertLength, convertPoint, isUnit, lengthsIn } from "./units.ts";
@@ -1,5 +1,6 @@
1
1
  // The dimensions of every surface, in feet, with the few functions that follow from them.
2
- export { BADMINTON, BEACH_VOLLEYBALL, CURLING, PICKLEBALL, STONE_DIAMETER, TABLE_TENNIS, TENNIS, VOLLEYBALL, DEFAULT_FENCE, FEET_PER_METRE, FEET_PER_YARD, FENCE_ANGLES, FOOTBALL, GOALPOST_WIDTH, HASH_LENGTH, MLB, NBA, NHL, fenceAt, fencePoints, dimensionsOf, fenceIn, footballLength, inch, surfaceSize, secondBase, skinJoin, threePointJoin } from "./geometry.js";
2
+ export { ARTISTIC, DIVING, DIVING_LINES, SWIMMING, SWIMMING_WIDTHS, WATER_POLO } from "./pool.figures.js";
3
+ export { BADMINTON, BEACH_VOLLEYBALL, CURLING, NETBALL, PADEL, PICKLEBALL, RACQUETBALL, ROUNDNET, SEPAK_TAKRAW, SITTING_VOLLEYBALL, SQUASH, STONE_DIAMETER, TABLE_TENNIS, TENNIS, TEQBALL, VOLLEYBALL, DEFAULT_FENCE, FEET_PER_METRE, FEET_PER_YARD, FENCE_ANGLES, FOOTBALL, GOALPOST_WIDTH, HASH_LENGTH, MLB, NBA, NHL, fenceAt, fencePoints, dimensionsOf, fenceIn, footballLength, inch, surfaceSize, secondBase, skinJoin, threePointJoin } from "./geometry.js";
3
4
  export { boardsY } from "./surfaces/hockey.js";
4
5
  export { FEET_PER, SURFACE_UNITS, UNITS, convertLength, convertPoint, isUnit, lengthsIn } from "./units.js";
5
6
  export { METRES_PER_FOOT, METRES_PER_YARD, SOCCER, SOCCER_PITCHES, SOCCER_PITCH_IDS, fullPitch, goalAreaWidth, penaltyAreaWidth, soccerPitchClass, soccerSpec } from "./surfaces/soccer-spec.js";