@johnmorrisdotca/kyogijo-stadiums 0.14.0 → 0.16.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 +24 -0
- package/README.md +39 -19
- package/dist/court.d.ts +10 -0
- package/dist/court.js +34 -4
- package/dist/courts.style.d.ts +2 -0
- package/dist/courts.style.js +6 -3
- package/dist/features.js +3 -1
- package/dist/leagues/courts.d.ts +36 -2
- package/dist/leagues/courts.js +12 -5
- package/dist/leagues/sources.js +1 -0
- package/dist/multi.data.js +29 -24
- package/dist/surfaces/net.js +4 -0
- package/dist/types.d.ts +10 -1
- package/dist/uprights.net.js +18 -11
- package/dist/uprights.netkit.d.ts +9 -0
- package/dist/uprights.netkit.js +32 -1
- 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,30 @@ All notable changes to this project are written here. The format follows
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.16.0] - 2026-10-20
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **A badminton court has the space round it drawn.** The BWF's Specifications for International Standard Facilities (Statutes 5.3.4, 2.1.3 and 2.2.3) ask for at least 2 m clear behind the baselines and 1.5 m clear from the side lines, so the court's free zone is that (17.4 m by 9.1 m round the 13.4 m by 6.1 m court), where it was none: the Laws of Badminton give no figure, which is why none was drawn. It is one figure for every tournament, so `net.free: "official"` and `"least"` agree, and `"none"` draws the court alone, as before. The 4 m between courts the BWF recommends at Grade 1 and 2 is the layouts' (`badminton-1x4`); the 1.5 m least between courts is `badminton-1x4-min`. The layouts draw the court alone in their bays (`net: { free: "none" }`), as before, since the bays are that space.
|
|
15
|
+
|
|
16
|
+
### Checked
|
|
17
|
+
|
|
18
|
+
- **The run-off of the other net sports is what their rulebooks give, and the tournament layouts are built from it.** Tennis (ITF Appendix X: 21 ft behind the baselines and 12 ft beside the side lines, so two courts side by side are 2 x 12 ft = 7.32 m apart, as `tennis-1x3` has them), pickleball (USA Pickleball 3.A.3: a playing surface of 34 by 64 ft recommended, 30 by 60 ft at least, edge to edge) and volleyball (FIVB Rule 1.1: 3 m all round at least, 5 m beside the side lines and 6.5 m behind the end lines in the FIVB's competitions; beach 3 m and 5 m; World ParaVolley's sitting court 3 m, and 4 m and 6 m) were compared figure by figure with their free zones and the `tennis-1x3` and `pickleball-*` bays; nothing needed changing. Volleyball has no layout preset: no source gives an event's arrangement.
|
|
19
|
+
|
|
20
|
+
## [0.15.0] - 2026-10-20
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **A table tennis table in its playing area.** The default drawing of `sport: "tabletennis"` is no longer a table on a generic floor: it is the table in the ITTF's playing area, from the Regulations for International Competitions (3.2.3, chapter 3 of the ITTF Statutes 2026, read on 2026-10-20): a space of 14 m by 7 m (5 m high), **enclosed by four dark surrounds** (50 cm to 100 cm high, all one dark colour, 3.2.3.3), **with the umpire's chair in line with the net, the assistant umpire's chair facing it across the table and the umpires' table beside the first** (3.2.3.2, 3.3.2.2), on a floor that is not light (3.2.3.8; both looks are dark blues and greens). New `net.area` picks the kind of event, `standard` (14 m by 7 m), `masters` (10 m by 5 m) or `wheelchair` (8 m by 6 m) (3.2.3.1), and `net.surrounds` and `net.umpires` leave the surrounds or the umpires out; `net.free: "none"` draws the table alone, as before, and `free: "least"` is the Masters area. In 3D (all viewpoints) the area has its own floor, the surrounds stand 75 cm round it (they give way to an eye low on their side, as every wall does) and the chairs and the table are solid blocks. New in `TableTennisFigures`: `space`, `surround`, `umpires`; the features `walls`, `umpires-table` and `chairs` can be restyled. Sizes the rules do not give (a chair 0.5 m, the umpires' table 1.2 m by 0.5 m, 0.9 m from the table, a surround 5 cm thick, 75 cm high) are ours and said so. Docs: [the table tennis playing area](./docs/courts.md#the-table-tennis-playing-area), with pictures.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- **The tournament layouts' table tennis areas are that same space.** The bay of each table in `tabletennis-4` and `tabletennis-8` is `ITTF_TABLE.space.standard` (14 m by 7 m, the table in its middle), and the layouts draw the table alone in it (`net: { free: "none" }`: the layout draws the surrounds and the chairs of its bays), so the layouts are byte for byte what they were. A test holds the bay to the space.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **The surrounds of a table tennis area are 50 cm to 100 cm high, not "about 75 cm", and the corners need no 1.5 m limit.** The layouts' rule text and the sources page quoted the Handbook of 2022; the current text (2025 and 2026) says "a minimum of 50cm and a maximum of 100 cm in height, all of the same dark background colour, but corners may be left open". The 75 cm drawn stays, as a choice of ours inside the rule. The 2026 Statutes are now the preset's source (`ittf-statutes-2026`); the 2022 Handbook's entry says it was superseded.
|
|
33
|
+
|
|
10
34
|
## [0.14.0] - 2026-10-20
|
|
11
35
|
|
|
12
36
|
### Added
|
package/README.md
CHANGED
|
@@ -75,35 +75,35 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
75
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
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,
|
|
78
|
+
- **The stands and the crowd.** `crowd: true` draws the seating round any surface that has spectators: a bowl, two sides, a horseshoe, courtside rows or a ballpark's grandstands, 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 crowd](./docs/crowd.md).
|
|
79
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
|
|
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.
|
|
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
|
|
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. [Net, racket and court sports](./docs/courts.md).
|
|
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. A race's lanes carry names, flags, places, times and splits, with a replay (`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, World Rugby, the NRL, the AFL, 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
|
-
- **The skating rinks, from the ISU's rules.** The
|
|
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,
|
|
84
|
+
- **The skating rinks, from the ISU's rules.** The 400 m speed skating track with its lanes, blocks and the starting and finishing lines of every race worked out lane by lane; the short track's oval of 111.12 m; 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
|
+
- **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, and the scores are judo's ippon, waza-ari and shido, karate's and 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" })`),
|
|
89
|
-
- **Walls and quirks.** How high the fence stands, stretch by stretch and season by season (the Green Monster at 37 feet 2 inches
|
|
90
|
-
- **Special games.** A surface set inside another, to scale: an NHL rink on a ballpark's infield or a football stadium's field
|
|
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" })`), 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
|
+
- **Walls and quirks.** How high the fence stands, stretch by stretch and season by season (the Green Monster at 37 feet 2 inches), 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, poles, bullpens and dugouts (`quirks`), each from the park's article, none guessed: [ballparks](./docs/ballparks.md).
|
|
90
|
+
- **Special games.** A surface set inside another, to scale: an NHL rink on a ballpark's infield or a football stadium's field, 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. [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).
|
|
92
|
-
- **Score mode.** Each team's name and logo on its side (the end zones
|
|
93
|
-
- **The situation of a game.** `situation` draws what is happening: hockey's power play or empty net
|
|
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.
|
|
95
|
-
- **A pageant.** Each team's flag or crest laid large over its half of the surface
|
|
92
|
+
- **Score mode.** Each team's name and logo on its side (the end zones, the ends of the ice, the halves of the court, the dugouts) and the score large in the middle, with the competition, the status and the date, and the winner emphasised; a flag or a crest can be round, in a circle with a ring (`markShape: "round"`). [Score and layout](./docs/score.md#round-marks).
|
|
93
|
+
- **The situation of a game.** `situation` draws what is happening: hockey's power play or empty net and a shootout; baseball's runners lit on the diamond with a scorebug; 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. [The situation](./docs/situation.md).
|
|
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. [Lineups](./docs/team-shape.md#lineups).
|
|
95
|
+
- **A pageant.** Each team's flag or crest laid large over its half of the surface: `pageant: "carpet"` (a flag at its own ratio with a border) or `"stage"` (a crest on a round disc with a gold ring), an emblem or a trophy in the centre circle, the score in the middle or in the strip, with an entrance in CSS for readers who have not asked for less motion. [The pageant](./docs/pageant.md).
|
|
96
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
|
-
- **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
|
|
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 carpet. The same adapter serves [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets). Kyogijo bundles no flag and keeps zero dependencies. [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 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
|
|
101
|
-
- **Goals, the strike zone and the stumps, end-on.** A goal mouth for hockey
|
|
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
|
|
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. [Zones](./docs/zones.md), [pointing](./docs/pointer.md).
|
|
101
|
+
- **Goals, the strike zone and the stumps, end-on.** A goal mouth for hockey, soccer, handball, water polo, lacrosse 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 pitches numbered, and the wicket from the bowler's end with its line and length zones. [Targets](./docs/targets.md).
|
|
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. [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
|
|
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, baskets, rink boards and glass, goals, a ballpark's fence, the walls of padel and squash, a pool's blocks, a table tennis area's surrounds); 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
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.
|
|
@@ -533,9 +533,29 @@ console.log(layout.needs.length, layout.needs.width);
|
|
|
533
533
|
|
|
534
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
535
|
|
|
536
|
+
### A table tennis area
|
|
537
|
+
|
|
538
|
+
A table is drawn in the ITTF's playing area, 14 m by 7 m (`net.area` for Masters and wheelchair events), with dark surrounds and the umpires' chairs ([courts](./docs/courts.md#the-table-tennis-playing-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/tabletennis-area-desk-dark.webp">
|
|
543
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/tabletennis-area-desk-light.webp" alt="A table tennis table in its 14 m by 7 m playing area, with dark surrounds, chairs and table for the umpires" width="660">
|
|
544
|
+
</picture>
|
|
545
|
+
<br><em>The table in its playing area.</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/tabletennis-area-3d-desk-dark.webp">
|
|
551
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/tabletennis-area-3d-desk-light.webp" alt="The same area in 3D: the surrounds round the floor, the table on its legs" width="660">
|
|
552
|
+
</picture>
|
|
553
|
+
<br><em>The same area in 3D.</em>
|
|
554
|
+
</p>
|
|
555
|
+
|
|
536
556
|
### A judo kata area
|
|
537
557
|
|
|
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
|
|
558
|
+
`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 and the coach's chair ([the budō page](./docs/budo.md#the-kata-area)).
|
|
539
559
|
|
|
540
560
|
<p align="center">
|
|
541
561
|
<picture>
|
package/dist/court.d.ts
CHANGED
|
@@ -46,6 +46,12 @@ export type Solid = {
|
|
|
46
46
|
cx: number;
|
|
47
47
|
cy: number;
|
|
48
48
|
r: number;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "chair";
|
|
51
|
+
rect: Rect;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "desk";
|
|
54
|
+
rect: Rect;
|
|
49
55
|
};
|
|
50
56
|
/** The looks each sport has, the sport's default first. */
|
|
51
57
|
export declare const LOOKS: Readonly<Record<NetSport, readonly string[]>>;
|
|
@@ -64,6 +70,10 @@ interface Common {
|
|
|
64
70
|
zone: FreeZone;
|
|
65
71
|
/** How the free zone was asked for. */
|
|
66
72
|
free: "official" | "least" | "none";
|
|
73
|
+
/** Table tennis: the kind of event the playing area is for, and whether its surrounds and its umpires' places are drawn. */
|
|
74
|
+
area: "standard" | "masters" | "wheelchair";
|
|
75
|
+
surrounds: boolean;
|
|
76
|
+
umpires: boolean;
|
|
67
77
|
/** Tennis: the singles sticks are drawn. */
|
|
68
78
|
sticks: boolean;
|
|
69
79
|
}
|
package/dist/court.js
CHANGED
|
@@ -44,6 +44,7 @@ export const isNetLeague = (league) => isNetSport(league.family);
|
|
|
44
44
|
/** True for a sport whose score is a board of sets or games (all of these courts but netball's). */
|
|
45
45
|
export const hasSetsBoard = (sport) => isNetSport(sport) && BOARD[sport] !== "total";
|
|
46
46
|
const FREE = ["official", "least", "none"];
|
|
47
|
+
const AREAS = ["standard", "masters", "wheelchair"];
|
|
47
48
|
/**
|
|
48
49
|
* The court the options ask for. A `league` picks the rulebook (the sport's own by default; `fivb-beach` for beach volleyball); `net.look` a named look, `net.free`
|
|
49
50
|
* the free zone, `net.sticks` the tennis singles sticks.
|
|
@@ -64,7 +65,12 @@ export function courtFor(o) {
|
|
|
64
65
|
const look = asked.look === undefined ? (beach ? "sand" : names[0]) : asked.look;
|
|
65
66
|
if (!names.includes(look))
|
|
66
67
|
throw new Error(`Unknown look "${String(look)}" for ${sport}: use one of ${names.join(", ")}`);
|
|
67
|
-
const
|
|
68
|
+
const area = asked.area === undefined ? (free === "least" ? "masters" : "standard") : AREAS.includes(asked.area) ? asked.area : undefined;
|
|
69
|
+
if (area === undefined)
|
|
70
|
+
throw new Error(`Unknown area "${String(asked.area)}": use one of ${AREAS.join(", ")}`);
|
|
71
|
+
if (asked.area !== undefined && sport !== "tabletennis")
|
|
72
|
+
throw new Error(`net.area is for table tennis, not "${sport}"`);
|
|
73
|
+
const common = { look, free, sticks: sport === "tennis" && asked.sticks === true, area, surrounds: asked.surrounds !== false, umpires: asked.umpires !== false };
|
|
68
74
|
const zoneOf = (zones) => (free === "none" ? null : zones[free]);
|
|
69
75
|
switch (sport) {
|
|
70
76
|
case "tennis": {
|
|
@@ -90,7 +96,10 @@ export function courtFor(o) {
|
|
|
90
96
|
case "tabletennis": {
|
|
91
97
|
const league = picked?.family === "tabletennis" ? picked : TABLE_TENNIS_LEAGUES[0];
|
|
92
98
|
const figures = netOf(league);
|
|
93
|
-
|
|
99
|
+
// The playing area is the space of the event's kind, the table centred in it; `free` says whether one is drawn at all.
|
|
100
|
+
const space = figures.space[area];
|
|
101
|
+
const zone = free === "none" ? null : { side: (space.width - figures.width) / 2, end: (space.length - figures.length) / 2 };
|
|
102
|
+
return { ...common, sport, league, figures, zone };
|
|
94
103
|
}
|
|
95
104
|
case "padel": {
|
|
96
105
|
const league = picked?.family === "padel" ? picked : PADEL_LEAGUES[0];
|
|
@@ -151,7 +160,7 @@ export function courtGeometry(plan) {
|
|
|
151
160
|
case "pickleball":
|
|
152
161
|
return pickleballGeometry(plan.figures);
|
|
153
162
|
case "tabletennis":
|
|
154
|
-
return tableGeometry(plan.figures);
|
|
163
|
+
return tableGeometry(plan.figures, plan);
|
|
155
164
|
case "padel":
|
|
156
165
|
return padelGeometry(plan.figures);
|
|
157
166
|
case "squash":
|
|
@@ -304,11 +313,30 @@ function pickleballGeometry(f) {
|
|
|
304
313
|
...none(),
|
|
305
314
|
};
|
|
306
315
|
}
|
|
307
|
-
function tableGeometry(f) {
|
|
316
|
+
function tableGeometry(f, plan) {
|
|
308
317
|
const { length: L, width: W, edgeLine: e, centreLine: c } = f;
|
|
309
318
|
const cx = L / 2;
|
|
310
319
|
const out = f.net.postOutside;
|
|
311
320
|
const post = Math.max(feet(0.03), L * 0.01);
|
|
321
|
+
const bands = [];
|
|
322
|
+
const solids = [];
|
|
323
|
+
const zone = plan.zone;
|
|
324
|
+
if (zone !== null) {
|
|
325
|
+
// The playing area is enclosed by surrounds, which are part of it (3.2.3.2 and 3.2.3.3): four boards along the edge of the space, inside it.
|
|
326
|
+
if (plan.surrounds) {
|
|
327
|
+
const t = f.surround.thickness;
|
|
328
|
+
const [x0, y0, x1, y1] = [-zone.end, -zone.side, L + zone.end, W + zone.side];
|
|
329
|
+
bands.push({ kind: "wall", rect: [x0, y0, x1, y0 + t] }, { kind: "wall", rect: [x0, y1 - t, x1, y1] }, { kind: "wall", rect: [x0, y0 + t, x0 + t, y1 - t] }, { kind: "wall", rect: [x1 - t, y0 + t, x1, y1 - t] });
|
|
330
|
+
}
|
|
331
|
+
// The umpire sits or stands in line with the net and the assistant umpire directly facing him or her at the other side of the table (3.3.2.2); the umpires' table is beside the umpire's chair.
|
|
332
|
+
if (plan.umpires) {
|
|
333
|
+
const half = f.umpires.chair / 2;
|
|
334
|
+
const { length: dl, width: dw } = f.umpires.desk;
|
|
335
|
+
solids.push({ kind: "chair", rect: [cx - half, -f.umpires.away - half, cx + half, -f.umpires.away + half] });
|
|
336
|
+
solids.push({ kind: "chair", rect: [cx - half, W + f.umpires.away - half, cx + half, W + f.umpires.away + half] });
|
|
337
|
+
solids.push({ kind: "desk", rect: [cx + half + dl * 0.1, -f.umpires.away - dw / 2, cx + half + dl * 1.1, -f.umpires.away + dw / 2] });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
312
340
|
return {
|
|
313
341
|
length: L,
|
|
314
342
|
width: W,
|
|
@@ -321,6 +349,8 @@ function tableGeometry(f) {
|
|
|
321
349
|
antennae: [],
|
|
322
350
|
sticks: [],
|
|
323
351
|
...none(),
|
|
352
|
+
bands,
|
|
353
|
+
solids,
|
|
324
354
|
};
|
|
325
355
|
}
|
|
326
356
|
/** How far the court's fixtures reach beyond its side lines: the net's posts and the antennae's marks. */
|
package/dist/courts.style.d.ts
CHANGED
package/dist/courts.style.js
CHANGED
|
@@ -2,6 +2,7 @@ const WALL = { light: { wall: "#4f575f", mesh: "#98a1a9" }, dark: { wall: "#8b94
|
|
|
2
2
|
// World Squash's specification asks that court markings contrast with the surfaces beside them (5.01.01) and lets them be any colour that does (10.13), the walls' lines
|
|
3
3
|
// differing from the floor's if need be. Red is the colour squash lines are painted in: ours, a red dark enough on the light floor and pale enough on the dark one to read at 3:1.
|
|
4
4
|
const FACE = { light: { face: "#efeadf", tin: "#c3c8cd", wallLine: "#a8201a" }, dark: { face: "#454b52", tin: "#34393f", wallLine: "#ffb3a8" } };
|
|
5
|
+
const TT = { light: { wall: "#161a1f", table: "#d8d4c8", chair: "#ece7da" }, dark: { wall: "#05070a", table: "#8f8b80", chair: "#b9b4a6" } };
|
|
5
6
|
const NET = { light: "#20262b", dark: "#e6e9ec" };
|
|
6
7
|
/** The looks of every sport, each in light and dark. */
|
|
7
8
|
export const COURT_LOOKS = {
|
|
@@ -26,9 +27,10 @@ export const COURT_LOOKS = {
|
|
|
26
27
|
green: { light: { surface: "#4f9a5c", free: "#3a7a47", apron: "#cdd6c8", area: "#82c28d" }, dark: { surface: "#386f43", free: "#2b5835", apron: "#1a1c1b", area: "#4e8c59" } },
|
|
27
28
|
red: { light: { surface: "#b5503a", free: "#8f3b2b", apron: "#d6cdc4", area: "#d27a62" }, dark: { surface: "#8a3d2c", free: "#6c2e21", apron: "#1a1c1b", area: "#a8523d" } },
|
|
28
29
|
},
|
|
30
|
+
// The surrounds are of one dark colour (the ITTF's 3.2.3.3), and the floor is not light (3.2.3.8): both looks are dark blues and greens. The surrounds, the umpires' table and the chairs are ours.
|
|
29
31
|
tabletennis: {
|
|
30
|
-
blue: { light: { surface: "#1f4f8f", free: "#1f4f8f", apron: "#cfd6df" }, dark: { surface: "#1a4079", free: "#1a4079", apron: "#1a1d21" } },
|
|
31
|
-
green: { light: { surface: "#2f6f4f", free: "#2f6f4f", apron: "#cdd6c8" }, dark: { surface: "#25583f", free: "#25583f", apron: "#1a1d1b" } },
|
|
32
|
+
blue: { light: { surface: "#1f4f8f", free: "#1f4f8f", apron: "#cfd6df", ...TT.light }, dark: { surface: "#1a4079", free: "#1a4079", apron: "#1a1d21", ...TT.dark } },
|
|
33
|
+
green: { light: { surface: "#2f6f4f", free: "#2f6f4f", apron: "#cdd6c8", ...TT.light }, dark: { surface: "#25583f", free: "#25583f", apron: "#1a1d1b", ...TT.dark } },
|
|
32
34
|
},
|
|
33
35
|
padel: {
|
|
34
36
|
blue: { light: { surface: "#2f6fb5", free: "#2f6fb5", apron: "#d3d9d0", ...WALL.light }, dark: { surface: "#2a5a93", free: "#2a5a93", apron: "#1a1c1b", ...WALL.dark } },
|
|
@@ -64,7 +66,7 @@ export const COURT_LOOKS = {
|
|
|
64
66
|
green: { light: { surface: "#4d9468", free: "#3c7852", apron: "#dcd8c9" }, dark: { surface: "#35704b", free: "#285539", apron: "#1b1f1c" } },
|
|
65
67
|
},
|
|
66
68
|
};
|
|
67
|
-
const OPTIONAL = [["area", "--ky-area"], ["line", "--ky-line"], ["wallLine", "--ky-wall-line"], ["wall", "--ky-wall"], ["mesh", "--ky-mesh"], ["face", "--ky-face"], ["tin", "--ky-tin"], ["table", "--ky-table"], ["setnet", "--ky-setnet"]];
|
|
69
|
+
const OPTIONAL = [["area", "--ky-area"], ["line", "--ky-line"], ["wallLine", "--ky-wall-line"], ["wall", "--ky-wall"], ["mesh", "--ky-mesh"], ["face", "--ky-face"], ["tin", "--ky-tin"], ["table", "--ky-table"], ["setnet", "--ky-setnet"], ["chair", "--ky-chair"]];
|
|
68
70
|
const vars = (look, net) => `--ky-surface:${look.surface};--ky-free:${look.free};--ky-apron:${look.apron};--ky-net:${net}${OPTIONAL.map(([key, name]) => (look[key] === undefined ? "" : `;${name}:${look[key]}`)).join("")}`;
|
|
69
71
|
/** The three rules of one look: light, dark by the device's setting, and dark by the page's `data-theme`. */
|
|
70
72
|
function lookRules(sport, name) {
|
|
@@ -92,6 +94,7 @@ const FIXTURES = `
|
|
|
92
94
|
.kyogijo .ky-tin{fill:var(--ky-tin)}
|
|
93
95
|
.kyogijo .ky-wall-line{fill:var(--ky-wall-line,var(--ky-line))}
|
|
94
96
|
.kyogijo .ky-table{fill:var(--ky-table)}
|
|
97
|
+
.kyogijo .ky-chair{fill:var(--ky-chair)}
|
|
95
98
|
.kyogijo .ky-set-net{fill:var(--ky-setnet)}`.trim();
|
|
96
99
|
/** The rules of a drawing of this sport in this look: the shared rules, the rules of the fixtures its sport has, and the look's colours. */
|
|
97
100
|
export function courtStyle(sport, look) {
|
package/dist/features.js
CHANGED
|
@@ -292,6 +292,8 @@ const NET = [
|
|
|
292
292
|
const APRON_COURT = [f("apron", "--ky-apron", "The ground round the court."), f("court", "--ky-surface", "The court."), f("lines", LINE, "The painted lines.")];
|
|
293
293
|
/** A padel court: the net's features, and the walls and the metal fence of its enclosure. */
|
|
294
294
|
const PADEL = [...NET, f("walls", "--ky-wall", "The walls of the enclosure."), f("fence", "--ky-mesh", "The metal fence between the walls.")];
|
|
295
|
+
/** A table tennis area: the net's features, the surrounds round the playing area, the umpires' table and their chairs. */
|
|
296
|
+
const TABLE_TENNIS = [...NET, f("walls", "--ky-wall", "The surrounds that enclose the playing area."), f("umpires-table", "--ky-table", "The umpires' table."), f("chairs", "--ky-chair", "The umpire's chair and the assistant umpire's.")];
|
|
295
297
|
/** A squash court: no net, walls round it, and its front wall laid flat beside it, with its tin. */
|
|
296
298
|
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.")];
|
|
297
299
|
/** A racquetball court: no net, and walls round it. */
|
|
@@ -410,7 +412,7 @@ export const FEATURE_INFO = Object.freeze({
|
|
|
410
412
|
volleyball: NET,
|
|
411
413
|
badminton: NET,
|
|
412
414
|
pickleball: NET,
|
|
413
|
-
tabletennis:
|
|
415
|
+
tabletennis: TABLE_TENNIS,
|
|
414
416
|
padel: PADEL,
|
|
415
417
|
squash: SQUASH,
|
|
416
418
|
racquetball: RACQUETBALL,
|
package/dist/leagues/courts.d.ts
CHANGED
|
@@ -143,8 +143,40 @@ export interface TableTennisFigures {
|
|
|
143
143
|
/** The outside limits of a post are this far outside the side line. */
|
|
144
144
|
postOutside: number;
|
|
145
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* The playing space of each kind of event (the ITTF's Regulations for International Competitions, 3.2.3.1): a cuboid of at least 14 m by 7 m by 5 m; for wheelchair events it may be reduced to
|
|
148
|
+
* 8 m by 6 m, and for Masters events to 10 m by 5 m. The height is the cuboid's, which no reduction touches.
|
|
149
|
+
*/
|
|
150
|
+
space: {
|
|
151
|
+
standard: PlayingSpace;
|
|
152
|
+
masters: PlayingSpace;
|
|
153
|
+
wheelchair: PlayingSpace;
|
|
154
|
+
};
|
|
155
|
+
/** The surrounds that enclose the playing area: 50 cm to 100 cm high, all of one dark colour, the corners may be left open (3.2.3.3); `drawn` is the height drawn and `thickness` the board's, both ours within the rule. */
|
|
156
|
+
surround: {
|
|
157
|
+
least: number;
|
|
158
|
+
greatest: number;
|
|
159
|
+
drawn: number;
|
|
160
|
+
thickness: number;
|
|
161
|
+
};
|
|
162
|
+
/** The umpires' chairs and table, part of the playing area (3.2.3.2). The umpire sits or stands in line with the net, the assistant umpire directly facing him or her at the other side of the table (3.3.2.2); the sizes and the distance from the table are ours. */
|
|
163
|
+
umpires: {
|
|
164
|
+
chair: number;
|
|
165
|
+
desk: {
|
|
166
|
+
length: number;
|
|
167
|
+
width: number;
|
|
168
|
+
};
|
|
169
|
+
away: number;
|
|
170
|
+
};
|
|
171
|
+
/** The playing area is `standard` for the international events, `masters` the least a Masters event allows (the least for any event but a wheelchair one). The `official` zone is the standard space and the `least` the Masters one. */
|
|
146
172
|
free: FreeZones;
|
|
147
173
|
}
|
|
174
|
+
/** A playing space: the cuboid's length, width and height. */
|
|
175
|
+
export interface PlayingSpace {
|
|
176
|
+
length: number;
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
}
|
|
148
180
|
/**
|
|
149
181
|
* A padel court, from "The court" in the FIP's Rules of Padel (review of application 1 January 2026). Metres. The court is measured inside its walls, so it has
|
|
150
182
|
* no lines round it: the enclosure is its boundary.
|
|
@@ -374,7 +406,8 @@ export declare const FIVB_BEACH: VolleyballFigures;
|
|
|
374
406
|
* The BWF's court, from Law 1 of the Laws of Badminton (as amended 26 April 2025) and its Diagram A, in metres: 13.40 by 6.10 m, lines 40 mm wide; the singles
|
|
375
407
|
* side lines 460 mm inside the doubles side lines (so 5.18 m apart, outside to outside); the short service lines 1.98 m from the net; the doubles long service
|
|
376
408
|
* lines 760 mm inside the back boundary lines; the net 1.524 m high at the centre and 1.55 m over the doubles side lines, 760 mm deep and at least 6.1 m
|
|
377
|
-
* wide; the posts 1.55 m high, on the doubles side lines.
|
|
409
|
+
* wide; the posts 1.55 m high, on the doubles side lines. The space round the court is from the BWF's Specifications for International Standard Facilities (5.3.4, 2.1.3 and 2.2.3 of the
|
|
410
|
+
* Statutes): at least 2 m clear behind the baselines and 1.5 m from the side lines.
|
|
378
411
|
*/
|
|
379
412
|
export declare const BWF_BADMINTON: BadmintonFigures;
|
|
380
413
|
/**
|
|
@@ -387,7 +420,8 @@ export declare const USAP_PICKLEBALL: PickleballFigures;
|
|
|
387
420
|
/**
|
|
388
421
|
* The ITTF's table, from Laws 2.1 and 2.2 of the Laws of Table Tennis (the 2026 statutes), in metres: 2.74 by 1.525 m and 76 cm above the floor; a white side line
|
|
389
422
|
* and end line 2 cm wide, a white centre line 3 mm wide; the net 15.25 cm above the playing surface, hung from posts 15.25 cm high whose outside limits are 15.25 cm
|
|
390
|
-
* outside the side lines.
|
|
423
|
+
* outside the side lines. The playing area round it is the ITTF's Regulations for International Competitions, 3.2.3 (ITTF Statutes 2026, chapter 3): a space of 14 m by 7 m by 5 m (8 m by 6 m
|
|
424
|
+
* for wheelchair events, 10 m by 5 m for Masters events), enclosed by surrounds 50 cm to 100 cm high, all of one dark colour, with the umpires' chairs and tables inside it.
|
|
391
425
|
*/
|
|
392
426
|
export declare const ITTF_TABLE: TableTennisFigures;
|
|
393
427
|
/**
|
package/dist/leagues/courts.js
CHANGED
|
@@ -59,7 +59,8 @@ export const FIVB_BEACH = {
|
|
|
59
59
|
* The BWF's court, from Law 1 of the Laws of Badminton (as amended 26 April 2025) and its Diagram A, in metres: 13.40 by 6.10 m, lines 40 mm wide; the singles
|
|
60
60
|
* side lines 460 mm inside the doubles side lines (so 5.18 m apart, outside to outside); the short service lines 1.98 m from the net; the doubles long service
|
|
61
61
|
* lines 760 mm inside the back boundary lines; the net 1.524 m high at the centre and 1.55 m over the doubles side lines, 760 mm deep and at least 6.1 m
|
|
62
|
-
* wide; the posts 1.55 m high, on the doubles side lines.
|
|
62
|
+
* wide; the posts 1.55 m high, on the doubles side lines. The space round the court is from the BWF's Specifications for International Standard Facilities (5.3.4, 2.1.3 and 2.2.3 of the
|
|
63
|
+
* Statutes): at least 2 m clear behind the baselines and 1.5 m from the side lines.
|
|
63
64
|
*/
|
|
64
65
|
export const BWF_BADMINTON = {
|
|
65
66
|
length: 13.4,
|
|
@@ -69,7 +70,8 @@ export const BWF_BADMINTON = {
|
|
|
69
70
|
doublesLongServiceInset: 0.76,
|
|
70
71
|
shortServiceLine: 1.98,
|
|
71
72
|
net: { postHeight: 1.55, heightCentre: 1.524, heightSides: 1.55, depth: 0.76, widthMin: 6.1 },
|
|
72
|
-
|
|
73
|
+
// The BWF's Specifications for International Standard Facilities, 5.3.4, 2.1.3 and 2.2.3: "at least two-metres clear space behind the baselines and 1.5 metre clear space from the side-lines", the same for every sanctioned tournament (one figure, so `official` and `least` agree).
|
|
74
|
+
free: { official: { side: 1.5, end: 2 }, least: { side: 1.5, end: 2 } },
|
|
73
75
|
};
|
|
74
76
|
/**
|
|
75
77
|
* USA Pickleball's court, from Section 3 of the 2026 rulebook, in feet as it prints them: 20 by 44 feet to the outside edge of the lines (3.A.1, 3.A.2); the
|
|
@@ -88,7 +90,8 @@ export const USAP_PICKLEBALL = {
|
|
|
88
90
|
/**
|
|
89
91
|
* The ITTF's table, from Laws 2.1 and 2.2 of the Laws of Table Tennis (the 2026 statutes), in metres: 2.74 by 1.525 m and 76 cm above the floor; a white side line
|
|
90
92
|
* and end line 2 cm wide, a white centre line 3 mm wide; the net 15.25 cm above the playing surface, hung from posts 15.25 cm high whose outside limits are 15.25 cm
|
|
91
|
-
* outside the side lines.
|
|
93
|
+
* outside the side lines. The playing area round it is the ITTF's Regulations for International Competitions, 3.2.3 (ITTF Statutes 2026, chapter 3): a space of 14 m by 7 m by 5 m (8 m by 6 m
|
|
94
|
+
* for wheelchair events, 10 m by 5 m for Masters events), enclosed by surrounds 50 cm to 100 cm high, all of one dark colour, with the umpires' chairs and tables inside it.
|
|
92
95
|
*/
|
|
93
96
|
export const ITTF_TABLE = {
|
|
94
97
|
length: 2.74,
|
|
@@ -97,7 +100,11 @@ export const ITTF_TABLE = {
|
|
|
97
100
|
edgeLine: 0.02,
|
|
98
101
|
centreLine: 0.003,
|
|
99
102
|
net: { height: 0.1525, postHeight: 0.1525, postOutside: 0.1525 },
|
|
100
|
-
|
|
103
|
+
space: { standard: { length: 14, width: 7, height: 5 }, masters: { length: 10, width: 5, height: 5 }, wheelchair: { length: 8, width: 6, height: 5 } },
|
|
104
|
+
surround: { least: 0.5, greatest: 1, drawn: 0.75, thickness: 0.05 },
|
|
105
|
+
umpires: { chair: 0.5, desk: { length: 1.2, width: 0.5 }, away: 0.9 },
|
|
106
|
+
// The table is centred in the space: what lies beyond its end lines and its side lines is half of what the space has over the table.
|
|
107
|
+
free: { official: { side: (7 - 1.525) / 2, end: (14 - 2.74) / 2 }, least: { side: (5 - 1.525) / 2, end: (10 - 2.74) / 2 } },
|
|
101
108
|
};
|
|
102
109
|
/**
|
|
103
110
|
* The World ParaVolley's sitting volleyball court, from Rules 1 and 2 of the Official Sitting Volleyball Rules 2025-2028, in metres: 10 by 6 m inside a free zone of
|
|
@@ -243,7 +250,7 @@ export const VOLLEYBALL_LEAGUES = [
|
|
|
243
250
|
{ id: "wpv-sitting", family: "volleyball", name: { en: "World ParaVolley sitting volleyball court", ja: "ワールドパラバレーのシッティングバレーボールコート" }, unit: "m", dimensions: WPV_SITTING, sources: ["wpv-sitting"] },
|
|
244
251
|
];
|
|
245
252
|
/** The badminton leagues: the BWF's. */
|
|
246
|
-
export const BADMINTON_LEAGUES = [{ id: "bwf", family: "badminton", name: { en: "BWF badminton court", ja: "BWFのバドミントンコート" }, unit: "m", dimensions: BWF_BADMINTON, sources: ["bwf-laws"], builtIn: true }];
|
|
253
|
+
export const BADMINTON_LEAGUES = [{ id: "bwf", family: "badminton", name: { en: "BWF badminton court", ja: "BWFのバドミントンコート" }, unit: "m", dimensions: BWF_BADMINTON, sources: ["bwf-laws", "bwf-facilities"], builtIn: true }];
|
|
247
254
|
/** The pickleball leagues: USA Pickleball's. */
|
|
248
255
|
export const PICKLEBALL_LEAGUES = [{ id: "usap", family: "pickleball", name: { en: "USA Pickleball court", ja: "USA Pickleballのコート" }, unit: "ft", dimensions: USAP_PICKLEBALL, sources: ["usap-rulebook"], builtIn: true }];
|
|
249
256
|
/** The table tennis leagues: the ITTF's. */
|
package/dist/leagues/sources.js
CHANGED
|
@@ -57,6 +57,7 @@ export const LEAGUE_SOURCES = Object.freeze(Object.fromEntries([
|
|
|
57
57
|
source({ id: "fivb-volleyball", title: "Official Volleyball Rules 2025-2028, Rules 1 Playing Area and 2 Net and Posts, and Diagram 2", by: "FIVB", edition: "2025-2028 (approved by the 39th FIVB World Congress 2024, in force from 1 January 2025)", url: "https://www.fivb.com/wp-content/uploads/2025/01/FIVB-Volleyball_Rules2025_2028-EN-v05.pdf", read: READ, note: "18 by 9 m inside a free zone of at least 3 m (5 m beside the side lines and 6.5 m behind the end lines for FIVB competitions) (1.1), lines 5 cm wide drawn inside the dimensions (1.3.1, 1.3.2), the axis of the centre line (1.3.3), the attack line's rear edge 3 m from it and, for FIVB competitions, extended by five 15 cm lines 20 cm apart to 1.75 m (1.3.4), the service zone 9 m wide limited by two 15 cm lines 20 cm behind the end line (1.4.2), the net 1 m wide and 9.50 to 10 m long (2.2), 2.43 m (men) and 2.24 m (women) high (2.1.1), side bands over the side lines (2.3), antennae 1.80 m long and 10 mm across at the outer edge of the side bands (2.4), posts 0.50 to 1.00 m outside the side lines, 1 m for FIVB competitions (2.5.1); a set to 25 (6.2), the deciding fifth to 15 (6.3.2)" }),
|
|
58
58
|
source({ id: "fivb-beach", title: "Official Beach Volleyball Rules 2025-2028, Rules 1 Playing Area and 2 Net and Posts, and Diagram 2", by: "FIVB", edition: "2025-2028 (approved by the 39th FIVB World Congress 2024, in force from 1 January 2025)", url: "https://www.fivb.com/wp-content/uploads/2025/02/FIVB-BeachVolleyball_Rules2025_2028-EN-v01.pdf", read: READ, note: "16 by 8 m inside a free zone of at least 3 m, at least 5 m and at most 6 m for FIVB competitions (1.1.1, 1.1.2), lines 5 cm wide placed inside the dimensions, no centre line (1.3.1, 1.3.2), the service zone 8 m wide (1.4.1), the net 8.5 m long and 1 m wide (2.2), 2.43 m and 2.24 m high (2.1.1), side bands and antennae as indoors (2.3, 2.4), posts 0.70 to 1.00 m outside the side lines, 1 m for FIVB competitions (2.5.1); a set to 21 (6.2), the deciding third to 15 (6.3.2)" }),
|
|
59
59
|
source({ id: "bwf-laws", title: "Laws of Badminton, Law 1 Court and Court Equipment and Diagram A, Law 7 Scoring System", by: "Badminton World Federation", edition: "as amended and adopted by the BWF 26 April 2025 (the 2026 amendments take effect on 4 January 2027 and could not be read)", url: "https://worldbadminton.com/laws/rules_2025.htm", read: READ, note: "lines 40 mm wide (1.1), posts 1.55 m on the doubles side lines (1.4, 1.5), net 760 mm deep and at least 6.1 m wide (1.7), 1.524 m at the centre and 1.55 m over the side lines (1.10); Diagram A (https://worldbadminton.com/laws/images/courtDiagram.png): 13 400 by 6 100 mm overall, singles side lines 460 mm inside the doubles side lines (40 + 420), doubles long service lines 760 mm inside the back boundary lines (40 + 720), short service lines 1 980 mm from the net, centre lines from the short service lines to the back boundary lines; a game to 21, at 20-all a two-point lead, at 29-all the 30th point (7.2, 7.4, 7.5), best of three games (7.1)" }),
|
|
60
|
+
source({ id: "bwf-facilities", title: "BWF Statutes, Section 5.3.4 Specifications for International Standard Facilities, 2.1.3, 2.1.4 and 2.2.3 (the space round and between courts)", by: "Badminton World Federation", edition: "in force 14 October 2019, version 1.1", url: "https://www.badmintonpanam.org/wp-content/uploads/2023/01/3.3.4-Specs-for-Int_l-Standard-Facilities-14-October-2019-V1.1.pdf", read: "2026-10-19", note: "at least 2 m clear behind the baselines and 1.5 m from the side lines, and 1.5 m between any two courts marked out side by side; at Grade 1 and Grade 2 tournaments at least 4 m between courts is recommended, for A-boards and the officials' chairs; competition courts are always laid side by side. The copy read is Badminton Panam's, a continental confederation's; the BWF's own current text was not read." }),
|
|
60
61
|
source({ id: "usap-rulebook", title: "USA Pickleball Official Rulebook, Section 3 Court and Equipment (3.A and 3.B)", by: "USA Pickleball", edition: "2026", url: "https://pickleballcanada.org/wp-content/uploads/2026/03/2026-Official-Rulebook-EN.pdf", read: READ, note: "the 2026 rulebook as hosted by Pickleball Canada: 20 by 44 ft to the outside edge of the lines (3.A.1, 3.A.2), a playing surface of at least 30 by 60 ft and the recommended 34 by 64 ft for tournaments (3.A.3), the non-volley zone 7 ft from the net (3.A.4.c), the centerline (3.A.4.d), lines 2 in wide (3.A.4.e), posts 22 ft apart inside to inside and at most 3 in across (3.B.2), net at least 21 ft 9 in long (3.B.3), 36 in at the sidelines and 34 in at the center (3.B.6, 3.B.7); games to 11, 15 or 21 (15.C)" }),
|
|
61
62
|
source({ id: "ittf-laws", title: "Laws of Table Tennis, 2.1 The Table, 2.2 The Net Assembly, 2.11 A Game and 2.12 A Match", by: "International Table Tennis Federation", edition: "2026 statutes, as reproduced by Table Tennis England (issue 1, July 2026)", url: "https://www.tabletennisengland.co.uk/content/uploads/2026/07/Laws-of-Table-Tennis-2026-27.pdf", read: READ, note: "the ITTF Handbook itself was not read: the playing surface 2.74 by 1.525 m and 76 cm above the floor (2.1.1), a white side line and end line 2 cm wide (2.1.4), a white centre line 3 mm wide for doubles (2.1.6), the net 15.25 cm above the playing surface (2.2.3) on posts 15.25 cm high whose outside limits are 15.25 cm outside the side line (2.2.2); a game to 11 (2.11.1), a match the best of an odd number of games (2.12.1)" }),
|
|
62
63
|
// The racket, wall and net sports added after the first five.
|
package/dist/multi.data.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
// The tournament layouts and the halls they are set in, as data. Every figure is a rulebook's or a federation's specification, or a venue's published floor, and says where in `sources`; docs/sources.md
|
|
2
2
|
// (Tournament layouts) has the rule for each and says plainly what is ours. Nothing here draws.
|
|
3
|
+
import { ITTF_TABLE } from "./leagues/courts.js";
|
|
3
4
|
import { LEAGUE_SOURCES } from "./leagues/sources.js";
|
|
4
5
|
const READ = "2026-10-19";
|
|
5
6
|
const source = (s) => [s.id, Object.freeze(s)];
|
|
6
7
|
/** The documents a layout's figures were read from, by id, beside the rulebooks of `LEAGUE_SOURCES` (a key of either names a source). */
|
|
7
8
|
export const MULTI_SOURCES = Object.freeze(Object.fromEntries([
|
|
9
|
+
source({
|
|
10
|
+
id: "ittf-statutes-2026",
|
|
11
|
+
title: "ITTF Statutes 2026 (clean version), chapter 3 Regulations for International Competitions (the Handbook's chapter 3): 3.2.3 Playing Conditions, 3.2.5.5 and 3.3.2.2",
|
|
12
|
+
by: "International Table Tennis Federation",
|
|
13
|
+
edition: "2026 (effective 1 January 2026)",
|
|
14
|
+
url: "https://db.ittf.com/sites/default/files/public/2026-02/2026_Statutes_v1_consolidated_clean.pdf",
|
|
15
|
+
read: "2026-10-20",
|
|
16
|
+
note: "the playing space a cuboid of at least 14 m by 7 m by 5 m, for wheelchair events at least 8 m by 6 m and for Masters events at least 10 m by 5 m (3.2.3.1); the equipment and fittings that are part of each playing area: the table, the flooring, the umpires' tables and chairs, the score indicators, the surrounds (3.2.3.2); surrounds enclosing the playing area, 50 cm to 100 cm high, all of the same dark colour, the corners may be left open (3.2.3.3); the flooring not light-coloured, not brightly reflecting or slippery, resilient, and in World, Olympic and Paralympic title competitions wood or a rollable synthetic material the ITTF authorises (3.2.3.8); up to 6 advertisements on the floor of the playing area (3.2.5.5); the umpire sits or stands in line with the net and the assistant umpire directly facing him or her at the other side of the table (3.3.2.2)",
|
|
17
|
+
}),
|
|
8
18
|
source({
|
|
9
19
|
id: "ittf-handbook",
|
|
10
20
|
title: "The ITTF Handbook 2022, Section 3 Regulations for International Competitions, 3.2.3 Playing Conditions and 3.2.5.5 (advertisements on the floor)",
|
|
@@ -12,16 +22,7 @@ export const MULTI_SOURCES = Object.freeze(Object.fromEntries([
|
|
|
12
22
|
edition: "2022 (v1.0, clean)",
|
|
13
23
|
url: "https://documents.ittf.sport/sites/default/files/public/2022-02/ITTF_HB_2022_clean_v1_0.pdf",
|
|
14
24
|
read: READ,
|
|
15
|
-
note: "the playing space at least 14 m by 7 m by 5 m, the four corners may be covered by surrounds of at most 1.5 m (3.2.3.1); each playing area enclosed by surrounds about 75 cm high, of one dark colour, separating it from its neighbours and from the spectators (3.2.3.3); the umpire's table and chair and the score indicators are part of the area (3.2.3.2); up to 6 advertisements on the floor of the area (3.2.5.5). A later edition (the 2024 Statutes) was seen only in a search summary, which says the space may be of any shape within a rectangle of the same size; the 2022 text is the one drawn.",
|
|
16
|
-
}),
|
|
17
|
-
source({
|
|
18
|
-
id: "bwf-facilities",
|
|
19
|
-
title: "BWF Statutes, Section 5.3.4 Specifications for International Standard Facilities, 2.1.3, 2.1.4 and 2.2.3 (the space round and between courts)",
|
|
20
|
-
by: "Badminton World Federation",
|
|
21
|
-
edition: "in force 14 October 2019, version 1.1",
|
|
22
|
-
url: "https://www.badmintonpanam.org/wp-content/uploads/2023/01/3.3.4-Specs-for-Int_l-Standard-Facilities-14-October-2019-V1.1.pdf",
|
|
23
|
-
read: READ,
|
|
24
|
-
note: "at least 2 m clear behind the baselines and 1.5 m from the side lines, and 1.5 m between any two courts marked out side by side; at Grade 1 and Grade 2 tournaments at least 4 m between courts is recommended, for A-boards and the officials' chairs; competition courts are always laid side by side. The copy read is Badminton Panam's, a continental confederation's; the BWF's own current text was not read.",
|
|
25
|
+
note: "(superseded by the 2026 Statutes' chapter 3, which has no 1.5 m for the corners and 50 cm to 100 cm for the surrounds) the playing space at least 14 m by 7 m by 5 m, the four corners may be covered by surrounds of at most 1.5 m (3.2.3.1); each playing area enclosed by surrounds about 75 cm high, of one dark colour, separating it from its neighbours and from the spectators (3.2.3.3); the umpire's table and chair and the score indicators are part of the area (3.2.3.2); up to 6 advertisements on the floor of the area (3.2.5.5). A later edition (the 2024 Statutes) was seen only in a search summary, which says the space may be of any shape within a rectangle of the same size; the 2022 text is the one drawn.",
|
|
25
26
|
}),
|
|
26
27
|
source({
|
|
27
28
|
id: "ppa-host",
|
|
@@ -193,11 +194,12 @@ export const MULTI_PRESETS = Object.freeze([
|
|
|
193
194
|
id: "tabletennis-4",
|
|
194
195
|
name: { en: "Table tennis, four areas (2 x 2)", ja: "卓球 4面(2×2)" },
|
|
195
196
|
sport: "tabletennis",
|
|
196
|
-
|
|
197
|
+
// The area is the unit: each bay below is the playing space the table stands centred in (the single surface's own `net.free`), so the layout draws that area itself, with its surrounds and chairs, and the surface only the table.
|
|
198
|
+
surface: { sport: "tabletennis", net: { free: "none" } },
|
|
197
199
|
kind: "cells",
|
|
198
200
|
rows: 2,
|
|
199
201
|
columns: 2,
|
|
200
|
-
bay: { length:
|
|
202
|
+
bay: { length: ITTF_TABLE.space.standard.length, width: ITTF_TABLE.space.standard.width, unit: "m" },
|
|
201
203
|
word: "table",
|
|
202
204
|
parts: TT_PARTS,
|
|
203
205
|
floor: "blue",
|
|
@@ -211,35 +213,36 @@ export const MULTI_PRESETS = Object.freeze([
|
|
|
211
213
|
ja: { name: "世界卓球選手権団体戦ファイナルズ", venue: "OVOアリーナ・ウェンブリー", city: "ロンドン" },
|
|
212
214
|
floor: "ovo-arena-wembley",
|
|
213
215
|
note: {
|
|
214
|
-
en: "Four playing areas on one blue floor with seats round the perimeter, one scoreboard for all four hung over their middle, barriers and an umpire's chair at each (read from the owner's photographs; no plan was seen). Each area is drawn at the
|
|
216
|
+
en: "Four playing areas on one blue floor with seats round the perimeter, one scoreboard for all four hung over their middle, barriers and an umpire's chair at each (read from the owner's photographs; no plan was seen). Each area is drawn at the Statutes' least, 14 m by 7 m.",
|
|
215
217
|
ja: "青い床1枚の上に競技エリアが4面あり、周囲に客席があります。4面の中央の真上に共用のスコアボードが1台吊るされ、各エリアにフェンスと審判席があります(提供された写真から読み取りました。図面は見ていません)。各エリアは規則の最小値14m×7mで描いています。",
|
|
216
218
|
},
|
|
217
|
-
sources: ["ittf-london-2026", "ittf-
|
|
219
|
+
sources: ["ittf-london-2026", "ittf-statutes-2026", "ovo-arena"],
|
|
218
220
|
},
|
|
219
221
|
rule: {
|
|
220
|
-
en: "ITTF
|
|
221
|
-
ja: "ITTF
|
|
222
|
+
en: "ITTF Statutes 2026, chapter 3 (the Handbook), 3.2.3.1: a playing space of at least 14 m by 7 m by 5 m for each area; 3.2.3.3: surrounds 50 cm to 100 cm high, all of one dark colour, enclosing each area (75 cm drawn: ours, within the rule).",
|
|
223
|
+
ja: "ITTF規程2026 第3章(ハンドブック)3.2.3.1:各エリアは14m×7m×5m以上の競技空間。3.2.3.3:各エリアを囲むフェンスは高さ50cm〜100cmで、すべて同じ濃い色(描画は75cm:このパッケージの判断で、規則の範囲内)。",
|
|
222
224
|
},
|
|
223
|
-
sources: ["ittf-
|
|
225
|
+
sources: ["ittf-statutes-2026", "ittf-london-2026", "ovo-arena"],
|
|
224
226
|
},
|
|
225
227
|
{
|
|
226
228
|
id: "tabletennis-8",
|
|
227
229
|
name: { en: "Table tennis, eight areas (2 x 4)", ja: "卓球 8面(2×4)" },
|
|
228
230
|
sport: "tabletennis",
|
|
229
|
-
|
|
231
|
+
// The area is the unit: each bay below is the playing space the table stands centred in (the single surface's own `net.free`), so the layout draws that area itself, with its surrounds and chairs, and the surface only the table.
|
|
232
|
+
surface: { sport: "tabletennis", net: { free: "none" } },
|
|
230
233
|
kind: "cells",
|
|
231
234
|
rows: 2,
|
|
232
235
|
columns: 4,
|
|
233
|
-
bay: { length:
|
|
236
|
+
bay: { length: ITTF_TABLE.space.standard.length, width: ITTF_TABLE.space.standard.width, unit: "m" },
|
|
234
237
|
word: "table",
|
|
235
238
|
parts: TT_PARTS,
|
|
236
239
|
floor: "blue",
|
|
237
240
|
basis: "rulebook",
|
|
238
241
|
rule: {
|
|
239
|
-
en: "ITTF
|
|
240
|
-
ja: "ITTF
|
|
242
|
+
en: "ITTF Statutes 2026, chapter 3 (the Handbook), 3.2.3.1 and 3.2.3.3: eight areas of 14 m by 7 m, in two rows. No event's count of areas was sourced for this one; it is the grid the rule allows.",
|
|
243
|
+
ja: "ITTF規程2026 第3章(ハンドブック)3.2.3.1と3.2.3.3:14m×7mのエリア8面を2行4列に並べます。特定の大会の面数は確認できていません。規則が認める並べ方です。",
|
|
241
244
|
},
|
|
242
|
-
sources: ["ittf-
|
|
245
|
+
sources: ["ittf-statutes-2026"],
|
|
243
246
|
},
|
|
244
247
|
{
|
|
245
248
|
id: "pickleball-2x2",
|
|
@@ -433,7 +436,8 @@ export const MULTI_PRESETS = Object.freeze([
|
|
|
433
436
|
id: "badminton-1x4",
|
|
434
437
|
name: { en: "Badminton, four courts side by side (1 x 4), the spacing recommended for Grade 1 and 2", ja: "バドミントン 4面を横並び(1×4)、グレード1・2の推奨間隔" },
|
|
435
438
|
sport: "badminton",
|
|
436
|
-
|
|
439
|
+
// The space round a court is the BWF's (2 m behind the baselines, 1.5 m beside the side lines): the bays below are that space and the spacing between courts, so the layout draws the court alone.
|
|
440
|
+
surface: { sport: "badminton", net: { free: "none" } },
|
|
437
441
|
kind: "cells",
|
|
438
442
|
rows: 1,
|
|
439
443
|
columns: 4,
|
|
@@ -454,7 +458,8 @@ export const MULTI_PRESETS = Object.freeze([
|
|
|
454
458
|
id: "badminton-1x4-min",
|
|
455
459
|
name: { en: "Badminton, four courts side by side (1 x 4), the least spacing", ja: "バドミントン 4面を横並び(1×4)、最小の間隔" },
|
|
456
460
|
sport: "badminton",
|
|
457
|
-
|
|
461
|
+
// The space round a court is the BWF's (2 m behind the baselines, 1.5 m beside the side lines): the bays below are that space and the spacing between courts, so the layout draws the court alone.
|
|
462
|
+
surface: { sport: "badminton", net: { free: "none" } },
|
|
458
463
|
kind: "cells",
|
|
459
464
|
rows: 1,
|
|
460
465
|
columns: 4,
|
package/dist/surfaces/net.js
CHANGED
|
@@ -31,6 +31,10 @@ const BAND = { wall: ["walls", "ky-wall"], mesh: ["fence", "ky-mesh"], face: ["w
|
|
|
31
31
|
function solid(o, s) {
|
|
32
32
|
if (s.kind === "table")
|
|
33
33
|
return el("path", { class: ft(o, "table", "ky-table"), d: box(s.rect) });
|
|
34
|
+
if (s.kind === "chair")
|
|
35
|
+
return el("path", { class: ft(o, "chairs", "ky-chair"), d: box(s.rect) });
|
|
36
|
+
if (s.kind === "desk")
|
|
37
|
+
return el("path", { class: ft(o, "umpires-table", "ky-table"), d: box(s.rect) });
|
|
34
38
|
return el("circle", { class: ft(o, "net", "ky-nt-post"), cx: s.cx, cy: s.cy, r: s.r }) + el("circle", { class: ft(o, "net", "ky-set-net"), cx: s.cx, cy: s.cy, r: s.r * 0.84 });
|
|
35
39
|
}
|
|
36
40
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -406,9 +406,18 @@ export interface NetStyle {
|
|
|
406
406
|
look?: string;
|
|
407
407
|
/**
|
|
408
408
|
* The free zone drawn round the court: `official` (the default: the figure a rulebook gives for its own competitions, where it gives one), `least` (the least it allows
|
|
409
|
-
* or recommends) or `none`. Tennis (Appendix X), volleyball, beach volleyball and sitting volleyball (Rule 1.1), pickleball (Rule 3.A.3), sepak takraw (Law 1.5)
|
|
409
|
+
* or recommends) or `none`. Tennis (Appendix X), volleyball, beach volleyball and sitting volleyball (Rule 1.1), pickleball (Rule 3.A.3), sepak takraw (Law 1.5), netball (Rule 1, item 8) table tennis (the ITTF's 3.2.3.1, the playing space) and badminton (the BWF's facilities specification, 5.3.4: 2 m behind the baselines and 1.5 m beside the side lines) give figures; padel, squash, racquetball, teqball and roundnet do not.
|
|
410
410
|
*/
|
|
411
411
|
free?: "official" | "least" | "none";
|
|
412
|
+
/**
|
|
413
|
+
* Table tennis: the kind of event the playing area is for (the ITTF's Regulations for International Competitions, 3.2.3.1): `standard` (the default: a space of at least 14 m by 7 m by 5 m, for the Worlds and every international event),
|
|
414
|
+
* `masters` (10 m by 5 m, the least a Masters event allows) or `wheelchair` (8 m by 6 m). It sets the free zone round the table (`free: "none"` still draws none); the standard one is `free: "official"` and the Masters one `free: "least"`.
|
|
415
|
+
*/
|
|
416
|
+
area?: "standard" | "masters" | "wheelchair";
|
|
417
|
+
/** Table tennis: draw the surrounds that enclose the playing area, 75 cm high (ours, within the 50 cm to 100 cm of 3.2.3.3), of one dark colour. On by default where a playing area is drawn. */
|
|
418
|
+
surrounds?: boolean;
|
|
419
|
+
/** Table tennis: draw the umpire's chair in line with the net, the assistant umpire's chair facing it across the table, and the umpires' table (3.3.2.2; their sizes are ours). On by default where a playing area is drawn. */
|
|
420
|
+
umpires?: boolean;
|
|
412
421
|
/** Tennis: draw the two singles sticks that hold a doubles net up for a singles match, 3 feet outside the singles court (Rule 1). Off by default. */
|
|
413
422
|
sticks?: boolean;
|
|
414
423
|
}
|
package/dist/uprights.net.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bar, flat, n, pole } from "./turn.kit.js";
|
|
2
2
|
import { moreUprights } from "./uprights.more.js";
|
|
3
|
-
import { netPlane, sag, tableBody } from "./uprights.netkit.js";
|
|
3
|
+
import { netPlane, sag, standingBox, surroundWalls, tableBody } from "./uprights.netkit.js";
|
|
4
4
|
import { convertLength } from "./units.js";
|
|
5
5
|
/** The uprights of a court: what hangs on its posts. `thin` is the least thickness drawn, in feet. */
|
|
6
6
|
export function netUprights(plan, geo, settings, thin) {
|
|
@@ -102,16 +102,23 @@ export function netUprights(plan, geo, settings, thin) {
|
|
|
102
102
|
const room = Math.max(L, W) * 5;
|
|
103
103
|
// Under the table lies its shadow on that floor, so that the legs stand on something.
|
|
104
104
|
const grow = Math.max(convertLength(0.25, "m", "ft"), thin * 4);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
const ground = [flat("ground", "ground", -room, -room, L + room, W + room, 0, `<rect width="${n(L + 2 * room)}" height="${n(W + 2 * room)}" class="u-ground"/>`)];
|
|
106
|
+
// The playing area has its own floor, in the look's colour, and is enclosed by its surrounds, with the umpires' chairs and table inside (the same figures as the flat drawing's).
|
|
107
|
+
const zone = plan.zone;
|
|
108
|
+
if (zone !== null) {
|
|
109
|
+
const [ax0, ay0, ax1, ay1] = [-zone.end, -zone.side, L + zone.end, W + zone.side];
|
|
110
|
+
ground.push(flat("area-floor", "ground", ax0, ay0, ax1, ay1, 0.003, `<rect width="${n(ax1 - ax0)}" height="${n(ay1 - ay0)}" class="ky-free"/>`));
|
|
111
|
+
if (plan.surrounds)
|
|
112
|
+
items.push({ id: "surrounds", kind: "surrounds", at: [L / 2, W / 2], height: f.surround.drawn, planes: surroundWalls("surround", [ax0, ay0, ax1, ay1], f.surround.drawn) });
|
|
113
|
+
const chairs = geo.solids.filter((one) => one.kind === "chair" || one.kind === "desk");
|
|
114
|
+
if (chairs.length > 0) {
|
|
115
|
+
// An umpire's chair is 40 cm to the seat and the table 75 cm (ours: the rules give no height).
|
|
116
|
+
const planes = chairs.flatMap((one, i) => (one.kind === "chair" || one.kind === "desk" ? standingBox(`${one.kind}-${i + 1}`, one.kind, one.rect, convertLength(one.kind === "chair" ? 0.45 : 0.75, "m", "ft"), "u-chair") : []));
|
|
117
|
+
items.push({ id: "officials", kind: "officials", at: [L / 2, W / 2], height: convertLength(0.75, "m", "ft"), planes });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
ground.push(flat("table-shadow", "ground", -grow / 2, -grow / 2, L + grow / 2, W + grow / 2, 0.005, `<rect width="${n(L + grow)}" height="${n(W + grow)}" rx="${n(grow)}" class="u-shadow"/>`));
|
|
121
|
+
items.push({ id: "ground", kind: "table-legs", at: [L / 2, W / 2], height: 0, planes: ground });
|
|
115
122
|
return { items, lift };
|
|
116
123
|
}
|
|
117
124
|
default:
|
|
@@ -26,3 +26,12 @@ export declare const sag: (y0: number, y1: number, centre: number, posts: number
|
|
|
26
26
|
* itself (a teqball table stands on a court; a table tennis table is the surface, which the drawing already shows).
|
|
27
27
|
*/
|
|
28
28
|
export declare function tableBody(x0: number, y0: number, x1: number, y1: number, lift: number, thin: number, top: boolean): Plane[];
|
|
29
|
+
/** A rectangle on the floor, in feet. */
|
|
30
|
+
export type FloorRect = readonly [x0: number, y0: number, x1: number, y1: number];
|
|
31
|
+
/**
|
|
32
|
+
* The surrounds that enclose a playing area: four boards of one height standing over the edge of `r`, each in pieces of at most ten feet (so each is sorted among the table and the chairs and not as one slab by its
|
|
33
|
+
* middle), facing out from the area's middle and giving way to a nearly level eye, as the glass of a rink does. Painted in the look's own surround colour.
|
|
34
|
+
*/
|
|
35
|
+
export declare function surroundWalls(id: string, r: FloorRect, height: number): Plane[];
|
|
36
|
+
/** A solid box on the floor, in feet: four sides up to `top` and a flat top; `cls` paints the top and `cls-side` (a tone darker) the sides. */
|
|
37
|
+
export declare function standingBox(id: string, kind: Plane["kind"], r: FloorRect, top: number, cls: string, side?: string): Plane[];
|
package/dist/uprights.netkit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The pieces the net sports' uprights share: a net hung between a top line and a bottom line, the sag of a net between its posts, and a table lifted on its legs.
|
|
2
|
-
import { flat, n, plane, pole, threads, wall } from "./turn.kit.js";
|
|
2
|
+
import { flat, n, plane, pole, shy, threads, wall } from "./turn.kit.js";
|
|
3
3
|
import { convertLength } from "./units.js";
|
|
4
4
|
/** The net: a mesh between a top line and a bottom line, with its tape, on one plane standing over the line x. */
|
|
5
5
|
export function netPlane(b, lift) {
|
|
@@ -65,3 +65,34 @@ export function tableBody(x0, y0, x1, y1, lift, thin, top) {
|
|
|
65
65
|
planes.push(...pole(`leg-${i}`, "leg", lx, ly, 0, lift - skirt, leg, "u-leg"));
|
|
66
66
|
return planes;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* The surrounds that enclose a playing area: four boards of one height standing over the edge of `r`, each in pieces of at most ten feet (so each is sorted among the table and the chairs and not as one slab by its
|
|
70
|
+
* middle), facing out from the area's middle and giving way to a nearly level eye, as the glass of a rink does. Painted in the look's own surround colour.
|
|
71
|
+
*/
|
|
72
|
+
export function surroundWalls(id, r, height) {
|
|
73
|
+
const [x0, y0, x1, y1] = r;
|
|
74
|
+
const centre = [(x0 + x1) / 2, (y0 + y1) / 2];
|
|
75
|
+
const sides = [[x0, y0, x1, y0], [x1, y0, x1, y1], [x1, y1, x0, y1], [x0, y1, x0, y0]];
|
|
76
|
+
const rim = Math.min(0.3, height * 0.12);
|
|
77
|
+
const planes = [];
|
|
78
|
+
sides.forEach(([xa, ya, xb, yb], side) => {
|
|
79
|
+
const long = Math.hypot(xb - xa, yb - ya);
|
|
80
|
+
const pieces = Math.max(1, Math.ceil(long / 10));
|
|
81
|
+
const run = long / pieces;
|
|
82
|
+
for (let i = 0; i < pieces; i += 1) {
|
|
83
|
+
const [t0, t1] = [i / pieces, (i + 1) / pieces];
|
|
84
|
+
const svg = `<rect width="${n(run)}" height="${n(height)}" class="ky-wall"/><rect width="${n(run)}" height="${n(rim)}" class="u-surround-rim"/>`;
|
|
85
|
+
const p = wall(`${id}-${side + 1}-${i + 1}`, "surround", xa + (xb - xa) * t0, ya + (yb - ya) * t0, xa + (xb - xa) * t1, ya + (yb - ya) * t1, 0, height, svg);
|
|
86
|
+
planes.push({ ...shy(p, centre), fadeTo: 0.35, fadeAt: 0.85 });
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return planes;
|
|
90
|
+
}
|
|
91
|
+
/** A solid box on the floor, in feet: four sides up to `top` and a flat top; `cls` paints the top and `cls-side` (a tone darker) the sides. */
|
|
92
|
+
export function standingBox(id, kind, r, top, cls, side = `${cls}-side`) {
|
|
93
|
+
const [x0, y0, x1, y1] = r;
|
|
94
|
+
const sides = [[x0, y0, x1, y0], [x1, y0, x1, y1], [x1, y1, x0, y1], [x0, y1, x0, y0]];
|
|
95
|
+
const planes = sides.map(([a, b, c, d], i) => wall(`${id}-${i + 1}`, kind, a, b, c, d, 0, top, `<rect width="${n(Math.hypot(c - a, d - b))}" height="${n(top)}" class="${side}"/>`));
|
|
96
|
+
planes.push(flat(`${id}-top`, kind, x0, y0, x1, y1, top, `<rect width="${n(x1 - x0)}" height="${n(y1 - y0)}" class="${cls}"/>`));
|
|
97
|
+
return planes;
|
|
98
|
+
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.16.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package's version: the same as package.json's, and a test holds them to each other. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.16.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Kyogijo Stadiums 競技場, 39 sports' surfaces as SVG, drawn to scale from the rulebooks: NFL, CFL and IFAF football fields, an NHL rink, an NBA court, MLB ballparks, soccer pitches, curling sheets, athletics stadiums, speed skating, short track and figure skating rinks, swimming pools, water polo fields, diving wells, artistic swimming areas, and the courts and fields of 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 and handball, and the budo of judo, karate, kendo, sumo and kyudo with a dojo of tatami laid as real units, with each team's name and logo on its side and the score in the middle, stands and a crowd, a pageant of flags, and a 3D view. Light and dark, accessible, a compact badge for lists, a helper for React and a custom element. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sports",
|