@johnmorrisdotca/kyogijo-stadiums 0.12.2 → 0.14.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 +27 -0
- package/NOTICE.md +1 -1
- package/README.md +42 -14
- package/dist/budo/judo.d.ts +6 -0
- package/dist/budo/judo.js +43 -6
- package/dist/budo/plan.js +12 -1
- package/dist/budo/types.d.ts +3 -1
- package/dist/draw.js +1 -1
- package/dist/leagues/budo.d.ts +14 -1
- package/dist/leagues/budo.js +10 -2
- package/dist/leagues/sources.js +2 -0
- package/dist/leagues.d.ts +1 -1
- package/dist/leagues.js +4 -2
- package/dist/multi-entry.d.ts +1 -0
- package/dist/multi-entry.js +1 -0
- package/dist/multi.draw.d.ts +57 -1
- package/dist/multi.draw.js +38 -10
- package/dist/multi.style.js +3 -2
- package/dist/multi.turn.d.ts +32 -0
- package/dist/multi.turn.js +253 -0
- package/dist/strings.d.ts +1 -1
- package/dist/strings.js +4 -4
- package/dist/turn-entry.d.ts +1 -1
- package/dist/turn-entry.js +1 -1
- package/dist/turn.camera.d.ts +6 -4
- package/dist/turn.camera.js +2 -2
- package/dist/turn.dom.d.ts +9 -4
- package/dist/turn.dom.js +13 -5
- package/dist/turn.kit.d.ts +5 -3
- package/dist/turn.kit.js +2 -1
- package/dist/turn.markup.js +2 -2
- package/dist/turn.model.d.ts +16 -2
- package/dist/turn.model.js +33 -26
- package/dist/turn.style.js +4 -0
- package/dist/venue.d.ts +6 -0
- package/dist/venue.js +7 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ All notable changes to this project are written here. The format follows
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.14.0] - 2026-10-20
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **The judo kata area, with its centre tape and its judges** (`budo: { style: "kata" }`, which says `league: "ijf-kata"`; `style: "shiai"` is the contest area, the default). From the IJF's Sport and Organisation Rules of 21 January 2026 (B1.8, the judges' article, B1.10), the Kata Commission's Tournament Handbook of 2024 and its Criteria for the Evaluation of January 2025: an area of 10 m (World Championships) or 8 m, a safety area of at least 2 m, two white tapes of 5 cm by 50 cm 3 m from the centre either side, **and now the tape of the same colour at the centre** (the area had the two only); with `officials`, **the five judges' seats 1.25 m apart on the shomen side, the central judge at the centre, with their table, and the coach's chair at the centre on the opposite side**, where the pair enters (a label says so), and no referee's place. A new `JudoFigures.centre` and `JudoFigures.panel`, four new labels (`centre-tape`, `kata-judges`, `coach-chair`, `kata-entry`, English and Japanese), the two sources in `LEAGUE_SOURCES`, 2D and 3D, light and dark. Docs: a kata section with two pictures in [the budō page](./docs/budo.md#the-kata-area); the gallery has the area with and without its judges. The rules do not say which tape is tori's and which is uke's, nor which way a tape lies, so none is assigned.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Two kata areas side by side are 2 m apart, not 4 m.** The kata area took the contest area's 4 m common safe zone, but the Handbook asks for "a common safety area of minimum 2 meters" between adjoining kata areas and B1.8 for a safety area "between and around the mat" of at least 2 m. `IJF_KATA.common` is 2 (`docs/variants.md` said 4).
|
|
19
|
+
|
|
20
|
+
## [0.13.0] - 2026-10-20
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Tournament layouts in 3D** (`mountMultiTurn`, `multiTurnMarkup`, `buildMultiTurn` and `multiPresets` of `@johnmorrisdotca/kyogijo-stadiums/multi`). A layout can be turned like any surface: the same four viewpoints (overhead, broadcast, end-on and low corner), turn, tilt, zoom, reset and auto-turn, the same drag, keys and pinch, and the steady camera of 0.12.2 (a fixed scale for the whole turn, ten-decimal matrices, the lens of 8), with the whole floor fitted at every angle. It is the 3D view and not a second renderer: the layout is built as a `TurnModel`, so the camera, the controls and the tests are the ones every surface has (`mountKyogijoTurn` is now `mountTurn` over `buildTurn`, and `mountMultiTurn` is `mountTurn` over `buildMultiTurn`; `TurnModel` has `presets` and `flat` for a model with viewpoints and a flat drawing of its own). Each surface stands as it does on its own page and in its own cell (`uprightsFor`, moved and turned with the cell, and with the hall when the hall turns the layout): the nets and posts of every net sport and a table tennis table as a top 76 cm over the floor on its skirt and legs, with the table's own drawing on it and a soft shadow on the floor, each table's parts drawn in the right order from every side. What only a layout has is stood up from the figures the flat drawing draws: a surround of 75 cm round each area (the ITTF Handbook, 3.2.3.3), in pieces of at most 3 m, that gives way a little only to an eye low on its side (`Plane.fadeAt`); an umpire's chair and a score table as solid blocks; the scoreboard hung over the middle of the floor and facing the eye, and one at each surface where the layout has them. With `stadium` the stands of the hall are raised on the floor's ground (`standsVenueOf`, the same planes `standsVenue` makes for one surface), with a roof on request. The viewpoints are turned to the layout: a net sport's end-on view looks along its surfaces, and a floor taller than it is wide is turned a quarter so that its long way runs across the screen. The heights of the chairs, the tables and the scoreboard are ours (no rule gives them); the table's, the net's and the surround's are the rulebook's.
|
|
25
|
+
- **`halls.html` has the 3D view.** A View choice (`2D` or `3D`, `view=3d` in the address), the viewpoint in the address (`viewpoint=`), the roof of the stadium (`roof=1`) and the 3D view's own controls under the floor; a layout chosen in 3D opens on the viewpoint chosen. Try it: <https://johnmorrisdotca.github.io/kyogijo-stadiums/halls.html?preset=tabletennis-4&view=3d>.
|
|
26
|
+
- **Docs and README.** A section "In 3D" on [the layouts page](./docs/multi.md#in-3d) with a picture of a layout in 3D (four table tennis areas, light and dark); the same picture in the README's layouts section.
|
|
27
|
+
- **Japanese**, two phrases for the parts named in a layout's 3D description: `競技エリアのフェンス` (the competition area's fence) and `審判席と記録台` (the umpires' chairs and the score tables).
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- `multiDrawing(options, raise)` (internal to `multi.draw.ts`) is the drawing of a layout with what was worked out to make it; `drawMulti` is its string. A layout made as the floor of a 3D view leaves out what the 3D view stands up. The drawn picture is unchanged.
|
|
32
|
+
|
|
33
|
+
### Tests
|
|
34
|
+
|
|
35
|
+
- The size-steadiness test (`src/turn.size.test.ts`) and the camera-fit test (`src/turn.camera.test.ts`) now run on every tournament layout, alone and in a stadium, in place of four layouts used as a plain floor; the depth-order and whole-floor tests of 0.12.2 (`src/turn.raised.test.ts`) run on the tables of the table tennis layouts and on the floor and stands of five layouts at every turn and tip, desk and phone; `src/multi.turn.test.ts` holds each surface to its cell (also in a hall that turns the layout), the surrounds, chairs, scoreboards and stands, the viewpoints and the markup; `e2e/halls.demo.mjs` plays the layouts page in 3D in a real browser (the controls, the address, a full turn's size, the legs under each table's top, the stadium and its roof, Japanese, a phone).
|
|
36
|
+
|
|
10
37
|
## [0.12.2] - 2026-10-20
|
|
11
38
|
|
|
12
39
|
### Added
|
package/NOTICE.md
CHANGED
|
@@ -33,7 +33,7 @@ picture or code of the sources is copied; each source is named here so that the
|
|
|
33
33
|
| `geometry`: the swimming pool, the water polo field, the diving well and the artistic swimming area | World Aquatics, Competition Regulations, in force as from 25 June 2025 (Part Two Article 16, Part Four Article 13 and Appendix 2, Part Six Article 18 and Appendices 3 and 4, Part Seven Article 27), and the Facilities Rules 2017-2021 and 2021-2025 (FR 2 to FR 5) | Facts; no text or drawing copied |
|
|
34
34
|
| `leagues`: the athletics track | World Athletics' Track and Field Facilities Manual (2019 edition, Chapters 1 to 3) and its 400 Metre Standard Track Marking Plan (Figure 2.2.1.6a), the Competition and Technical Rules (Books C1.1 and C2.1, in force 1 July 2026) and the Marking Plan for the Standard Short Track (1 January 2026) | Facts; no text or drawing copied |
|
|
35
35
|
| `leagues`: the skating rinks | The International Skating Union's Sports Rules - Speed Skating (Special Regulations and Technical Rules, Rules 203 to 206, 226 to 228 and 253 to 257, and "H. Track", effective 12 June 2026), Special Regulations and Technical Rules Short Track Speed Skating (Rule 280 and the diagram of the tracks, 2024) and Sports Rules - Figure Skating (Rule 342, effective 12 June 2026) | Facts; no text or drawing copied |
|
|
36
|
-
| `leagues` and `halls`: the budō surfaces | The International Judo Federation's Sport and Organisation Rules (version of 21 January 2026, 8.7, Article 9, B1.8; and the June 2020 version, 18.1); the All Japan Judo Federation's 大会運営ガイドブック2023; the World Karate Federation's Kumite and Kata Competition Rules (2026); the International Kendo Federation's Regulations of Kendo Shiai and Shinpan (Article 2 and Figure 1); the Japan Sumo Association's 相撲規則 土俵規定 第一条 and 大相撲クイズ, as the Sasakawa Sports Foundation and ozumo.jp quote them; the All Nippon Kyudo Federation's 弓道競技運営要領 (2016) and the National Sports Festival 2015's rules for kinteki and enteki; the tatami sizes of English and Japanese Wikipedia; the Kodokan's 施設のご案内, the Nippon Budokan's 日本武道館建物等概要 (October 2021), and English and Japanese Wikipedia and Wikidata on the five halls and the kimarite | Facts |
|
|
36
|
+
| `leagues` and `halls`: the budō surfaces | The International Judo Federation's Sport and Organisation Rules (version of 21 January 2026, 8.7, Article 9, B1.8; and the June 2020 version, 18.1) and its Kata Commission's Tournament Handbook (2024) and Criteria for the Evaluation (January 2025); the All Japan Judo Federation's 大会運営ガイドブック2023; the World Karate Federation's Kumite and Kata Competition Rules (2026); the International Kendo Federation's Regulations of Kendo Shiai and Shinpan (Article 2 and Figure 1); the Japan Sumo Association's 相撲規則 土俵規定 第一条 and 大相撲クイズ, as the Sasakawa Sports Foundation and ozumo.jp quote them; the All Nippon Kyudo Federation's 弓道競技運営要領 (2016) and the National Sports Festival 2015's rules for kinteki and enteki; the tatami sizes of English and Japanese Wikipedia; the Kodokan's 施設のご案内, the Nippon Budokan's 日本武道館建物等概要 (October 2021), and English and Japanese Wikipedia and Wikidata on the five halls and the kimarite | Facts |
|
|
37
37
|
| `frames`: the soccer providers' coordinates | StatsBomb's Open Data Events specification (Appendix 2), the Wyscout and Impect glossaries, the Metrica Sports and SkillCorner open-data READMEs; for Opta, Tracab and Second Spectrum, whose specifications are not public, the figures of mplsoccer, ggsoccer, kloppy and floodlight (docs/sources.md) | Facts; no text, table or code copied |
|
|
38
38
|
| `parks`: the fence of each ballpark, current and past, and the seasons of a past park | The distances (and, for a park whose fence moved, the years an article dates them) published in the English and Japanese Wikipedia article of each park, at the revision cited below; the seasons a club played there from the same article's list of tenants | Facts. The articles are CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/); none of their text, tables or images is used, and the angles between the distances are our own reading |
|
|
39
39
|
| `parks`: the Wikidata item of each ballpark (`wikidata`) | The item (`Q49136`) that each cited article is linked to, read with the MediaWiki API (`pageprops`, `wikibase_item`) and checked against the item's label | Wikidata's data is CC0 (https://creativecommons.org/publicdomain/zero/1.0/) |
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h1 align="center">Kyogijo Stadiums <sub>競技場</sub></h1>
|
|
2
2
|
|
|
3
3
|
<p align="center"><strong>Sports surfaces as SVG, drawn to scale, with the score on them.</strong><br>
|
|
4
|
-
The NFL, CFL and IFAF football fields, the NHL rink, the NBA court, the soccer pitch and futsal court, the baseball field of every MLB ballpark, current and past, and every NPB home park, the rink and court of 167 NHL, NBA, WNBA and PWHL arenas, and the surfaces of curling, athletics, speed, short track and figure skating, swimming, water polo, diving, artistic swimming, tennis, volleyball (indoor, beach and sitting), badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey, handball, judo, karate, kendo, sumo, kyūdō and a dojo of tatami, thirty-nine sports in all, each drawn from its rulebook or its published distances, with each team's name and logo on its side and the score in the middle, a lineup and the situation of the game on them, with stands and a crowd, a pageant of flags and a 3D view. Wide or tall, light or dark, a
|
|
4
|
+
The NFL, CFL and IFAF football fields, the NHL rink, the NBA court, the soccer pitch and futsal court, the baseball field of every MLB ballpark, current and past, and every NPB home park, the rink and court of 167 NHL, NBA, WNBA and PWHL arenas, and the surfaces of curling, athletics, speed, short track and figure skating, swimming, water polo, diving, artistic swimming, tennis, volleyball (indoor, beach and sitting), badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey, handball, judo, karate, kendo, sumo, kyūdō and a dojo of tatami, thirty-nine sports in all, each drawn from its rulebook or its published distances, with each team's name and logo on its side and the score in the middle, a lineup and the situation of the game on them, with stands and a crowd, a pageant of flags and a 3D view. Wide or tall, light or dark, a badge for a list, a helper for React, a custom element and a frame for a page that runs no script. One function, no dependencies.</p>
|
|
5
5
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<a href="https://github.com/johnmorrisdotca/kyogijo-stadiums/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/johnmorrisdotca/kyogijo-stadiums/actions/workflows/ci.yml/badge.svg"></a>
|
|
@@ -72,20 +72,20 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
72
72
|
|
|
73
73
|
## Features
|
|
74
74
|
|
|
75
|
-
- **Thirty-nine surfaces, to scale.** The NFL, CFL and IFAF fields, the NHL rink, the NBA court, the soccer pitch and futsal court, the baseball field, the curling sheet, the courts of
|
|
75
|
+
- **Thirty-nine surfaces, to scale.** The NFL, CFL and IFAF fields, the NHL rink, the NBA court, the soccer pitch and futsal court, the baseball field, the curling sheet, the courts of twelve net and racket sports, the pools, the athletics stadium, the skating rinks, the fields of seven field sports, and the budō. Every figure is cited in [sources](./docs/sources.md). [The surfaces](./docs/surfaces.md).
|
|
76
76
|
- **Each league's rulebook.** `league: "fiba"` draws a court as FIBA marks it: 48 variants, from the WNBA, the NCAA and the IIHF to Little League, PONY, softball, Curling Canada, FIVB's beach volleyball, rugby league and the NLL's box lacrosse, each cited. [League variants](./docs/variants.md).
|
|
77
|
-
- **A realistic basketball floor.** `court: { hardwood: true }` draws maple boards that run the length of the court with staggered ends, grain
|
|
78
|
-
- **The stands and the crowd.** `crowd: true` draws the seating round any surface that has spectators: a bowl, two sides, a horseshoe, an arena's courtside rows, or a ballpark's grandstands and bleachers
|
|
79
|
-
- **Curling, from the rule books.** A sheet from World Curling's and Curling Canada's rules, tall by default, with the board and the hammer in a score, `curlingStones` for the stones of an end, scored by the rules, `show: "folded"` for the whole sheet with both houses enlarged beside it
|
|
80
|
-
- **Net, racket and court sports, from their rulebooks.** The ITF's
|
|
77
|
+
- **A realistic basketball floor.** `court: { hardwood: true }` draws maple boards that run the length of the court with staggered ends, grain, stained keys, the baskets and stanchions with soft shadows, a coaching box and benches, and a satin sheen, in every league and renderer. The clean floor stays the default. [Hardwood](./docs/hardwood.md).
|
|
78
|
+
- **The stands and the crowd.** `crowd: true` draws the seating round any surface that has spectators: a bowl, two sides, a horseshoe, an arena's courtside rows, or a ballpark's grandstands and bleachers, with the people as seeded heads and shoulders in the home colours, the visitors at an end and the empty seats showing (`density`, or `attendance` over `capacity`). Blocks at small sizes; the stands as data. [The crowd](./docs/crowd.md).
|
|
79
|
+
- **Curling, from the rule books.** A sheet from World Curling's and Curling Canada's rules, tall by default, with the board and the hammer in a score, `curlingStones` for the stones of an end, scored by the rules, `show: "folded"` for the whole sheet with both houses enlarged beside it, and a heat map and statistics for many ends. [Curling](./docs/curling.md).
|
|
80
|
+
- **Net, racket and court sports, from their rulebooks.** The ITF's, FIVB's (indoor, beach, sitting), BWF's, USA Pickleball's and ITTF's courts and table, the padel, squash, racquetball, sepak takraw, teqball, roundnet and netball courts, each in its look (hard court, clay, grass, wood, sand), with a board of sets and games and a ball beside the server. [Net, racket and court sports](./docs/courts.md).
|
|
81
81
|
- **Swimming, water polo, diving and artistic swimming, from World Aquatics' regulations.** The competition pool of 50 or 25 m with its lanes, ropes, blocks, touch panels and flags; the water polo field; the diving well with its springboards and platforms; the artistic swimming area; several pools in a natatorium. The lanes of a race carry names, flags, places, times and splits, with a race replay by lane (`raceTimeline`) and a `splitsChart`. [Pools](./docs/pools.md).
|
|
82
|
-
- **Lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey and handball, from their rulebooks.** The fields and floors of World Lacrosse,
|
|
82
|
+
- **Lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey and handball, from their rulebooks.** The fields and floors of World Lacrosse, World Rugby, the NRL, the AFL (at the size of a named ground), the GAA, the FIH and the IHF, and a cricket ground with a boundary of your own. A score is goals and behinds, goals and points or a board of runs, wickets and overs. [Field sports](./docs/field-sports.md).
|
|
83
83
|
- **The athletics stadium, from World Athletics' rules.** The 400 m track with its lanes and staggers worked out from the running lines, curved and relay starts, hurdles, the steeplechase, every field event, a close-up of each start, the covered 200 m track, and lane draws, results, a race replay and the marks of throws and jumps. [The athletics stadium](./docs/athletics.md).
|
|
84
84
|
- **The skating rinks, from the ISU's rules.** The standard 400 m speed skating track with its lanes, blocks and coaches' area and the starting and finishing lines of every race worked out lane by lane; the short track's oval of 111.12 m with its blocks and starting positions; the figure skating rink of 60 by 30 m with its judges' seats; and pairs, results, a race replay and the elements of a programme on the ice. [The skating rinks](./docs/skating.md).
|
|
85
85
|
- **The budō, from the federations' rules.** The IJF's and the All Japan Judo Federation's judo areas, the WKF's karate areas, the kendo shiai-jo, the sumo dohyō, the kyūdōjō, and **a dojo builder**: a floor of tatami laid as real units (no four corners meet), in jō or metres, with the walls, doors, windows, shrine and kamiza. Five famous halls are on the atlas, each with only what a source gives, and the scores are judo's ippon, waza-ari and shido, karate's points, kendo's points and sumo's kimarite. [The budō](./docs/budo.md).
|
|
86
86
|
- **Soccer, to the Laws.** A pitch from Law 1 of the IFAB Laws of the Game of any size, with presets (international, UEFA, MLS, NCAA, the FA's 9-, 7- and 5-a-side, FIFA's futsal), half pitches, five mowing patterns, four goal styles, penalties and extra time in a score. [Soccer](./docs/soccer.md).
|
|
87
87
|
- **Every ballpark.** The 30 current MLB parks and 44 that MLB clubs have left (the Polo Grounds, Ebbets Field, the Astrodome and more), and the 12 home parks of Nippon Professional Baseball with eight other NPB grounds, each with its fence drawn from the distances published for it; a past park whose fence moved is drawn as it stood in a season. [Ballparks](./docs/ballparks.md).
|
|
88
|
-
- **Soccer grounds, arenas and an atlas.** 64 soccer grounds, each pitch at its published size, and 167 NHL, NBA, WNBA and PWHL arenas (`drawKyogijo({ sport: "nhl", arena: "boston-garden" })`), a rink or
|
|
88
|
+
- **Soccer grounds, arenas and an atlas.** 64 soccer grounds, each pitch at its published size, and 167 NHL, NBA, WNBA and PWHL arenas (`drawKyogijo({ sport: "nhl", arena: "boston-garden" })`), a rink or court at the arena's own size where known, and every park, ground, arena and budō hall (330 places) on a map, by sport, league, country and year, each found by any of its names. [The grounds](./docs/grounds.md), [the arenas](./docs/arenas.md), [the atlas](./docs/atlas.md), [names](./docs/ballparks.md#names).
|
|
89
89
|
- **Walls and quirks.** How high the fence stands, stretch by stretch and season by season (the Green Monster at 37 feet 2 inches, the Crawford Boxes, the Baggie), drawn as a band outside the fence whose width and shade say the height, with a key (`walls`); and Tal's Hill, Wrigley Field's ivy and basket, overhangs, poles, bullpens, the backstop and the dugouts (`quirks`), each from the park's article, none guessed: [ballparks](./docs/ballparks.md).
|
|
90
90
|
- **Special games.** A surface set inside another, to scale: an NHL rink on a ballpark's infield or a football stadium's field (the Winter Classic, the Stadium Series, the Heritage Classic), a college basketball court on the deck of a carrier, a baseball field laid over a London stadium's pitch. 18 games, each with its day, its venue and its sources, and the place of the rink cited where a source gives it and marked as a convention where none does. [Special games](./docs/special-games.md).
|
|
91
91
|
- **Surfaces through the years.** `year: 1975` draws a surface as its league's rules marked it that season, each change cited. [Surfaces through the years](./docs/eras.md).
|
|
@@ -93,19 +93,19 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
93
93
|
- **The situation of a game.** `situation` draws what is happening: hockey's power play or empty net as a pill with the attacking zone tinted, and a shootout as a strip of dots; baseball's runners lit on the diamond with a scorebug (outs, inning, count); football's line of scrimmage, first-down line, red zone and down-and-distance tag, with a drive chart; in the badge and the compact card too, and in the description. [The situation](./docs/situation.md).
|
|
94
94
|
- **Lineups.** A `lineup` layer places a team's players by position code (`GK`, `CB`, `HK`, `C`) with no coordinates: it reads where each stands from a formation (36 of them, in 13 sports), draws a disc or a jersey with the shirt number and the name under it, a captain's C and a flag, and puts the visitors at the other end. A drawing with a lineup puts the score in the strip under it, so the panel hides no player. [Lineups](./docs/team-shape.md#lineups).
|
|
95
95
|
- **A pageant.** Each team's flag or crest laid large over its half of the surface, as a stadium lays giant flags and crests for a final: `pageant: "carpet"` (a flag at its own ratio with a border and a gentle fabric) or `"stage"` (a crest on a round disc with a gold ring), an emblem or a trophy of your own in the centre circle, the score in the middle or in the strip, upright wide and tall, in light and dark, with an entrance in CSS for readers who have not asked for less motion. [The pageant](./docs/pageant.md).
|
|
96
|
-
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports](https://johnmorrisdotca.github.io/dougu-sports/) in one line, and an id goes wherever a logo, a flag or a mark is taken: `logo: "crest:shield"
|
|
96
|
+
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports](https://johnmorrisdotca.github.io/dougu-sports/) in one line, and an id goes wherever a logo, a flag or a mark is taken: `logo: "crest:shield"`, `pageant: { emblem: "trophy:hockey-cup" }`, `"ball:puck"`. Kyogijo bundles no emblem and keeps zero dependencies. [Emblems](./docs/emblems.md).
|
|
97
97
|
- **Country flags, by code.** `useFlags(render)` plugs in the sister package [Hata](https://github.com/johnmorrisdotca/hata) through a small adapter, and a team's `flag: "CA"` is its flag: round in a round mark, at its own proportions on a banner, a badge or a pageant's carpet. The same adapter serves [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets). Kyogijo bundles no flag and keeps zero dependencies; without the plug-in a code is ignored. [Flags](./docs/flags.md).
|
|
98
98
|
- **Zoom to a part of a surface.** `range: "offensive-zone"` crops a drawing to a rink's zone, a half court, the paint, the red zone, a soccer half, third or penalty area, the infield, a curling house, or a box of your own in any frame, with its data, heat, labels and score following. [Display ranges](./docs/ranges.md).
|
|
99
99
|
- **Wide, tall or fit the box.** Every surface lies wide or tall: tall turns it a quarter, keeps every word upright and puts the teams top and bottom. With `orientation: "auto"` the browser helpers follow the box.
|
|
100
|
-
- **Where a point lies, by the rules, and a click as a place.** `zoneAt("nhl", [69, 22], { frame: "nhl-api" })` names the zone and the area in it from the
|
|
100
|
+
- **Where a point lies, by the rules, and a click as a place.** `zoneAt("nhl", [69, 22], { frame: "nhl-api" })` names the zone and the area in it from the surface's own figures, with `isThreePointer`, `inSlot`, `isFair`, `isHomeRun` and the like; `clientPointToField(svg, x, y, { provider })` is a pointer's place in any of the frames, with the zone. `marks: true` writes `data-mark-id` and `data-zone` on every mark of a layer, for one listener to link it to a table. [Zones](./docs/zones.md), [pointing](./docs/pointer.md).
|
|
101
101
|
- **Goals, the strike zone and the stumps, end-on.** A goal mouth for hockey (6 by 4 feet), soccer, handball, water polo, lacrosse (6 by 6) and field hockey with the shots laid on it and its zones (the top shelf, the five-hole, the corners), the catcher's view of the strike zone with its nine and thirteen zones and the pitches numbered, and the wicket from the bowler's end with its line and length zones. [Targets](./docs/targets.md).
|
|
102
102
|
- **Data on the surface.** Points, lines, arrows, text, heat maps, hexagons, zone charts and density contours over any surface, in its feet or a data provider's frame, cut to its outline, with a table for each layer; ready-made shot and pass charts (the road to a tournament's final moved to [`@johnmorrisdotca/taisen-brackets`](https://www.npmjs.com/package/@johnmorrisdotca/taisen-brackets), its `/road` entry). [Data layers](./docs/layers.md), [charts](./docs/charts.md).
|
|
103
103
|
- **Small multiples and backgrounds.** `drawGrid` puts many drawings in one SVG, under a title and a subtitle, over a credit line, with a key they share, in a size for a social card, a square post or a phone; `background` lays a quiet pattern (felt, grass, wood, ice, paper, a grid, dots) or a photograph behind a drawing or a grid. [Layouts and backgrounds](./docs/layouts.md).
|
|
104
104
|
- **Tournament layouts.** Several surfaces laid out together for one large event, to scale, on one floor, as one SVG: thirteen presets from table tennis, pickleball, curling, judo, karate, badminton and tennis, each with its rule and sources, whether it fits a hall, and a real stadium round it. [Tournament layouts](./docs/multi.md).
|
|
105
105
|
- **Replay.** Tracking data played on any surface: the players with their numbers, the ball and its trail, and the passes, shots and goals as they happen, with controls, the keyboard and a live region, steps for a reader who prefers reduced motion, and a pause when the page is hidden. [Replay](./docs/replay.md).
|
|
106
|
-
- **A 3D view.** Any surface as a floor that turns by mouse, touch, wheel or keys, with four viewpoints (overhead, broadcast, end-on, low corner), and what the rulebook stands on it at its height: nets, antennae, baskets, rink boards and glass, goals, posts, stumps, a ballpark's fence, the walls of padel and squash, a pool's blocks,
|
|
106
|
+
- **A 3D view.** Any surface as a floor that turns by mouse, touch, wheel or keys, with four viewpoints (overhead, broadcast, end-on, low corner), and what the rulebook stands on it at its height: nets, antennae, baskets, rink boards and glass, goals, posts, stumps, a ballpark's fence, the walls of padel and squash, a pool's blocks, hurdles; and the venue round it (raked stands, roofs on request, a dojo's walls and gallery). Plain DOM and CSS over the same SVG. [The 3D view](./docs/turn.md).
|
|
107
107
|
- **Renderers.** The same drawing as plain data (a scene), on a canvas (a browser's or a Node canvas), in a d3 selection, as a mark of an Observable Plot, as GeoJSON and as a PNG in Node, each an entry of its own that imports nothing from outside the package. [Renderers](./docs/renderers.md).
|
|
108
|
-
- **Units and frames.** Each surface in its rulebook's unit and any other, and 48 coordinate frames (ten soccer providers, the NHL API, HockeyTech, NBA stats, NFL tracking, MLBAM, Retrosheet,
|
|
108
|
+
- **Units and frames.** Each surface in its rulebook's unit and any other, and 48 coordinate frames (ten soccer providers, the NHL API, HockeyTech, NBA stats, NFL tracking, MLBAM, Retrosheet, and a place from the net, the centre or the middle of the water of each other surface) to move a provider's points onto a surface. [Units](./docs/units.md), [coordinate frames](./docs/frames.md).
|
|
109
109
|
- **A compact badge and a compact card.** One strip for a list, or the surface with that strip under it.
|
|
110
110
|
- **Light and dark**, by the device or the page, and every colour a custom property; eight named looks, colours by feature, line widths and dashes, goal styles and mowing patterns, and arrows, axes and labels for teaching. [Theming](./docs/theming.md), [annotations](./docs/annotations.md).
|
|
111
111
|
- **Accessible.** Each drawing is an `img` with a title and a description that say the surface and the result, in English or Japanese. [Accessibility](./docs/accessibility.md).
|
|
@@ -494,7 +494,7 @@ console.log(svg.includes('viewBox="0 0 1200 675"'), svg.includes("Three ballpark
|
|
|
494
494
|
|
|
495
495
|
### Several surfaces on one floor
|
|
496
496
|
|
|
497
|
-
|
|
497
|
+
`drawMulti` lays the package's own surfaces out together for one large event, to scale, on one floor, with the officials' chairs, the boards and empty places for the event's words and marks ([tournament layouts](./docs/multi.md)). Thirteen presets with their rules and sources; `multiFit` says whether a layout fits a hall, `stadium: true` sets it inside real stands, and `mountMultiTurn` turns the floor in 3D.
|
|
498
498
|
|
|
499
499
|
```ts
|
|
500
500
|
import { drawMulti, multiLayout } from "@johnmorrisdotca/kyogijo-stadiums/multi";
|
|
@@ -523,7 +523,35 @@ console.log(layout.needs.length, layout.needs.width);
|
|
|
523
523
|
<br><em>Four table tennis areas under one scoreboard.</em>
|
|
524
524
|
</p>
|
|
525
525
|
|
|
526
|
-
|
|
526
|
+
<p align="center">
|
|
527
|
+
<picture>
|
|
528
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/multi-tabletennis-3d-desk-dark.webp">
|
|
529
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/multi-tabletennis-3d-desk-light.webp" alt="Four table tennis areas in 3D from a low corner: tables on legs, a surround round each, a hung scoreboard, and the 3D view's controls." width="640">
|
|
530
|
+
</picture>
|
|
531
|
+
<br><em>The same four in 3D.</em>
|
|
532
|
+
</p>
|
|
533
|
+
|
|
534
|
+
The [demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/halls.html) picks a preset, sets it in a hall, switches the stadium on and off, and turns it in 3D.
|
|
535
|
+
|
|
536
|
+
### A judo kata area
|
|
537
|
+
|
|
538
|
+
`budo: { style: "kata" }` is the IJF's kata area: a tape at the centre and one 3 m either side, and with `officials` the five judges 1.25 m apart on the shomen side and the coach's chair opposite ([the budō page](./docs/budo.md#the-kata-area)).
|
|
539
|
+
|
|
540
|
+
<p align="center">
|
|
541
|
+
<picture>
|
|
542
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/judo-kata-desk-dark.webp">
|
|
543
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/judo-kata-desk-light.webp" alt="The IJF's kata area with the five judges' seats above it and the coach's chair below" width="660">
|
|
544
|
+
</picture>
|
|
545
|
+
<br><em>The kata area, its judges and the coach's chair.</em>
|
|
546
|
+
</p>
|
|
547
|
+
|
|
548
|
+
<p align="center">
|
|
549
|
+
<picture>
|
|
550
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/judo-kata-tapes-desk-dark.webp">
|
|
551
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/judo-kata-tapes-desk-light.webp" alt="Three short white tapes 3 m apart across the middle of a kata area" width="660">
|
|
552
|
+
</picture>
|
|
553
|
+
<br><em>Close up: the centre tape and the two starting tapes.</em>
|
|
554
|
+
</p>
|
|
527
555
|
|
|
528
556
|
### The element in a page
|
|
529
557
|
|
package/dist/budo/judo.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ export interface JudoLayout {
|
|
|
37
37
|
marks: MMark[];
|
|
38
38
|
/** The width of the red band of a danger zone, or 0. */
|
|
39
39
|
danger: number;
|
|
40
|
+
/** A kata area's officials: the judges' tables (ours: the length of the seats), the five judges' seats of each and the coach's chairs, each as the rule places them; empty for a contest area. */
|
|
41
|
+
judges: {
|
|
42
|
+
tables: MBox[];
|
|
43
|
+
seats: MBox[];
|
|
44
|
+
coaches: MBox[];
|
|
45
|
+
};
|
|
40
46
|
}
|
|
41
47
|
/** The mats of a `tatami` option, or the league's own when none. @throws Error for a name that is not a size of mat. */
|
|
42
48
|
export declare function matOf(asked: BudoStyle["tatami"], fig: JudoFigures): MatSize;
|
package/dist/budo/judo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { boxD, rectArea, tapeBar, within } from "./kit.js";
|
|
2
|
-
import { emptyParts, grow, union } from "./parts.js";
|
|
2
|
+
import { boxOf, emptyParts, grow, union } from "./parts.js";
|
|
3
3
|
import { lay, matCount, seams, tatamiAreas, tint } from "./tatami.js";
|
|
4
4
|
/** The mats a `tatami` option names. */
|
|
5
5
|
export const TATAMI = Object.freeze({ "2x1": { length: 2, width: 1 }, "1x1": { length: 1, width: 1 }, "182x91": { length: 1.82, width: 0.91 } });
|
|
@@ -36,6 +36,8 @@ export const contestOf = (asked, fig) => (asked === undefined ? fig.contest.draw
|
|
|
36
36
|
export const safetyOf = (asked, fig) => (asked === undefined ? fig.safety.drawn : within(asked, fig.safety.min, fig.safety.max, "The safety area", "the IJF's Sport and Organisation Rules (8.7)"));
|
|
37
37
|
/** The technical table: 3 m by 0.8 m (ours: the rules give no size), centred on its contest area and set well outside the free zone. */
|
|
38
38
|
const TABLE = { length: 3, depth: 0.8, clear: 1.5 };
|
|
39
|
+
/** A kata area's chairs: 0.5 m square (ours: no rule gives a chair's size), the judges' table 0.8 m deep (ours) and the gap between a table and the free zone round the area, as for the technical table. */
|
|
40
|
+
const CHAIR = 0.5;
|
|
39
41
|
/** The plan of the competition area the options ask for. */
|
|
40
42
|
export function judoParts(o) {
|
|
41
43
|
const { fig, contest: c, safety: s, across, down, mat } = o;
|
|
@@ -73,9 +75,34 @@ export function judoParts(o) {
|
|
|
73
75
|
parts.shapes.push(tapeBar(`start-${k + 1}-left`, "start-left", `ky-bud-${o.tape[1]}-fill`, at(cx - m.fromCentre)));
|
|
74
76
|
});
|
|
75
77
|
}
|
|
78
|
+
// A kata area's centre: a strip of tape of the same colour as the two starting tapes (SOR B1.8).
|
|
79
|
+
if (o.start && fig.centre !== null) {
|
|
80
|
+
const m = fig.centre;
|
|
81
|
+
contests.forEach((b, k) => parts.shapes.push(tapeBar(`centre-${k + 1}`, "centre-tape", "ky-bud-white-fill", boxOf((b.x0 + b.x1) / 2, (b.y0 + b.y1) / 2, m.width, m.length))));
|
|
82
|
+
}
|
|
76
83
|
// The technical table of each area, outside the free zone, at the top.
|
|
77
84
|
const desks = [];
|
|
78
|
-
|
|
85
|
+
const judges = { tables: [], seats: [], coaches: [] };
|
|
86
|
+
if (o.officials && fig.panel !== null) {
|
|
87
|
+
// A kata area has no technical table: the five judges sit on the shomen side (the top), `apart` metres from each other, the central one at the centre of the area, and the coach's chair is at the centre on the
|
|
88
|
+
// opposite side (SOR, Kata judges and B1.10). The table and the chairs are drawn outside the free zone.
|
|
89
|
+
const { count, apart } = fig.panel;
|
|
90
|
+
const lastRow = contests.filter((_, k) => k >= (down - 1) * across);
|
|
91
|
+
for (const b of contests.filter((_, k) => k < across)) {
|
|
92
|
+
const cx = (b.x0 + b.x1) / 2;
|
|
93
|
+
const y1 = free.y0 - TABLE.clear;
|
|
94
|
+
const table = { x0: cx - (count * apart) / 2, y0: y1 - TABLE.depth, x1: cx + (count * apart) / 2, y1 };
|
|
95
|
+
judges.tables.push(table);
|
|
96
|
+
for (let i = 0; i < count; i += 1)
|
|
97
|
+
judges.seats.push(boxOf(cx + (i - (count - 1) / 2) * apart, table.y0 - 0.1 - CHAIR / 2, CHAIR, CHAIR));
|
|
98
|
+
}
|
|
99
|
+
for (const b of lastRow)
|
|
100
|
+
judges.coaches.push(boxOf((b.x0 + b.x1) / 2, free.y1 + TABLE.clear + CHAIR / 2, CHAIR, CHAIR));
|
|
101
|
+
judges.tables.forEach((d, k) => parts.areas.push(rectArea(`judges-table-${k + 1}`, "officials", "ky-bud-desk", d)));
|
|
102
|
+
judges.seats.forEach((d, k) => parts.areas.push(rectArea(`judge-${k + 1}`, "judges-seat", "ky-bud-seat", d)));
|
|
103
|
+
judges.coaches.forEach((d, k) => parts.areas.push(rectArea(`coach-${k + 1}`, "coach-chair", "ky-bud-seat", d)));
|
|
104
|
+
}
|
|
105
|
+
else if (o.officials) {
|
|
79
106
|
for (const b of contests.filter((_, k) => k < across)) {
|
|
80
107
|
const cx = (b.x0 + b.x1) / 2;
|
|
81
108
|
const y1 = free.y0 - TABLE.clear;
|
|
@@ -94,15 +121,25 @@ export function judoParts(o) {
|
|
|
94
121
|
if (across > 1)
|
|
95
122
|
marks.push({ id: "common-safe-zone", x: first.x1 + gap / 2, y: (first.y0 + first.y1) / 2, side: "bottom" });
|
|
96
123
|
marks.push({ id: "free-zone", x: width * 0.12, y: free.y0 + fig.freeZone / 2, side: "top" });
|
|
97
|
-
// The referee stands at the middle of the tatami, 2 m back from the line the contestants start on, facing the table (Article 9).
|
|
98
|
-
|
|
124
|
+
// The referee stands at the middle of the tatami, 2 m back from the line the contestants start on, facing the table (Article 9). A kata area has none.
|
|
125
|
+
if (!fig.kata)
|
|
126
|
+
marks.push({ id: "referee-position", x: fx, y: (first.y0 + first.y1) / 2 + 2, side: "bottom" });
|
|
127
|
+
if (fig.centre !== null && o.start)
|
|
128
|
+
marks.push({ id: "centre-tape", x: fx, y: (first.y0 + first.y1) / 2, side: "top" });
|
|
129
|
+
// The pair enters and leaves the mat on the side opposite the shomen (SOR, Kata judges): the bottom of the plan.
|
|
130
|
+
if (fig.kata)
|
|
131
|
+
marks.push({ id: "kata-entry", x: first.x0 + c * 0.2, y: first.y1 - 0.5, side: "bottom" });
|
|
99
132
|
marks.push({ id: "tatami", x: first.x0 + 0.5 * c, y: first.y0 + c * 0.7, side: "bottom" });
|
|
100
133
|
if (platform !== undefined)
|
|
101
134
|
marks.push({ id: "platform", x: width * 0.88, y: platform.y1 - fig.platform / 2, side: "bottom" });
|
|
102
135
|
if (desks.length > 0)
|
|
103
136
|
marks.push({ id: "technical-table", x: (desks[0].x0 + desks[0].x1) / 2, y: desks[0].y0 + TABLE.depth / 2, side: "top" });
|
|
104
|
-
|
|
105
|
-
|
|
137
|
+
if (judges.tables.length > 0)
|
|
138
|
+
marks.push({ id: "kata-judges", x: (judges.tables[0].x0 + judges.tables[0].x1) / 2, y: judges.tables[0].y0 + TABLE.depth / 2, side: "top" });
|
|
139
|
+
if (judges.coaches.length > 0)
|
|
140
|
+
marks.push({ id: "coach-chair", x: (judges.coaches[0].x0 + judges.coaches[0].x1) / 2, y: (judges.coaches[0].y0 + judges.coaches[0].y1) / 2, side: "bottom" });
|
|
141
|
+
const extent = union([free, ...desks.map((d) => grow(d, 0.3)), ...[...judges.tables, ...judges.seats, ...judges.coaches].map((d) => grow(d, 0.3))]);
|
|
142
|
+
return { parts, tatami, extent, contests, gap, pieces, mat, marks, danger: band, judges };
|
|
106
143
|
}
|
|
107
144
|
/** The number of mats of the competition area: a half mat counts a half. */
|
|
108
145
|
export const mats = (layout, mat) => Math.round(matCount(layout.pieces, mat) * 100) / 100;
|
package/dist/budo/plan.js
CHANGED
|
@@ -17,11 +17,22 @@ export const BUDO_SPORTS = Object.freeze(["judo", "karate", "kendo", "sumo", "ky
|
|
|
17
17
|
/** True for a sport of the budō family. */
|
|
18
18
|
export const isBudoSport = (sport) => BUDO_SPORTS.includes(sport);
|
|
19
19
|
const OWN = { judo: JUDO_LEAGUES, karate: KARATE_LEAGUES, kendo: KENDO_LEAGUES, sumo: SUMO_LEAGUES, kyudo: KYUDO_LEAGUES, dojo: DOJO_LEAGUES };
|
|
20
|
+
/** What `budo.style` asks of a judo area: true for a kata area, false for a contest area, undefined for neither said. @throws TypeError for a value that is not `shiai` or `kata`. */
|
|
21
|
+
function kataOf(style) {
|
|
22
|
+
if (style === undefined)
|
|
23
|
+
return undefined;
|
|
24
|
+
if (style !== "shiai" && style !== "kata")
|
|
25
|
+
throw new TypeError(`budo.style is "shiai" or "kata"`);
|
|
26
|
+
return style === "kata";
|
|
27
|
+
}
|
|
20
28
|
/** The league a set of options asks for: a rulebook's, else the sport's own. */
|
|
21
29
|
export function budoLeague(o) {
|
|
22
30
|
const sport = o.sport;
|
|
23
31
|
// `budo.range` names a kyūdōjō's kind, and `dojo.standard` a dojo's mats, where `league` does not.
|
|
24
|
-
const
|
|
32
|
+
const kata = sport === "judo" ? kataOf(o.budo?.style) : undefined;
|
|
33
|
+
if (kata !== undefined && o.league !== undefined && o.league !== "" && (o.league === "ijf-kata") !== kata)
|
|
34
|
+
throw new Error(`budo.style "${kata ? "kata" : "shiai"}" does not go with league "${o.league}": a kata area is the league "ijf-kata"`);
|
|
35
|
+
const asked = o.league === undefined || o.league === "" ? (sport === "kyudo" ? o.budo?.range : sport === "dojo" ? dojoSpecOf(o.dojo).standard : kata ? "ijf-kata" : undefined) : o.league;
|
|
25
36
|
if (asked !== undefined && asked !== "") {
|
|
26
37
|
const found = OWN[sport].find((l) => l.id === asked);
|
|
27
38
|
if (found === undefined)
|
package/dist/budo/types.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface BudoStyle {
|
|
|
17
17
|
};
|
|
18
18
|
/** Judo, karate and kendo: the arena floor under the surface. `budokan` is the Nippon Budokan's, an octagon 55 m across the flats (the Budokan's leaflet), with the surface in the middle; it must fit. */
|
|
19
19
|
hall?: "budokan";
|
|
20
|
+
/** Judo: `shiai` (the contest area, the default) or `kata` (the IJF's kata area, `league: "ijf-kata"`: a centre tape, two white tapes 3 m from it either side, a safety area of 2 m; with `officials`, the five judges' seats on the shomen side and the coach's chair opposite). */
|
|
21
|
+
style?: "shiai" | "kata";
|
|
20
22
|
/** Judo: the contest area's side, 8 m to 10 m. Kendo: the shiai-jo's side, 9 m to 11 m. In metres. */
|
|
21
23
|
size?: number;
|
|
22
24
|
/** Judo: the width of the safety area, 3 m or more (4 m by default). In metres. */
|
|
@@ -27,7 +29,7 @@ export interface BudoStyle {
|
|
|
27
29
|
start?: boolean;
|
|
28
30
|
/** Judo: a solid platform under the tatami, one metre wider and longer than it. Off by default. */
|
|
29
31
|
platform?: boolean;
|
|
30
|
-
/** Judo and karate: the technical table, the officials' seats and the judges, outside the safety area. Off by default. */
|
|
32
|
+
/** Judo and karate: the technical table, the officials' seats and the judges, outside the safety area (a judo kata area: the judges' table with the five judges' seats, and the coach's chair). Off by default. */
|
|
31
33
|
officials?: boolean;
|
|
32
34
|
/** Judo: draw the lines of the mats (the seams between them). On by default. */
|
|
33
35
|
seams?: boolean;
|
package/dist/draw.js
CHANGED
|
@@ -1069,7 +1069,7 @@ function drawnKyogijo(o) {
|
|
|
1069
1069
|
role: "img",
|
|
1070
1070
|
"aria-labelledby": `${titleId} ${descId}`,
|
|
1071
1071
|
"data-sport": sport,
|
|
1072
|
-
"data-league": o.league === undefined || o.league === "" ? undefined : o.league,
|
|
1072
|
+
"data-league": o.league === undefined || o.league === "" ? (chooseLeague(o).league?.id ?? undefined) : o.league,
|
|
1073
1073
|
"data-range": isScore(o) && sport === "curling" ? undefined : rangeLabel(o),
|
|
1074
1074
|
"data-event": o.host !== undefined && typeof o.event === "string" ? safeClass(o.event) : undefined,
|
|
1075
1075
|
"data-look": look ?? budoLook,
|
package/dist/leagues/budo.d.ts
CHANGED
|
@@ -32,6 +32,16 @@ export interface JudoFigures {
|
|
|
32
32
|
danger: boolean;
|
|
33
33
|
/** A kata area: two white tapes 5 cm by 50 cm, 3 m from the centre either side, and a safety area of 2 m (SOR B1.8). */
|
|
34
34
|
kata: boolean;
|
|
35
|
+
/** A kata area: the strip of tape of the same colour at the centre of the area, 5 cm by 50 cm (SOR B1.8; the Kata Commission's Tournament Handbook 2024). None in a contest area. */
|
|
36
|
+
centre: {
|
|
37
|
+
width: number;
|
|
38
|
+
length: number;
|
|
39
|
+
} | null;
|
|
40
|
+
/** A kata area: the panel of judges, `count` of them on the shomen side, sitting about `apart` metres from each other, the central one at the centre of the area (SOR, Kata judges and the system of judging). None in a contest area. */
|
|
41
|
+
panel: {
|
|
42
|
+
count: number;
|
|
43
|
+
apart: number;
|
|
44
|
+
} | null;
|
|
35
45
|
}
|
|
36
46
|
/** The figures of a karate competition area, in metres. */
|
|
37
47
|
export interface KarateFigures {
|
|
@@ -171,7 +181,10 @@ export type BudoLeague = JudoLeague | KarateLeague | KendoLeague | SumoLeague |
|
|
|
171
181
|
export declare const IJF_CONTEST: JudoFigures;
|
|
172
182
|
/** The All Japan Judo Federation's: the tatami of 182 cm by 91 cm, the red tatami of the danger zone, and the red and white tape 4 m (2 ken) apart (Tournament Management Guidebook 2023, 2-1, 2-3, 2-4). */
|
|
173
183
|
export declare const AJJF_CONTEST: JudoFigures;
|
|
174
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* The kata area (SOR 21 January 2026, B1.8; the Kata Commission's Tournament Handbook 2024): 10 m for the World Championships and 8 m for other events, a safety area of at least 2 m between and round the
|
|
186
|
+
* areas, two white tapes of 5 cm by 50 cm 3 m from the centre either side (the 6 m line), a tape of the same colour at the centre, five judges on the shomen side 1.25 m apart with the central judge at the centre.
|
|
187
|
+
*/
|
|
175
188
|
export declare const IJF_KATA: JudoFigures;
|
|
176
189
|
/** The WKF's kumite area (Kumite Competition Rules 2026.01, Article 1). */
|
|
177
190
|
export declare const WKF_KUMITE: KarateFigures;
|
package/dist/leagues/budo.js
CHANGED
|
@@ -13,6 +13,8 @@ export const IJF_CONTEST = {
|
|
|
13
13
|
marks: { width: 0.1, length: 0.5, fromCentre: 2 },
|
|
14
14
|
danger: false,
|
|
15
15
|
kata: false,
|
|
16
|
+
centre: null,
|
|
17
|
+
panel: null,
|
|
16
18
|
};
|
|
17
19
|
/** The All Japan Judo Federation's: the tatami of 182 cm by 91 cm, the red tatami of the danger zone, and the red and white tape 4 m (2 ken) apart (Tournament Management Guidebook 2023, 2-1, 2-3, 2-4). */
|
|
18
20
|
export const AJJF_CONTEST = {
|
|
@@ -22,13 +24,19 @@ export const AJJF_CONTEST = {
|
|
|
22
24
|
tatami: { length: 1.82, width: 0.91, thickness: 0.06 },
|
|
23
25
|
danger: true,
|
|
24
26
|
};
|
|
25
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The kata area (SOR 21 January 2026, B1.8; the Kata Commission's Tournament Handbook 2024): 10 m for the World Championships and 8 m for other events, a safety area of at least 2 m between and round the
|
|
29
|
+
* areas, two white tapes of 5 cm by 50 cm 3 m from the centre either side (the 6 m line), a tape of the same colour at the centre, five judges on the shomen side 1.25 m apart with the central judge at the centre.
|
|
30
|
+
*/
|
|
26
31
|
export const IJF_KATA = {
|
|
27
32
|
...IJF_CONTEST,
|
|
28
33
|
contest: span(8, 10, 10),
|
|
29
34
|
safety: span(2, 6, 2),
|
|
35
|
+
common: 2,
|
|
30
36
|
marks: { width: 0.05, length: 0.5, fromCentre: 3 },
|
|
31
37
|
kata: true,
|
|
38
|
+
centre: { width: 0.05, length: 0.5 },
|
|
39
|
+
panel: { count: 5, apart: 1.25 },
|
|
32
40
|
};
|
|
33
41
|
/** The WKF's kumite area (Kumite Competition Rules 2026.01, Article 1). */
|
|
34
42
|
export const WKF_KUMITE = { kind: "karate", area: 8, band: 1, safety: 2, between: 2, startMats: { size: 1, fromCentre: 1 }, referee: 2, judges: 1.5 };
|
|
@@ -82,7 +90,7 @@ const mat = (length, width, en, ja) => ({ kind: "dojo", mat: { length, width },
|
|
|
82
90
|
export const JUDO_LEAGUES = [
|
|
83
91
|
{ id: "ijf", family: "judo", name: { en: "IJF contest area", ja: "国際柔道連盟の試合場" }, unit: "m", dimensions: IJF_CONTEST, sources: ["ijf-sor", "ijf-sor-2020"], builtIn: true },
|
|
84
92
|
{ id: "ajjf", family: "judo", name: { en: "AJJF contest area", ja: "全日本柔道連盟の試合場" }, unit: "m", dimensions: AJJF_CONTEST, sources: ["ajjf-guide", "ijf-sor"] },
|
|
85
|
-
{ id: "ijf-kata", family: "judo", name: { en: "IJF kata area", ja: "国際柔道連盟の形の試合場" }, unit: "m", dimensions: IJF_KATA, sources: ["ijf-sor"] },
|
|
93
|
+
{ id: "ijf-kata", family: "judo", name: { en: "IJF kata area", ja: "国際柔道連盟の形の試合場" }, unit: "m", dimensions: IJF_KATA, sources: ["ijf-sor", "ijf-kata-handbook", "ijf-kata-criteria"] },
|
|
86
94
|
];
|
|
87
95
|
export const KARATE_LEAGUES = [
|
|
88
96
|
{ id: "wkf-kumite", family: "karate", name: { en: "WKF kumite area", ja: "世界空手連盟の組手の試合場" }, unit: "m", dimensions: WKF_KUMITE, sources: ["wkf-kumite"], builtIn: true },
|
package/dist/leagues/sources.js
CHANGED
|
@@ -105,6 +105,8 @@ export const LEAGUE_SOURCES = Object.freeze(Object.fromEntries([
|
|
|
105
105
|
source({ id: "isu-figure-skating-rules", title: "Sports Rules - Figure Skating (Single and Pair Skating and Ice Dance): Rule 342 Required rinks", by: "International Skating Union", edition: "effective 12 June 2026 (dated 10 June 2026)", url: "https://www.isu.org/en/figure-skating-rules/figure-skating-rules", read: READ, note: "the skating area of 60 m by 30 m if possible, not larger and not less than 56 m by 26 m; the judges and the referee at the rinkboard, the technical panel in an elevated position if possible" }),
|
|
106
106
|
// Budō: judo, karate, kendo, sumo, kyudo and the tatami of a dojo.
|
|
107
107
|
source({ id: "ijf-sor", title: "Sport and Organisation Rules of the International Judo Federation, 8.7 Field of Play and Competition Area, Article 9 and B1.8 (the kata area)", by: "International Judo Federation", edition: "version of 21 January 2026", url: "https://78884ca60822a34fb0e6-082b8fd5551e97bc65e327988b444396.ssl.cf3.rackcdn.com/up/2026/01/IJF_Sport_and_Organisation_Rul-1769443746.pdf", read: BUDO_READ, note: "the contest and safety areas, the common safe zone, the free zone, the tatami of 1 m by 2 m and its two official colours, the platform; the kata area and its marks" }),
|
|
108
|
+
source({ id: "ijf-kata-handbook", title: "IJF Kata Commission Tournament Handbook, Competition Area", by: "International Judo Federation, Kata Commission", edition: "2024", url: "https://78884ca60822a34fb0e6-082b8fd5551e97bc65e327988b444396.ssl.cf3.rackcdn.com/up/2024/01/2024_IJF_kata_commission_Tourn-1706106608.pdf", read: "2026-10-20", note: "the kata area of 10 m by 10 m (World Championships) or 8 m by 8 m, a common safety area of at least 2 m between areas, the centre tape and the two tapes of the same colour for the starting places of tori and uke, the mats on a resilient floor, a platform of at most 1 m, 5 m clear height" }),
|
|
109
|
+
source({ id: "ijf-kata-criteria", title: "Kata Competition, Criteria for the Evaluation, General elements", by: "International Judo Federation, Kata Commission", edition: "January 2025", url: "https://78884ca60822a34fb0e6-082b8fd5551e97bc65e327988b444396.ssl.cf3.rackcdn.com/up/2025/01/IJF_KATA_EVALUATION_Jan_2025-E-1737012784.pdf", read: "2026-10-20", note: "the opening ceremony at the 8 m or 10 m line, the closing ceremony behind the 6 m line (the line of the two tapes), the pair advancing along the safety zone and leaving where they entered" }),
|
|
108
110
|
source({ id: "ijf-sor-2020", title: "Sports and Organization Rules of the International Judo Federation, 18.1 Competition Area", by: "International Judo Federation", edition: "2020 (the version of June 2020)", url: "https://78884ca60822a34fb0e6-082b8fd5551e97bc65e327988b444396.ssl.cf3.rackcdn.com/up/2020/06/IJF_Sport_and_Organisation_Rul-1592329624.pdf", read: BUDO_READ, note: "the blue and the white tape, 10 cm by 50 cm, 4 m apart at the centre of the contest area, the blue to the referee's right (the 2026 version no longer marks them)" }),
|
|
109
111
|
source({ id: "ajjf-guide", title: "大会運営ガイドブック2023 (Tournament Management Guidebook 2023), 2-1 畳, 2-3 試合場 and 2-4 開始線と選手の位置", by: "公益財団法人全日本柔道連盟 (All Japan Judo Federation)", edition: "2023, as of 2023-12-15", url: "https://www.judo.or.jp/cms/wp-content/uploads/2021/03/%E5%A4%A7%E4%BC%9A%E9%81%8B%E5%96%B6%E3%82%AC%E3%82%A4%E3%83%89%E3%83%96%E3%83%83%E3%82%AF2023_20240229.pdf", read: BUDO_READ, note: "the domestic tatami of 182 cm by 91 cm (and the international 200 by 100 cm, and their halves), 5 or 6 cm thick; the red tatami of the danger zone; the red and white tape 4 m (2 ken) apart" }),
|
|
110
112
|
source({ id: "wkf-kumite", title: "WKF Kumite Competition Rules, Article 1: Kumite Competition Area, and 8.6 (the scale of points)", by: "World Karate Federation", edition: "Rules version 2026.01", url: "https://www.wkf.net/files/pdf/documents/WKF_2026_Kumite_Competition_Rules_MASTER_COPY_V13FINAL.pdf", read: BUDO_READ, note: "the matted square of 8 m measured from the outside, its outer 1 m in another colour, the 2 m safety area, 2 m between areas, the two inverted mats 1 m from the centre, the referee and the judges; yuko 1, waza-ari 2, ippon 3" }),
|
package/dist/leagues.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare function leagueById(sport: Sport, id: string): League | undefined
|
|
|
69
69
|
* // FIBA basketball court cfl
|
|
70
70
|
* ```
|
|
71
71
|
*/
|
|
72
|
-
export declare function chooseLeague(o: Pick<SurfaceOptions, "sport" | "league">): {
|
|
72
|
+
export declare function chooseLeague(o: Pick<SurfaceOptions, "sport" | "league"> & Partial<Pick<SurfaceOptions, "budo">>): {
|
|
73
73
|
sport: Sport;
|
|
74
74
|
league: League | undefined;
|
|
75
75
|
};
|
package/dist/leagues.js
CHANGED
|
@@ -98,9 +98,11 @@ const figuresUnit = (league) => league.figuresUnit ?? league.unit;
|
|
|
98
98
|
* ```
|
|
99
99
|
*/
|
|
100
100
|
export function chooseLeague(o) {
|
|
101
|
-
|
|
101
|
+
// A judo area asked for in the kata style is the IJF's kata area when no league is named (`budo.style`).
|
|
102
|
+
const asked = (o.league === undefined || o.league === "") && o.sport === "judo" && o.budo?.style === "kata" ? "ijf-kata" : o.league;
|
|
103
|
+
if (asked === undefined || asked === "")
|
|
102
104
|
return { sport: o.sport, league: undefined };
|
|
103
|
-
const id = String(
|
|
105
|
+
const id = String(asked);
|
|
104
106
|
const family = FAMILY_OF[o.sport];
|
|
105
107
|
if (family === undefined)
|
|
106
108
|
throw new Error(`"${String(o.sport)}" has no leagues: a soccer pitch is chosen with pitch`);
|
package/dist/multi-entry.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { drawMulti, multiSetting, multiTable } from "./multi.draw.ts";
|
|
2
|
+
export { SURROUND_HEIGHT, buildMultiTurn, mountMultiTurn, multiPresets, multiTurnMarkup } from "./multi.turn.ts";
|
|
2
3
|
export { MULTI_MAX, fitSentence, multiFit, multiLayout, needsSentence, specOf, venueOf } from "./multi.ts";
|
|
3
4
|
export { MULTI_PRESETS, MULTI_PRESET_IDS, MULTI_SOURCES, MULTI_VENUES, multiPreset, multiSource, multiVenueById } from "./multi.data.ts";
|
|
4
5
|
export { KYOGIJO_MULTI_STYLE } from "./multi.style.ts";
|
package/dist/multi-entry.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// officials' chairs, a scoreboard hung over the middle, the boards and the empty places for the event's own words and marks; the real configurations of events as presets, each with its rule; the halls whose
|
|
3
3
|
// floors are published, and whether a layout fits one; and a real stadium round the floor at the same scale. `multiTable` is the text alternative.
|
|
4
4
|
export { drawMulti, multiSetting, multiTable } from "./multi.draw.js";
|
|
5
|
+
export { SURROUND_HEIGHT, buildMultiTurn, mountMultiTurn, multiPresets, multiTurnMarkup } from "./multi.turn.js";
|
|
5
6
|
export { MULTI_MAX, fitSentence, multiFit, multiLayout, needsSentence, specOf, venueOf } from "./multi.js";
|
|
6
7
|
export { MULTI_PRESETS, MULTI_PRESET_IDS, MULTI_SOURCES, MULTI_VENUES, multiPreset, multiSource, multiVenueById } from "./multi.data.js";
|
|
7
8
|
export { KYOGIJO_MULTI_STYLE } from "./multi.style.js";
|
package/dist/multi.draw.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Crowd, type CrowdStands } from "./crowd.ts";
|
|
2
|
+
import type { MultiCell, MultiFit, MultiLayout, MultiOptions, MultiVenue } from "./multi.types.ts";
|
|
2
3
|
/**
|
|
3
4
|
* A tournament layout as one SVG string: several of the package's surfaces laid out together for one large event, to scale, on one floor. `preset` is one of `MULTI_PRESETS` (`tabletennis-4`, `pickleball-2x4`,
|
|
4
5
|
* `curling-1x4`, `judo-1x3`, `karate-2x3`, `badminton-1x4`, ...), or `layout` is your own; `rows`, `columns` and `stagger` change the grid. The empty places for the event's words and marks are drawn dashed and hold nothing.
|
|
@@ -13,6 +14,61 @@ import type { MultiFit, MultiLayout, MultiOptions, MultiVenue } from "./multi.ty
|
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
export declare function drawMulti(options?: MultiOptions): string;
|
|
17
|
+
/** Where the layout stands in the picture, so that something else can be put in the same frame (the 3D view's planes): the hall's size, where the layout is set in it, and the map from the layout's own frame to the picture's. */
|
|
18
|
+
export interface MultiFrame {
|
|
19
|
+
layout: MultiLayout;
|
|
20
|
+
/** The hall's size and the layout's size as set in it (turned a quarter when the hall asks), in feet; the layout's top left corner is at (`ox`, `oy`). */
|
|
21
|
+
hall: {
|
|
22
|
+
w: number;
|
|
23
|
+
h: number;
|
|
24
|
+
};
|
|
25
|
+
lw: number;
|
|
26
|
+
lh: number;
|
|
27
|
+
ox: number;
|
|
28
|
+
oy: number;
|
|
29
|
+
turned: boolean;
|
|
30
|
+
/** A point of the layout's own frame (feet from the top left of its floor) in the picture's frame. */
|
|
31
|
+
to(x: number, y: number): [number, number];
|
|
32
|
+
}
|
|
33
|
+
/** A layout's drawing, and what was worked out to make it. */
|
|
34
|
+
export interface MultiDrawing {
|
|
35
|
+
svg: string;
|
|
36
|
+
frame: MultiFrame;
|
|
37
|
+
fit: MultiFit | undefined;
|
|
38
|
+
/** The stands of the stadium round the hall, when it is on (in the picture's frame), and the crowd they are of. */
|
|
39
|
+
stands?: {
|
|
40
|
+
stands: CrowdStands;
|
|
41
|
+
crowd: Crowd;
|
|
42
|
+
standsLike: string;
|
|
43
|
+
};
|
|
44
|
+
/** For a drawing made to be raised (`raise`): the surfaces that stand over the floor (a table tennis table), each with its cell and its own drawing, which the floor does not carry. */
|
|
45
|
+
lifted: {
|
|
46
|
+
cell: MultiCell;
|
|
47
|
+
body: string;
|
|
48
|
+
box: {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
51
|
+
w: number;
|
|
52
|
+
h: number;
|
|
53
|
+
};
|
|
54
|
+
lift: number;
|
|
55
|
+
}[];
|
|
56
|
+
/** The width and height of the picture and where it starts, in feet (its viewBox). */
|
|
57
|
+
view: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
w: number;
|
|
61
|
+
h: number;
|
|
62
|
+
};
|
|
63
|
+
title: string;
|
|
64
|
+
description: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The drawing of a layout, with what it was worked out from. `raise` makes the floor of a 3D view instead of the flat picture: the barriers, the officials' chairs, the scoreboard and the stands are left out (the 3D
|
|
68
|
+
* view stands them up), and a surface that stands over the floor (a table tennis table) is left off it too, with a soft shadow in its place. Everything else is the same string. With `uprights` false the 3D view stands
|
|
69
|
+
* nothing but the stands up, so the barriers and the rest stay on the floor.
|
|
70
|
+
*/
|
|
71
|
+
export declare function multiDrawing(options: MultiOptions, raise: boolean, uprights?: boolean): MultiDrawing;
|
|
16
72
|
/**
|
|
17
73
|
* The same thing as the picture, as a table: each playing surface with its row, column, place and size in metres, and each empty place for the event's words and marks, under a caption that gives
|
|
18
74
|
* what the layout needs. For a reader who cannot see the drawing, and for a page that wants the figures.
|