@johnmorrisdotca/kyogijo-stadiums 0.24.0 → 0.27.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 +39 -0
- package/NOTICE.md +27 -0
- package/README.md +95 -59
- package/dist/crowd.d.ts +56 -2
- package/dist/crowd.draw.d.ts +3 -1
- package/dist/crowd.draw.js +27 -3
- package/dist/crowd.js +18 -10
- package/dist/district-entry.d.ts +5 -0
- package/dist/district-entry.js +4 -0
- package/dist/district.d.ts +167 -0
- package/dist/district.js +291 -0
- package/dist/district.turn.d.ts +27 -0
- package/dist/district.turn.js +157 -0
- package/dist/draw.js +22 -2
- package/dist/flythrough-entry.d.ts +8 -0
- package/dist/flythrough-entry.js +6 -0
- package/dist/flythrough.dom.d.ts +103 -0
- package/dist/flythrough.dom.js +517 -0
- package/dist/flythrough.markup.d.ts +48 -0
- package/dist/flythrough.markup.js +86 -0
- package/dist/flythrough.path.d.ts +145 -0
- package/dist/flythrough.path.js +253 -0
- package/dist/flythrough.style.d.ts +2 -0
- package/dist/flythrough.style.js +40 -0
- package/dist/flythrough.words.d.ts +33 -0
- package/dist/flythrough.words.js +44 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/stadiums-entry.d.ts +2 -0
- package/dist/stadiums-entry.js +2 -0
- package/dist/stadiums.d.ts +158 -0
- package/dist/stadiums.data.d.ts +2 -0
- package/dist/stadiums.data.js +11 -0
- package/dist/stadiums.js +210 -0
- package/dist/stadiums.osm.data.d.ts +2 -0
- package/dist/stadiums.osm.data.js +58 -0
- package/dist/strings.d.ts +17 -0
- package/dist/strings.js +2 -2
- package/dist/turn.kit.d.ts +5 -0
- package/dist/turn.markup.d.ts +7 -0
- package/dist/turn.markup.js +38 -2
- package/dist/turn.model.d.ts +4 -0
- package/dist/turn.model.js +3 -1
- package/dist/turn.style.js +6 -0
- package/dist/types.d.ts +11 -0
- package/dist/venue.d.ts +2 -0
- package/dist/venue.js +7 -4
- package/dist/venue.real.d.ts +21 -0
- package/dist/venue.real.js +150 -0
- package/dist/venues-entry.d.ts +2 -0
- package/dist/venues-entry.js +2 -0
- package/dist/venues.d.ts +153 -0
- package/dist/venues.data.d.ts +2 -0
- package/dist/venues.data.js +74 -0
- package/dist/venues.geo.d.ts +60 -0
- package/dist/venues.geo.js +211 -0
- package/dist/venues.js +213 -0
- package/dist/venues.osm.data.d.ts +4 -0
- package/dist/venues.osm.data.js +363 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +25 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,45 @@ All notable changes to this project are written here. The format follows
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.27.0] - 2026-10-20
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **BC Place, a real stadium** (`stadium: "bc-place"` with `crowd: { real: true }`, [the real stadiums](./docs/stadiums.md), entry `@johnmorrisdotca/kyogijo-stadiums/stadiums`): the stadium of Vancouver drawn in the outline of its building, as OpenStreetMap maps it, for **football** (`sport: "cfl"`, the 150 by 65 yard field with its 20-yard end zones, 54,500 seats) and for **soccer** (`sport: "soccer"`, the international 105 by 68 metres, 52,497 seats), the same building and bowl for both. A soccer drawing whose `ground` is `bc-place` needs no `stadium`. Any other sport, a `league` of your own and `crowd: { real: false }` are drawn as before.
|
|
15
|
+
- **Level one, the building and the field.** The outline is the closed way OpenStreetMap tags with the stadium's Wikidata item (read on 2026-10-20, simplified to a metre). OpenStreetMap also maps the roof as a band with an opening in it, which the article says is the field's size (100 by 85 metres; mapped 101.8 by 85.3): the field lies along that opening, 52.8 degrees from north, which the building's own main hall agrees with to a few degrees, and a small arrow says where north is.
|
|
16
|
+
- **Level two, the bowl.** The configuration's seats in two bowls between the first row (the package's gridiron distances from the field) and the building's wall, the lower bowl holding the infobox's 27,695 seats in both configurations and the upper bowl the rest; a bowl that fits holds exactly the configuration's seats (football's 54,500 need 3.4 square feet of floor a seat, soccer's 52,497 need 3.8). Never a seat map; no mark of a club, a league or a tournament.
|
|
17
|
+
- **The cable roof, in 3D** (`venue: { roof: true }`): the roof the article describes, retractable and supported by cables. Its rim stands where OpenStreetMap maps it (48 metres), the roof rises 13 metres to the opening, each piece carries a cable, and over the opening lies the fabric (thin, so the seats show through) with the pod in the middle; `venue: { roof: true, roofOpen: true }` gathers the fabric into the pod. `RealShell.roof` has a third kind, `cable`, with a `crown`.
|
|
18
|
+
- **A district** (`drawDistrict`, `buildDistrictTurn`, `mountDistrictTurn`, [a district of venues](./docs/district.md), entry `@johnmorrisdotca/kyogijo-stadiums/district`): several real venues of one city on one plan at their real relative positions and orientations, read from the same OpenStreetMap outlines, rotatable together in 3D with the steady camera and drawn in 2D too. It is generic: `venues` is any list of keys (`rogers-arena`, `bc-place`, `bc-place:soccer`), the plan fits itself to them, and `mode` says how: `neighbours` (the default) tight round buildings a few hundred metres apart, with a grid of 100 metres, or `city` at the real distances, with a grid of kilometres and a name beside each venue. `turn` turns the map (`"auto"` lays its long way across the page), `labels` writes the names, and the distance between each pair of middles is in `plan.between`.
|
|
19
|
+
- **Buildings stacked building by building.** The 3D view stacks planes by the depth of their middles, which put the roof of a far building over the wall of a near one. A model may now name its buildings (`TurnModel.groups`, `Plane.group`): one building is in front of another when a line can be put between them and the eye is on its side of it (`groupRanks`), the far one drawn first; a model that names none is stacked as before. For BC Place and Rogers Arena depth alone got 56 of 168 views wrong; grouped, none.
|
|
20
|
+
- **The demo's pages**: `stadiums.html` (both configurations in 2D and 3D, the roof closed or open, the facts listed) and `district.html?venues=bc-place,rogers-arena` (venues to choose, neighbours or a city, turned or north up, names, 2D or 3D), English and Japanese, light and dark; the venues page links to both. **The docs** have [a page](./docs/stadiums.md) for the stadium, [a page](./docs/district.md) for the district and [a gallery](https://johnmorrisdotca.github.io/kyogijo-stadiums/docs/gallery-stadiums.html) of both.
|
|
21
|
+
- **ODbL data kept apart**, as for the venues: what OpenStreetMap gave (outline, roof heights, opening, axis) is only in `src/stadiums.osm.data.ts` and `data-sources/stadiums/`; the facts (seats of each configuration, bowls, roof kind and opening size, each with its article and revision) are in `src/stadiums.data.ts`. `pnpm stadiums:fetch` fetches politely, one request at a time; `pnpm stadiums` makes the data files and the docs' table and refuses a figure the sources do not give. The credit `VENUE_ATTRIBUTION` is in every description.
|
|
22
|
+
|
|
23
|
+
## [0.26.0] - 2026-10-20
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- **The fly-through** (`mountFlythrough`, [the fly-through](./docs/flythrough.md), entry `@johnmorrisdotca/kyogijo-stadiums/flythrough`): one smooth camera from a map to a real arena. It starts on a map drawn with chizu (handed over as `start: { map, draw, project }`, so the package keeps no dependency; a plain graticule without one), falls to the city and to the building of the arena as OpenStreetMap maps it, and the building rises into the 3D arena, which tips to the sport's main camera and turns. `mountFlythrough(host, { arena, start?, stages?, language?, theme? }, settings?)` gives back `play`, `pause`, `toggle`, `next`, `back`, `goTo(stage)`, `seek(seconds)`, `camera()` and `destroy`. This first release ends on the turning arena; into the bowl, down to the rink and a game on it are the next ones.
|
|
28
|
+
- **One path, no jumps.** The camera is ten numbers (how far in, where the arena stands on the screen, how far the map is turned, how much of the map, the plan and the arena shows, the 3D view's turn, tip and zoom), each running through the path's keyframes as a monotone cubic: smooth at every keyframe, still at the start, never overshooting a layer's share. The map's viewBox is true to the ground round the arena and turned to the venue's own orientation as it comes in; the plan hands over to the 3D arena at the same size and place, measured in the stage as it is. `flightPlan`, `cameraAt` and `stageAt` are the path as plain numbers, pure and testable in Node.
|
|
29
|
+
- **Controls and reduced motion.** Back, Play or Pause (the clock eases to a stop), Next and a button for each stage; Space, the arrows, the number keys and Home; a skip glides along the path and does not cut. A reader who prefers reduced motion gets each stage as a still (the map, the plan, the arena at the main camera), Next, Back and the stage buttons show the next still at once, and Play steps through them every five seconds.
|
|
30
|
+
- **The demo's fly-through page** (`flythrough.html?arena=honda-center`): each of the eight venues, English and Japanese, light and dark, desk and phone, with the OpenStreetMap credit under the stage. No word is stretched (the words are HTML over the layers) and no team's or league's mark is drawn.
|
|
31
|
+
- Tests that walk the path at 60 frames a second for every list of stages (no step, no jump of speed), check that every stage is reachable, that the stills show one layer whole, and, in a real browser, that the pin, the plan and the 3D floor never jump on the screen at 30 frames a second and are the same size where they hand over.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- The shared background module in `scripts/` (tooling for the demo and the README pictures; the package ships none of it) is now the family's version 1.0.1: the `id` it is given is made safe (letters, digits, `_` and `-`; `bg-` in front of one that does not start with a letter) before it is written into element ids and `url(#...)`. `test/family-backgrounds.test.ts` draws every preset with hostile ids.
|
|
36
|
+
|
|
37
|
+
## [0.25.0] - 2026-10-20
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **The real venues** (`crowd: { real: true }`, [the real venues](./docs/venues.md), entry `@johnmorrisdotca/kyogijo-stadiums/venues`): an NHL arena drawn in the outline of its building, as OpenStreetMap maps it, with the rink lying in it and a plausible bowl of the seats, the seating tiers and the roof the sources give. The first step is the eight arenas of the Pacific Division: the Honda Center, the Scotiabank Saddledome, Rogers Place, the Crypto.com Arena, the SAP Center, the Climate Pledge Arena, Rogers Arena and the T-Mobile Arena. An arena with no venue is drawn with the usual stands, as before; so is any other sport, and a drawing with a `league` of its own.
|
|
42
|
+
- **Level one, the building.** The outline is the closed way OpenStreetMap tags with the arena's Wikidata item, read with the Overpass API on 2026-10-20 and simplified to a metre. The drawing is turned so that the rink lies along the page where the building says how it lies, and a small arrow marked N says where north is; the rink's orientation is inferred from the building's main hall (the largest rectangle that fits its outline) for five of the eight, and not known for the three whose building has no direction (drawn east-west with north at the top and no arrow); OpenStreetMap maps the ice in none of them.
|
|
43
|
+
- **Level two, the bowl.** The venue's seats for ice hockey, in its number of tiers, between the first row and the building's wall: each tier's outer edge is placed so that its band holds its share of the seats (a lower bowl of 56 percent, or the share a source gives: two thirds in the Crypto.com Arena), with a walk between the tiers and rows no steeper than 36 degrees, and a bowl that fits holds exactly the venue's seats. A building too small for them gets a steeper bowl (the Rogers Arena's), and `fit` says `tight` where even that is not enough. The 3D view raises the tiers as solid raked planes, and with `venue: { roof: true }` the building's walls and its roof: a lid, or the Saddledome's saddle (high at the two ends of the rink, low at the two sides). A neutral crowd, no visitors' block and no mark of a team or a league; never a seat map.
|
|
44
|
+
- **Facts with their sources.** `VENUES` holds, for each venue, its seats (Wikidata's figure for ice hockey where its item has one, else the English article's), its number of tiers and its kind of roof, each with whether a source says it (`documented`) or it is ours (`plausible`) and what was read, with the article and revision. Wikidata has no tiers and no roof for any of them; the articles say the Saddledome's roof, the Climate Pledge Arena's, and the tiers of three. `planVenue`, `venueBowl`, `venueOrientation`, `bowlInside` and `venueById` are the rest of the entry.
|
|
45
|
+
- **ODbL data kept apart.** What OpenStreetMap gave (outline, height, the axis worked out from it) is ODbL 1.0 data, "(c) OpenStreetMap contributors": it is only in `src/venues.osm.data.ts` and `data-sources/venues/`, offered under the ODbL with the credit `VENUE_ATTRIBUTION`, and the description of a drawing made from it carries the credit. The facts are in `src/venues.data.ts`, CC0 and facts of English Wikipedia articles, and share nothing with it. The raw answers are kept as they were returned, dated (`pnpm venues:fetch` fetches them politely, one request at a time; `pnpm venues` makes the two data files and the table of the docs from them).
|
|
46
|
+
- **The demo's venues page** (`venues.html`): each of the eight in 2D and in 3D, the four viewpoints, the roof and walls, light and dark, English and Japanese, with what the drawing is made from listed under it. **The docs** have [a page](./docs/venues.md) and [a gallery](https://johnmorrisdotca.github.io/kyogijo-stadiums/docs/gallery-venues.html) of the eight.
|
|
47
|
+
- `CrowdOptions.stands: false` draws no seats (of a real venue only its building and the arrow): what the 3D view's floor needs under the stands it raises.
|
|
48
|
+
|
|
10
49
|
## [0.24.0] - 2026-10-20
|
|
11
50
|
|
|
12
51
|
### Added
|
package/NOTICE.md
CHANGED
|
@@ -43,6 +43,10 @@ picture or code of the sources is copied; each source is named here so that the
|
|
|
43
43
|
| `grounds`: the World Cups each ground staged matches of, and where each final was played | The venue section of the English Wikipedia article of each men's and Women's World Cup, at the revision cited below; FIFA's own pages are not used | Facts, CC BY-SA 4.0 articles as above |
|
|
44
44
|
| `grounds`: the Wikidata item and the coordinates of each ground (`wikidata`, `lat`, `lon`) | The item that each cited article is linked to, its coordinates (P625) and its country (P17), read with the Wikidata API and checked against the item's labels by `scripts/check-grounds.mjs` | Wikidata's data is CC0 (https://creativecommons.org/publicdomain/zero/1.0/) |
|
|
45
45
|
| `arenas`: each arena's names, years, city, seats, rink sizes, Wikidata item and coordinates | The infobox and the text of the English Wikipedia article of each arena, at the revision cited below (the names with the years the article dates them, the year it opened, closed and was pulled down, the seats for ice hockey and for basketball, a rink's length and width where the article gives them in a sentence of its own); the name in Japanese from the title of its Japanese article or written for the package; the Wikidata item (CC0) that each article is linked to and its coordinates (P625) | 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 |
|
|
46
|
+
| `venues`: the outline of each NHL arena's building, how its rink lies in it and the building's height (`VENUE_OSM`, `src/venues.osm.data.ts`) | OpenStreetMap, through the Overpass API: the closed way tagged with the venue's Wikidata item (and the ice, where it is mapped), read on 2026-10-20, with the raw answers kept in `data-sources/venues/2026-10-20/`; the outline is simplified to a metre, and the way the rink lies is worked out from it (`coreOf`, `src/venues.geo.ts`) | ODbL 1.0, (c) OpenStreetMap contributors (https://www.openstreetmap.org/copyright): a derived database, kept in its own file and offered under the ODbL; a drawing made from it is a produced work and carries the credit (`VENUE_ATTRIBUTION`) |
|
|
47
|
+
| `venues`: each venue's seats for ice hockey, number of seating tiers and kind of roof (`VENUE_DATA`, `src/venues.data.ts`) | The item of Wikidata (the capacity P1083 and the sport it applies to P641) and the English Wikipedia article of each arena, at the revision cited below, in `data-sources/venues/2026-10-20/` as read; the facts are numbers and words of our own, with what was read in a few words | Wikidata's data is CC0; the facts read from the articles are facts, with the articles credited here (CC BY-SA 4.0) |
|
|
48
|
+
| `stadiums`: the outline of each stadium's building, the roof OpenStreetMap maps over it (its heights and the opening in it) and how the field lies, worked out from the opening (`STADIUM_OSM`, `src/stadiums.osm.data.ts`) | OpenStreetMap, through the Overpass API: the closed way tagged with the stadium's Wikidata item and the multipolygon of its roof, read on 2026-10-20, with the raw answers kept in `data-sources/stadiums/2026-10-20/`; the outline is simplified to a metre, and the way the field lies is worked out from the opening (`smallestBox`, `src/venues.geo.ts`) | ODbL 1.0, (c) OpenStreetMap contributors (https://www.openstreetmap.org/copyright): a derived database, kept in its own file and offered under the ODbL; a drawing made from it is a produced work and carries the credit (`VENUE_ATTRIBUTION`) |
|
|
49
|
+
| `stadiums`: each stadium's seats for each configuration, number of seating bowls, kind of roof and the size of its opening (`STADIUM_DATA`, `src/stadiums.data.ts`) | The item of Wikidata (the capacity P1083) and the English Wikipedia article of each stadium, at the revision cited below, in `data-sources/stadiums/2026-10-20/` as read; the facts are numbers and words of our own, with what was read in a few words | Wikidata's data is CC0; the facts read from the article are facts, with the article credited here (CC BY-SA 4.0) |
|
|
46
50
|
| `atlas`: the clubs that played in each park, ground and arena (`tenants`: the club, its Wikidata item, its league, the years) | The occupants (P466) and home venues (P115) Wikidata lists for each place, with the start (P580) and end (P582) times of each statement, and the clubs' labels in English and Japanese, sports (P641) and leagues (P118), read with the Wikidata API and query service by `scripts/fetch-tenants.mjs` into `scripts/tenants.wikidata.json`; and the `tenants` line of the infobox of each place's English Wikipedia article, at the revision that `source.wikipedia` names for each club (155 articles, read on 2026-10-13) | Facts. Wikidata's data is CC0 (https://creativecommons.org/publicdomain/zero/1.0/), and the articles are CC BY-SA 4.0 as above; the names of clubs and the years are facts, no text, table or image of an article is used. Which clubs are tenants, and the league each is filed under, are our reading, in docs/atlas.md ("Tenants") |
|
|
47
51
|
| `parks`: the walls, quirks, backstop, warning track, dugouts and extra points of a ballpark (`walls`, `quirks`, `backstop_ft`, `track_ft`, `dugouts`, `labels`) | The infobox and the text of the same English article of each park, at the same revision as its fence (the Japanese article for the heights of the walls of the parks of Japan): the height of the wall along a stretch of the fence and the seasons it stood, the hill, overhang, poles, bullpens, ivy and basket the text describes with figures, the infobox's backstop distance, the warning track's width, the sides of the dugouts, and the further distances the text gives (Wrigley Field's wells, Sportsman's Park's and Milwaukee County Stadium's markers). The stretch each figure covers and the angle of each extra point are our reading of the article's words | 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 |
|
|
48
52
|
| `parks`: the coordinates of each ballpark (`lat`, `lon`) and the years it opened and closed (`opened`, `closed`) | The item's coordinate location (P625), its date of official opening or inception (P1619, P571) and of official closure or dissolution (P3999, P576), read with the Wikidata API by `scripts/fetch-park-coordinates.mjs` and checked by `scripts/check-parks.mjs` (ES CON Field's opening, 2023, is read from its article) | Wikidata's data is CC0 (https://creativecommons.org/publicdomain/zero/1.0/) |
|
|
@@ -405,6 +409,29 @@ The Japanese Wikipedia articles read for the names, with their revisions, are li
|
|
|
405
409
|
| Verdun Auditorium | Q2870805 | Verdun Auditorium, 1372712513 |
|
|
406
410
|
| Rhode Island Auditorium | Q7320897 | Rhode Island Auditorium, 1373848518 |
|
|
407
411
|
|
|
412
|
+
## The venues' sources
|
|
413
|
+
|
|
414
|
+
The eight arenas of the NHL's Pacific Division, read on 2026-10-20 (`pnpm venues:fetch`; the files are in `data-sources/venues/2026-10-20/`: `osm-<arena>.json` as Overpass returned them, `wikidata.json` and `wikipedia.json`). The outline of a building is OpenStreetMap's, ODbL 1.0, (c) OpenStreetMap contributors, and lives in `src/venues.osm.data.ts` alone. The seats, the tiers and the roof are in `src/venues.data.ts`, with what each cites. No seat map of a team, a ticket seller or a venue is read or copied, and no mark of a team or a league is drawn.
|
|
415
|
+
|
|
416
|
+
| Arena | Wikidata item | OpenStreetMap way | English article and revision |
|
|
417
|
+
| --- | --- | --- | --- |
|
|
418
|
+
| Honda Center | Q774138 | way/120623151 | Honda Center, 1380000927 |
|
|
419
|
+
| Scotiabank Saddledome | Q1140083 | way/4397328 | Scotiabank Saddledome, 1377341466 |
|
|
420
|
+
| Rogers Place | Q5339036 | way/448626254 | Rogers Place, 1380110483 |
|
|
421
|
+
| Crypto.com Arena | Q186080 | way/428021739 | Crypto.com Arena, 1380458624 |
|
|
422
|
+
| SAP Center | Q261863 | way/24169210 | SAP Center, 1380804230 |
|
|
423
|
+
| Climate Pledge Arena | Q977529 | way/25123756 | Climate Pledge Arena, 1380851727 |
|
|
424
|
+
| Rogers Arena | Q517318 | way/24705911 | Rogers Arena, 1379918849 |
|
|
425
|
+
| T-Mobile Arena | Q3338973 | way/364489406 | T-Mobile Arena, 1379155307 |
|
|
426
|
+
|
|
427
|
+
## The stadiums' sources
|
|
428
|
+
|
|
429
|
+
BC Place, read on 2026-10-20 (`pnpm stadiums:fetch`; the files are in `data-sources/stadiums/2026-10-20/`: `osm-<stadium>.json` as Overpass returned it, `wikidata.json` and `wikipedia.json`). The outline of the building, its roof and the opening in it are OpenStreetMap's, ODbL 1.0, (c) OpenStreetMap contributors, and live in `src/stadiums.osm.data.ts` alone. The seats of each configuration, the bowls, the roof's kind and the size of its opening are in `src/stadiums.data.ts`, with what each cites. No seat map of a club, a ticket seller or a federation is read or copied, and no mark of a club, a league or a tournament is drawn.
|
|
430
|
+
|
|
431
|
+
| Stadium | Wikidata item | OpenStreetMap way | English article and revision |
|
|
432
|
+
| --- | --- | --- | --- |
|
|
433
|
+
| BC Place | Q612227 | way/24705904 | BC Place, 1372065649 |
|
|
434
|
+
|
|
408
435
|
## The World Cups' articles
|
|
409
436
|
|
|
410
437
|
The grounds each World Cup used, and where its final was played, were read from the venue section of the tournament's English Wikipedia article at the revision named (32 tournaments), by the same address. FIFA's own pages are not used.
|
package/README.md
CHANGED
|
@@ -72,46 +72,45 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
72
72
|
|
|
73
73
|
## Features
|
|
74
74
|
|
|
75
|
-
- **Forty-three surfaces, to scale.** The NFL, CFL and IFAF fields, the NHL rink, the NBA court,
|
|
75
|
+
- **Forty-three surfaces, to scale.** The NFL, CFL and IFAF fields, the NHL rink, the NBA court, soccer, baseball, curling, twelve net and racket sports, the pools, athletics, skating, seven field sports, the budō, the MMA cage, the rings and the mats. 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 and the IIHF to Little League, softball, rugby league and 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 and stained keys, the baskets with soft shadows, and benches. 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, courtside rows or a ballpark's grandstands, with the people as seeded heads
|
|
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
|
|
80
|
-
- **Net, racket and court sports, from their rulebooks.** The ITF's, FIVB's
|
|
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 in the home colours and the empty seats showing. `crowd: { real: true }` puts an NHL arena, or BC Place, in its building's outline (OpenStreetMap) with a plausible bowl, never a seat map. [The crowd](./docs/crowd.md), [venues](./docs/venues.md), [stadiums](./docs/stadiums.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 an end's stones, `show: "folded"` for both houses enlarged. [Curling](./docs/curling.md).
|
|
80
|
+
- **Net, racket and court sports, from their rulebooks.** The ITF's, FIVB's, BWF's, USA Pickleball's and ITTF's courts and table, and padel, squash, racquetball, sepak takraw, teqball, roundnet and netball, each in its look, with a board of sets and games. [Net, racket and court sports](./docs/courts.md).
|
|
81
81
|
- **Swimming, water polo, diving and artistic swimming, from World Aquatics' regulations.** The 50 or 25 m pool with its lanes, ropes, blocks and touch panels; the water polo field; the diving well; the artistic swimming area. [Pools](./docs/pools.md).
|
|
82
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. [Field sports](./docs/field-sports.md).
|
|
83
|
-
- **The athletics stadium, from World Athletics' rules.** The 400 m track with its lanes and staggers worked out from the running lines, every race start, hurdles, the steeplechase and
|
|
84
|
-
- **The skating rinks, from the ISU's rules.** The 400 m speed skating track with
|
|
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**:
|
|
83
|
+
- **The athletics stadium, from World Athletics' rules.** The 400 m track with its lanes and staggers worked out from the running lines, every race start, hurdles, the steeplechase and the field events, with lane draws, results and a race replay. [The athletics stadium](./docs/athletics.md).
|
|
84
|
+
- **The skating rinks, from the ISU's rules.** The 400 m speed skating track with each race's lines worked out lane by lane; the short track's oval; the figure skating rink; and results, a race replay and a programme's elements. [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**: tatami laid as real units, with its walls, doors, windows and shrine. [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 from international to 5-a-side, half pitches, five mowing patterns and four goal styles. [Soccer](./docs/soccer.md).
|
|
87
|
-
- **Every ballpark.** The 30 current MLB parks and 44 that MLB clubs have left, 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, as it stood in a season. [Ballparks](./docs/ballparks.md).
|
|
88
|
-
- **Soccer grounds, arenas and an atlas.** 64 soccer grounds at their published sizes, 167 NHL, NBA, WNBA and PWHL arenas (`drawKyogijo({ sport: "nhl", arena: "boston-garden" })`), and
|
|
89
|
-
- **
|
|
90
|
-
- **Special games.** A surface set inside another, to scale: an NHL rink on a ballpark's infield or a football stadium's field or a baseball field laid over a London stadium's pitch. 18 games, each cited. [Special games](./docs/special-games.md).
|
|
87
|
+
- **Every ballpark.** The 30 current MLB parks and 44 that MLB clubs have left, 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, as it stood in a season, with its walls and quirks (`walls`, `quirks`), none guessed. [Ballparks](./docs/ballparks.md).
|
|
88
|
+
- **Soccer grounds, arenas and an atlas.** 64 soccer grounds at their published sizes, 167 NHL, NBA, WNBA and PWHL arenas (`drawKyogijo({ sport: "nhl", arena: "boston-garden" })`), and 330 places on a map, found by any of their names. [Grounds](./docs/grounds.md), [arenas](./docs/arenas.md), [atlas](./docs/atlas.md), [names](./docs/ballparks.md#names).
|
|
89
|
+
- **Special games.** A surface set inside another, to scale: an NHL rink on a ballpark's infield, a baseball field over a London stadium's pitch. 18 games, each cited. [Special games](./docs/special-games.md).
|
|
91
90
|
- **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 (
|
|
91
|
+
- **Score mode.** Each team's name and logo on its side (end zones, ends of the ice, halves of the court, dugouts) and the score large in the middle, with the competition, status and date, and the winner emphasised. [Score and layout](./docs/score.md#round-marks).
|
|
93
92
|
- **The situation of a game.** `situation` draws what is happening: hockey's power play and shootout, baseball's runners and count, football's line of scrimmage, first-down line, red zone and down and distance, with a drive chart. [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
|
|
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
|
|
96
|
-
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports](https://johnmorrisdotca.github.io/dougu-sports/)
|
|
93
|
+
- **Lineups.** A `lineup` layer places a team's players by position code (`GK`, `CB`, `HK`, `C`) with no coordinates, from a formation (36, in 13 sports), as a disc or a jersey with the number, the name, a captain's C and a flag. [Lineups](./docs/team-shape.md#lineups).
|
|
94
|
+
- **A pageant.** Each team's flag or crest laid large over its half of the surface: `pageant: "carpet"` (a flag at its own ratio) or `"stage"` (a crest on a round disc), an emblem or a trophy in the centre circle, the score in the middle or in the strip. [The pageant](./docs/pageant.md).
|
|
95
|
+
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports](https://johnmorrisdotca.github.io/dougu-sports/), and an id goes wherever a logo, a flag or a mark is taken: `logo: "crest:shield"`, `"ball:puck"`. [Emblems](./docs/emblems.md).
|
|
97
96
|
- **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. [Flags](./docs/flags.md).
|
|
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 penalty area, the infield, a
|
|
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
|
|
100
|
-
- **Where a point lies, by the rules, and a click as a place.** `zoneAt("nhl", [69, 22], { frame: "nhl-api" })` names the zone from the surface's own figures
|
|
97
|
+
- **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 penalty area, the infield, a house, or a box of your own. [Display ranges](./docs/ranges.md).
|
|
98
|
+
- **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; `orientation: "auto"` follows the box.
|
|
99
|
+
- **Where a point lies, by the rules, and a click as a place.** `zoneAt("nhl", [69, 22], { frame: "nhl-api" })` names the zone from the surface's own figures; `clientPointToField` is a pointer's place in any frame. [Zones](./docs/zones.md), [pointing](./docs/pointer.md).
|
|
101
100
|
- **Goals, the strike zone and the stumps, end-on.** A goal mouth for six sports with the shots laid on it, the catcher's view of the strike zone with its pitches numbered, and the wicket from the bowler's end with its zones. [Targets](./docs/targets.md).
|
|
102
101
|
- **Data on the surface.** Points, lines, arrows, text, heat maps, hexagons and density contours over any surface, in its own feet or a provider's frame; ready-made shot and pass charts. [Data layers](./docs/layers.md), [charts](./docs/charts.md).
|
|
103
|
-
- **Small multiples and backgrounds.** `drawGrid` puts many drawings in one SVG with a title, a shared key and a credit line,
|
|
104
|
-
- **Tournament layouts.** Several surfaces laid out
|
|
102
|
+
- **Small multiples and backgrounds.** `drawGrid` puts many drawings in one SVG with a title, a shared key and a credit line, for a card or a phone; `background` lays a pattern or a photograph behind them. [Layouts and backgrounds](./docs/layouts.md).
|
|
103
|
+
- **Tournament layouts.** Several surfaces laid out for one event, to scale, as one SVG: thirteen presets, each with its rule and sources, and a stadium round it. [Tournament layouts](./docs/multi.md).
|
|
105
104
|
- **Judging assignments.** Who judges where. [Judging](./docs/judging.md). **Boards over a surface.** [Boards](./docs/boards.md).
|
|
106
|
-
- **Replay.** Tracking data played on any surface: the players, the ball and its trail, and the passes, shots and goals as they happen, with controls
|
|
107
|
-
- **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
|
|
108
|
-
- **Renderers.** The same drawing as plain data (a scene), on a canvas
|
|
109
|
-
- **Units and frames.** Each surface in its rulebook's unit and any other, and 48 coordinate frames (ten soccer providers, the NHL API, NBA stats, NFL tracking, MLBAM and more)
|
|
105
|
+
- **Replay.** Tracking data played on any surface: the players, the ball and its trail, and the passes, shots and goals as they happen, with controls and the keyboard. [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 stands on it at its height (nets, baskets, goals, a cage's mesh) and the venue round it (raked stands, roofs, walls). [The 3D view](./docs/turn.md).
|
|
107
|
+
- **Renderers.** The same drawing as plain data (a scene), on a canvas, in a d3 selection, as an Observable Plot mark, as GeoJSON and as a PNG in Node, each an entry of its own. [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, NBA stats, NFL tracking, MLBAM and more) for a provider's points. [Units](./docs/units.md), [coordinate frames](./docs/frames.md).
|
|
110
109
|
- **A compact badge and a compact card.** One strip for a list, or the surface with that strip under it.
|
|
111
|
-
- **Light and dark**, by the device or the page; every colour a custom property; eight named looks, colours by feature, line widths and dashes,
|
|
110
|
+
- **Light and dark**, by the device or the page; every colour a custom property; eight named looks, colours by feature, line widths and dashes, arrows, axes and labels. [Theming](./docs/theming.md), [annotations](./docs/annotations.md).
|
|
112
111
|
- **Accessible.** Each drawing is an `img` with a title and a description of the surface and the result, in English or Japanese. [Accessibility](./docs/accessibility.md).
|
|
113
112
|
- **Four ways in.** A function that returns SVG text; a helper that draws into a container; a custom element; a frame for pages with no script; a React helper that imports no React.
|
|
114
|
-
- **No dependencies**, no network requests, nothing stored. Text, colours and logo addresses
|
|
113
|
+
- **No dependencies**, no network requests, nothing stored. Text, colours and logo addresses from outside are made safe.
|
|
115
114
|
- **A docs site.** Guides, a search, a gallery that draws every picture from the code beside it, and [how it compares](./docs/compare.md): [the documentation](./docs/README.md).
|
|
116
115
|
|
|
117
116
|
### What's in it
|
|
@@ -123,17 +122,14 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
123
122
|
| `SOCCER_PITCHES`, `SOCCER_PROVIDERS`, `rescale`, `soccerSpec` | The soccer pitches, the data providers' coordinate systems and the map between them. |
|
|
124
123
|
| `GROUNDS`, `groundById` | The 64 soccer grounds, each pitch at its own size. |
|
|
125
124
|
| `EVENTS`, `eventOptions` | The 18 special games: a rink in a ballpark, a court on a carrier's deck. |
|
|
126
|
-
| `./zones`, `./pointer`, `./target` | Where a point lies by a sport's own rules
|
|
127
|
-
| `./geometry`, `./frames`, `./layers`, `./charts`, `./replay` | The dimensions in any unit; the providers' frames; data layers;
|
|
128
|
-
| `./athletics` | The athletics stadium
|
|
129
|
-
| `./
|
|
130
|
-
| `./
|
|
131
|
-
| `./parks`, `./grounds`, `./arenas`, `./atlas`, `./eras`, `./leagues`, `./events` | The ballparks, the grounds, the arenas, every place, the markings of a season, each league's rulebook, the special games. |
|
|
125
|
+
| `./zones`, `./pointer`, `./target` | Where a point lies by a sport's own rules; a click as a place in a provider's numbers; a goal, the strike zone or the stumps end-on. |
|
|
126
|
+
| `./geometry`, `./frames`, `./layers`, `./charts`, `./replay` | The dimensions in any unit; the providers' frames; data layers; charts; tracking data played on a surface. |
|
|
127
|
+
| `./athletics`, `./budo`, `./skating` | The athletics stadium, the budō (areas, dohyō, kyūdōjō, the dojo builder `drawDojo`, the 82 kimarite) and the skating rinks: plans, races and charts. |
|
|
128
|
+
| `./parks`, `./grounds`, `./arenas`, `./atlas`, `./eras`, `./leagues`, `./events` | The ballparks, grounds, arenas, every place, a season's markings, each league's rulebook, the special games. |
|
|
129
|
+
| `./venues`, `./stadiums`, `./district` | Real arenas and stadiums in their buildings' outlines; districts of venues on one plan. |
|
|
132
130
|
| `./turn` | A surface as a 3D view that turns, with the net, basket, goal or posts standing on it. |
|
|
133
|
-
| `./scene`, `./canvas`, `./d3`, `./plot`, `./geojson`, `./png` | The drawing as data
|
|
134
|
-
| `./multi` | `drawMulti
|
|
135
|
-
| `./judging` | `drawJudging`, `judgingBoard`, `mountJudgingBroadcast`, `judgingPrint`: who judges where, as a plan, on a broadcast board or on paper ([docs](./docs/judging.md)). |
|
|
136
|
-
| `./layouts` | `drawGrid` and `GRID_PRESETS`: small multiples with a title, a subtitle, a key and a credit line; the grounds behind a drawing or a grid. |
|
|
131
|
+
| `./scene`, `./canvas`, `./d3`, `./plot`, `./geojson`, `./png` | The drawing as data, on a canvas, in d3, as an Observable Plot mark, as GeoJSON, as a PNG (the optional peer `@resvg/resvg-js`). |
|
|
132
|
+
| `./multi`, `./judging`, `./layouts` | `drawMulti` (several surfaces for one event, [docs](./docs/multi.md), [demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/halls.html)); `drawJudging` (who judges where, [docs](./docs/judging.md)); `drawGrid` (small multiples, backgrounds). |
|
|
137
133
|
| `./mount`, `./react`, `./element`, `./element/define` | Draw into a container; React props; the `<kyogijo-field>` element and its registration. |
|
|
138
134
|
|
|
139
135
|
The full list of entry points is in [entry points](./docs/entry-points.md); every export is in the [API reference](https://johnmorrisdotca.github.io/kyogijo-stadiums/api.html).
|
|
@@ -148,7 +144,7 @@ npm install @johnmorrisdotca/kyogijo-stadiums
|
|
|
148
144
|
# or: yarn add @johnmorrisdotca/kyogijo-stadiums
|
|
149
145
|
```
|
|
150
146
|
|
|
151
|
-
It needs Node 22 or later on a server, and any current browser. It is plain ES modules, with types
|
|
147
|
+
It needs Node 22 or later on a server, and any current browser. It is plain ES modules, with types, and on the CDNs once on npm: `https://cdn.jsdelivr.net/npm/@johnmorrisdotca/kyogijo-stadiums@0/+esm` is the package as one module for the browser.
|
|
152
148
|
|
|
153
149
|
### Four ways in
|
|
154
150
|
|
|
@@ -183,7 +179,7 @@ console.log(svg.includes("Cup Final, Game 7"), svg.includes("Final/OT"));
|
|
|
183
179
|
<p align="center">
|
|
184
180
|
<picture>
|
|
185
181
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-dark.webp">
|
|
186
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-light.webp" alt="A football field drawn wide
|
|
182
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-light.webp" alt="A football field drawn wide under floodlight beams: Mexico's green end zone on the left with its flag and name, the USA's navy one on the right, the yard lines and numbers between, and the score panel at midfield reading 27 to 24." width="720">
|
|
187
183
|
</picture>
|
|
188
184
|
<br><em>A football field: the end zones in the teams' colours, the score at midfield.</em>
|
|
189
185
|
</p>
|
|
@@ -263,7 +259,7 @@ console.log(svg.includes("甲子園球場のグラウンド"), svg.includes("阪
|
|
|
263
259
|
<p align="center">
|
|
264
260
|
<picture>
|
|
265
261
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/ballpark-desk-dark.webp">
|
|
266
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/ballpark-desk-light.webp" alt="The baseball field of Hanshin Koshien Stadium on
|
|
262
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/ballpark-desk-light.webp" alt="The baseball field of Hanshin Koshien Stadium on royal purple: the outfield fence at its published distances, 95 metres at the lines and 118 in the alleys, the infield dirt, and a red and a navy dugout panel with Japan's and the USA's flags." width="640">
|
|
267
263
|
</picture>
|
|
268
264
|
<br><em>A ballpark's fence, drawn through the distances its article publishes.</em>
|
|
269
265
|
</p>
|
|
@@ -322,7 +318,7 @@ console.log(/viewBox="0 0 440 64"/.test(badge));
|
|
|
322
318
|
<p align="center">
|
|
323
319
|
<picture>
|
|
324
320
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-dark.webp">
|
|
325
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-light.webp" alt="
|
|
321
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-light.webp" alt="Eight score strips in the demo on a midnight-blue background, each with a team block, flag, short name and score at each end, and in the middle a small picture of the sport and the state of the game, such as Final or 2nd period." width="640">
|
|
326
322
|
</picture>
|
|
327
323
|
<br><em>Badges for a list of games.</em>
|
|
328
324
|
</p>
|
|
@@ -343,7 +339,7 @@ console.log(svg.includes("--ky-key:#1e4f8f"), svg.includes("METRO BOLTS"));
|
|
|
343
339
|
<p align="center">
|
|
344
340
|
<picture>
|
|
345
341
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/court-desk-dark.webp">
|
|
346
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/court-desk-light.webp" alt="A basketball court in the two-tone look, in a warm glow: a pale floor with a deep blue key, centre circle and border,
|
|
342
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/court-desk-light.webp" alt="A basketball court in the two-tone look, in a warm glow: a pale floor with a deep blue key, centre circle and border, AUSTRALIA and JAPAN along the baselines, each flag and name on its half, and the score panel at centre court reading 108 to 112." width="640">
|
|
347
343
|
</picture>
|
|
348
344
|
<br><em>A court in a look of its own: the paint, the border and the words on the baselines are options.</em>
|
|
349
345
|
</p>
|
|
@@ -368,7 +364,7 @@ console.log(items.map((item) => item.kind).join(), html.includes("preserve-3d"))
|
|
|
368
364
|
// net,netposts,antennae false
|
|
369
365
|
```
|
|
370
366
|
|
|
371
|
-
The flat drawing is the floor, turned by a drag, a swipe, the keys or four viewpoints, with what the rulebook stands on it at its height; each part is one `matrix3d
|
|
367
|
+
The flat drawing is the floor, turned by a drag, a swipe, the keys or four viewpoints, with what the rulebook stands on it at its height; each part is one `matrix3d`. In the element: `<kyogijo-field sport="nhl" turn turn-view="broadcast">`. [The 3D view](./docs/turn.md).
|
|
372
368
|
|
|
373
369
|
<p align="center">
|
|
374
370
|
<picture>
|
|
@@ -477,7 +473,7 @@ console.log(zone.includes('data-range="offensive-zone"'), zone.includes("Shows o
|
|
|
477
473
|
// true true
|
|
478
474
|
```
|
|
479
475
|
|
|
480
|
-
Lines, arrows, text, heat maps, hexagons, zones and contours are in [data layers](./docs/layers.md); shot, spray and pass charts
|
|
476
|
+
Lines, arrows, text, heat maps, hexagons, zones and contours are in [data layers](./docs/layers.md); shot, spray and pass charts in [charts](./docs/charts.md); pass networks, formations, lineups, Voronoi cells and flow fields are layers too ([team shape](./docs/team-shape.md)).
|
|
481
477
|
|
|
482
478
|
### Small multiples on a card
|
|
483
479
|
|
|
@@ -496,7 +492,7 @@ console.log(svg.includes('viewBox="0 0 1200 675"'), svg.includes("Three ballpark
|
|
|
496
492
|
|
|
497
493
|
### Several surfaces on one floor
|
|
498
494
|
|
|
499
|
-
`drawMulti` lays the package's own surfaces out
|
|
495
|
+
`drawMulti` lays the package's own surfaces out for one large event, to scale, on one floor, with the officials' chairs and boards and places for the event's words (`sample: true` fills them with an invented event; [tournament layouts](./docs/multi.md)). `multiFit` says whether it fits a hall, `stadium: true` sets it inside stands, `mountMultiTurn` turns it in 3D.
|
|
500
496
|
|
|
501
497
|
```ts
|
|
502
498
|
import { drawMulti, multiLayout } from "@johnmorrisdotca/kyogijo-stadiums/multi";
|
|
@@ -541,8 +537,6 @@ console.log(layout.needs.length, layout.needs.width);
|
|
|
541
537
|
<br><em>Without `sample`: the empty places an organiser fills.</em>
|
|
542
538
|
</p>
|
|
543
539
|
|
|
544
|
-
The [demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/halls.html) turns it in 3D.
|
|
545
|
-
|
|
546
540
|
### Boards over a surface
|
|
547
541
|
|
|
548
542
|
`board` lays a results board, a bout presentation or a medal table, any SVG, over a surface in 2D and 3D, off its middle and never stretched ([boards](./docs/boards.md)).
|
|
@@ -571,6 +565,46 @@ The [demo](https://johnmorrisdotca.github.io/kyogijo-stadiums/halls.html) turns
|
|
|
571
565
|
<br><em>A medal table in a corner.</em>
|
|
572
566
|
</p>
|
|
573
567
|
|
|
568
|
+
### The real venues
|
|
569
|
+
|
|
570
|
+
`crowd: { real: true }` draws an NHL arena in its building ([the real venues](./docs/venues.md)).
|
|
571
|
+
|
|
572
|
+
<p align="center">
|
|
573
|
+
<picture>
|
|
574
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/venues-honda-desk-dark.webp">
|
|
575
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/venues-honda-desk-light.webp" alt="The Honda Center's rink in its building's outline: two tiers of seats and a north arrow." width="640">
|
|
576
|
+
</picture>
|
|
577
|
+
<br><em>The Honda Center.</em>
|
|
578
|
+
</p>
|
|
579
|
+
|
|
580
|
+
<p align="center">
|
|
581
|
+
<picture>
|
|
582
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/venues-saddledome-3d-desk-dark.webp">
|
|
583
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/venues-saddledome-3d-desk-light.webp" alt="The Saddledome in 3D: two tiers of seats under its roof." width="640">
|
|
584
|
+
</picture>
|
|
585
|
+
<br><em>The Saddledome, in 3D.</em>
|
|
586
|
+
</p>
|
|
587
|
+
|
|
588
|
+
### A real stadium, and a district
|
|
589
|
+
|
|
590
|
+
`stadium: "bc-place"` draws BC Place for football or soccer under its cable roof; `drawDistrict({ venues: ["bc-place", "rogers-arena"] })` puts venues at their real positions, to turn together in 3D ([districts](./docs/district.md)).
|
|
591
|
+
|
|
592
|
+
<p align="center">
|
|
593
|
+
<picture>
|
|
594
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/stadiums-bc-place-3d-desk-dark.webp">
|
|
595
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/stadiums-bc-place-3d-desk-light.webp" alt="BC Place's soccer pitch in 3D: two bowls of seats under a cable-supported roof with an opening." width="640">
|
|
596
|
+
</picture>
|
|
597
|
+
<br><em>BC Place, in 3D.</em>
|
|
598
|
+
</p>
|
|
599
|
+
|
|
600
|
+
<p align="center">
|
|
601
|
+
<picture>
|
|
602
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/district-bc-rogers-3d-desk-dark.webp">
|
|
603
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/district-bc-rogers-3d-desk-light.webp" alt="BC Place and Rogers Arena in 3D on one ground with a grid, a scale and a north arrow." width="640">
|
|
604
|
+
</picture>
|
|
605
|
+
<br><em>BC Place and Rogers Arena.</em>
|
|
606
|
+
</p>
|
|
607
|
+
|
|
574
608
|
### Who judges where
|
|
575
609
|
|
|
576
610
|
`drawJudging` puts each judo mat's officials by seat in the picture and in a chart ([judging](./docs/judging.md)).
|
|
@@ -748,13 +782,13 @@ A page that moves (`mountKyogijo`), a file written on a server and a frame for a
|
|
|
748
782
|
|
|
749
783
|
## API
|
|
750
784
|
|
|
751
|
-
The [API reference](https://johnmorrisdotca.github.io/kyogijo-stadiums/api.html) lists every export of every entry point with its signature and
|
|
785
|
+
The [API reference](https://johnmorrisdotca.github.io/kyogijo-stadiums/api.html) lists every export of every entry point with its signature and doc comment, made from the source by `pnpm site`. [Entry points](./docs/entry-points.md) says what each holds: the main one draws, the data and geometry ones stand apart, and `/mount`, `/turn`, `/react`, `/element` and `/element/define` put a drawing in a page.
|
|
752
786
|
|
|
753
787
|
Every function is pure: it returns new values and never changes what it was given.
|
|
754
788
|
|
|
755
789
|
## Theming
|
|
756
790
|
|
|
757
|
-
Nothing is branded. The drawing is coloured by custom properties on its `svg`, with a light set and a dark set that follow the device (or `data-theme
|
|
791
|
+
Nothing is branded. The drawing is coloured by custom properties on its `svg`, with a light set and a dark set that follow the device (or `data-theme`, or `theme` in the options); a page's own rule always wins. Each property is listed in [theming](./docs/theming.md).
|
|
758
792
|
|
|
759
793
|
## Limits
|
|
760
794
|
|
|
@@ -764,40 +798,41 @@ Each is held by a test: forty-three sports, ten soccer pitches and ten providers
|
|
|
764
798
|
|
|
765
799
|
- Each drawing is an `img` with a `<title>` and a `<desc>` that say the teams, the score, the surface and the result, in English or Japanese.
|
|
766
800
|
- A score is also text, words stay upright when the surface lies tall, colour is never the only sign, and each data layer has a table for a screen reader.
|
|
767
|
-
- Nothing moves by itself: a replay plays when asked, steps for a reader who prefers reduced motion, and pauses when the page is hidden
|
|
801
|
+
- Nothing moves by itself: a replay plays when asked, steps for a reader who prefers reduced motion, and pauses when the page is hidden.
|
|
768
802
|
|
|
769
|
-
The rest
|
|
803
|
+
The rest is in [accessibility](./docs/accessibility.md).
|
|
770
804
|
|
|
771
805
|
## Browser and runtime support
|
|
772
806
|
|
|
773
|
-
Any browser with ES modules, `:where()` and SVG 2's `href` on images: Chrome and Edge 88, Safari 14, Firefox 78, all from 2021 on. The custom element needs shadow DOM and `part`. The drawing function runs on Node 22 or later and in any
|
|
807
|
+
Any browser with ES modules, `:where()` and SVG 2's `href` on images: Chrome and Edge 88, Safari 14, Firefox 78, all from 2021 on. The custom element needs shadow DOM and `part`. The drawing function runs on Node 22 or later and in any runtime: it touches no DOM. The demo is played in Chromium and WebKit, at a phone's width and a desk's, before every release.
|
|
774
808
|
|
|
775
809
|
## Languages
|
|
776
810
|
|
|
777
|
-
English and Japanese: the title, the description and the
|
|
811
|
+
English and Japanese: the title, the description and the statuses of a drawing, the sentence of each change in `eraChanges`, and the demo. The words are listed beside their English in [the Japanese of Kyogijo](./docs/strings-ja.md). Team names, competitions and dates are written as you give them, in any language. Not yet: the Japanese read by a native reader (the demo says so when it is shown).
|
|
778
812
|
|
|
779
813
|
## Roadmap
|
|
780
814
|
|
|
781
815
|
Not here yet, each welcome as an [issue](https://github.com/johnmorrisdotca/kyogijo-stadiums/issues):
|
|
782
816
|
|
|
783
|
-
- **More surfaces**: the FIBA and college courts, the international rink, rugby pitches,
|
|
784
|
-
- **More
|
|
817
|
+
- **More surfaces**: the FIBA and college courts, the international rink, rugby pitches, soccer's beach and street formats.
|
|
818
|
+
- **More real venues**: the other divisions' arenas, then the NBA's, NFL's and MLB's, and more districts.
|
|
819
|
+
- **More parks of the past**: the 19th-century grounds, and the parks whose articles give no distances yet.
|
|
785
820
|
- **More charts on data layers**: a formation chart, a pass sonar chart and a Voronoi chart of their own (the layers exist; see [team shape](./docs/team-shape.md)).
|
|
786
821
|
- **Football in a different standard**: the college and high-school hash marks.
|
|
787
822
|
|
|
788
|
-
Left out on purpose: statistics, rosters and schedules.
|
|
823
|
+
Left out on purpose: statistics, rosters and schedules.
|
|
789
824
|
|
|
790
825
|
## Architecture
|
|
791
826
|
|
|
792
|
-
The drawing is plain functions over plain data with no DOM and no dependency. The dimensions are in one file, the ballparks are generated from a reviewed list, and each surface is a function that returns its markup and the places the teams and the score go. Every entry point stands apart
|
|
827
|
+
The drawing is plain functions over plain data with no DOM and no dependency. The dimensions are in one file, the ballparks are generated from a reviewed list, and each surface is a function that returns its markup and the places the teams and the score go. Every entry point stands apart. The files are in [architecture](./docs/architecture.md).
|
|
793
828
|
|
|
794
829
|
## The name
|
|
795
830
|
|
|
796
|
-
*Kyogijo* (競技場, kyōgijō, きょうぎじょう) is Japanese for a sports ground, the place a contest is held, written with 競技, "contest", and 場, "place"
|
|
831
|
+
*Kyogijo* (競技場, kyōgijō, きょうぎじょう) is Japanese for a sports ground, the place a contest is held, written with 競技, "contest", and 場, "place". "Stadiums" is added in English so that the name says what it draws. The long vowels are written without a macron, as in the other packages of the family.
|
|
797
832
|
|
|
798
833
|
## Where it comes from, and where it is used
|
|
799
834
|
|
|
800
|
-
Kyogijo Stadiums was made for [SPX Stats](https://spxn.com), the historical record of the NHL, NBA, MLB, NFL and CFL, to show the score of a game or a championship on the surface it was played on, with each team's name and logo at its side. Its Japanese names and
|
|
835
|
+
Kyogijo Stadiums was made for [SPX Stats](https://spxn.com), the historical record of the NHL, NBA, MLB, NFL and CFL, to show the score of a game or a championship on the surface it was played on, with each team's name and logo at its side. Its Japanese names and parks are there because the same author makes a Japanese study app and a site for Japanese board games.
|
|
801
836
|
|
|
802
837
|
### Used by
|
|
803
838
|
|
|
@@ -896,7 +931,7 @@ See [CHANGELOG.md](./CHANGELOG.md). The first release, 0.1.0, draws the twenty s
|
|
|
896
931
|
|
|
897
932
|
## Licence
|
|
898
933
|
|
|
899
|
-
The code is [MIT](./LICENSE) © John Morris. The ballparks' fence distances are facts published in Wikipedia's articles, re-expressed
|
|
934
|
+
The code is [MIT](./LICENSE) © John Morris. The ballparks' fence distances are facts published in Wikipedia's articles, re-expressed as numbers, with each article and revision cited in [NOTICE.md](./NOTICE.md) (shipped in the package) and [docs/references.md](./docs/references.md). The surfaces' dimensions are facts from the rulebooks and diagrams, cited in [docs/sources.md](./docs/sources.md).
|
|
900
935
|
|
|
901
936
|
| Data | Made from | Terms |
|
|
902
937
|
| --- | --- | --- |
|
|
@@ -904,6 +939,7 @@ The code is [MIT](./LICENSE) © John Morris. The ballparks' fence distances are
|
|
|
904
939
|
| The soccer pitch's dimensions and the providers' coordinates | The IFAB and FIFA Futsal Laws of the Game, UEFA, MLS, NCAA and FA documents, and each provider's own pages (docs/sources.md) | Facts; no text or drawing copied |
|
|
905
940
|
| The fence distances of 94 ballparks | The English and Japanese Wikipedia articles of each, at the revision cited | Facts; the articles are CC BY-SA 4.0 and none of their text is used |
|
|
906
941
|
| The Wikidata item of each ballpark | Wikidata, as linked from the cited article | CC0 |
|
|
942
|
+
| The outlines of the real venues and stadiums | OpenStreetMap, read 2026-10-20, kept as returned | ODbL 1.0, (c) OpenStreetMap contributors, in files of their own; a drawing carries the credit |
|
|
907
943
|
| 64 soccer grounds | English Wikipedia articles at the revision cited; Wikidata | Facts; CC BY-SA 4.0 articles, no text used; CC0 |
|
|
908
944
|
| The demo's countries and their logos | The names and codes of real countries; the maple leaf, the sun disc and the roundels are drawn for this package | MIT |
|
|
909
945
|
| The demo's country flags | [Hata](https://github.com/johnmorrisdotca/hata), a development dependency whose flags are loaded into the demo site with its licence and notice; the package itself draws none | MIT, and its flags' own licences in its NOTICE.md |
|
package/dist/crowd.d.ts
CHANGED
|
@@ -26,9 +26,9 @@ export type Outline = {
|
|
|
26
26
|
};
|
|
27
27
|
/** A tier of the stands: a band of seats between two outlines. */
|
|
28
28
|
export interface StandRing {
|
|
29
|
-
/** `lower`, `upper`, `courtside`, `grandstand` or `bleachers`, with the tier's number where a ring has parts. */
|
|
29
|
+
/** `lower`, `middle`, `upper`, `courtside`, `grandstand` or `bleachers`, with the tier's number where a ring has parts. */
|
|
30
30
|
id: string;
|
|
31
|
-
tier: "courtside" | "gallery" | "lower" | "upper" | "grandstand" | "bleachers" | "wall";
|
|
31
|
+
tier: "courtside" | "gallery" | "lower" | "middle" | "upper" | "grandstand" | "bleachers" | "wall";
|
|
32
32
|
/** The band is `region` less `hole` (nothing for a polygon that is the band itself). */
|
|
33
33
|
region: Outline;
|
|
34
34
|
/** Further pieces of the band that are apart from `region` (a ballpark's bleachers either side of the batter's eye). */
|
|
@@ -94,6 +94,50 @@ export interface CrowdStands {
|
|
|
94
94
|
seats: number;
|
|
95
95
|
/** The stands are a hall's gallery (a dojo's balcony): a thin band close to the walls, plain seats, a few neutral people and no sides. */
|
|
96
96
|
gallery?: boolean;
|
|
97
|
+
/** The stands are a real venue's (see `src/venues.ts`): the outline of its building, the way north lies on the page and the roof. */
|
|
98
|
+
real?: RealShell;
|
|
99
|
+
}
|
|
100
|
+
/** The room above a real venue's building that the arrow saying where north is takes, in feet, and how far above the building's box the middle of the arrow stands. */
|
|
101
|
+
export declare const NORTH_ROOM = 60;
|
|
102
|
+
export declare const NORTH_AT = 32;
|
|
103
|
+
/** What a real venue adds to the stands round a surface: the building they stand in, in feet in the wide frame, and the roof over them. */
|
|
104
|
+
export interface RealShell {
|
|
105
|
+
/** The outline of the building, a polygon (OpenStreetMap's, turned so that the rink lies along x). */
|
|
106
|
+
footprint: Pt[];
|
|
107
|
+
/** The hall the stands are in: the bowl's outer wall, a rounded rectangle inside the building, and what the 3D view raises walls and a roof on (the building's annexes, which the outline has, are left as ground). */
|
|
108
|
+
hall: Extract<Outline, {
|
|
109
|
+
kind: "rrect";
|
|
110
|
+
}>;
|
|
111
|
+
/** The way north points on the page, in degrees clockwise from the top; absent where the rink's real orientation is not known. */
|
|
112
|
+
north?: number;
|
|
113
|
+
/** `fixed` is a lid; `saddle` a roof that rises at the two ends and falls at the two sides; `cable` a cable-supported roof with an opening over the surface, which a retractable fabric closes (BC Place's). */
|
|
114
|
+
roof: "fixed" | "saddle" | "cable";
|
|
115
|
+
/** A `cable` roof: how far its crown (the edge of the opening) stands over its rim, in feet, and the opening, a polygon in the drawing's frame over the surface. */
|
|
116
|
+
crown?: {
|
|
117
|
+
rise: number;
|
|
118
|
+
opening: Pt[];
|
|
119
|
+
};
|
|
120
|
+
/** The height of the roof's lowest edge above the surface, in feet. */
|
|
121
|
+
edge: number;
|
|
122
|
+
}
|
|
123
|
+
/** The stands of a real venue, worked out from its building (`venueBowl`): what `layoutOf` takes in place of a sport's usual tiers. */
|
|
124
|
+
export interface RealBowl {
|
|
125
|
+
rings: StandRing[];
|
|
126
|
+
/** How far the first row stands from the surface's edge at each side, in feet (the bench side has more). */
|
|
127
|
+
off: {
|
|
128
|
+
left: number;
|
|
129
|
+
right: number;
|
|
130
|
+
top: number;
|
|
131
|
+
bottom: number;
|
|
132
|
+
};
|
|
133
|
+
/** The ground the venue needs beyond the surface on each side, in feet: the building's, and room for the arrow that says where north is. */
|
|
134
|
+
reach: {
|
|
135
|
+
left: number;
|
|
136
|
+
right: number;
|
|
137
|
+
top: number;
|
|
138
|
+
bottom: number;
|
|
139
|
+
};
|
|
140
|
+
shell: RealShell;
|
|
97
141
|
}
|
|
98
142
|
/** The crowd options read: every part has its value. */
|
|
99
143
|
export interface Crowd {
|
|
@@ -112,6 +156,10 @@ export interface Crowd {
|
|
|
112
156
|
gaps: boolean;
|
|
113
157
|
roof: boolean;
|
|
114
158
|
wallSeats: boolean | undefined;
|
|
159
|
+
/** The stands of the arena's real venue, where the package has one for the `arena` asked for. */
|
|
160
|
+
real: boolean;
|
|
161
|
+
/** Whether the seats are drawn (a real venue's building is, without them, when this is false). */
|
|
162
|
+
stands: boolean;
|
|
115
163
|
detail: "auto" | "fine" | "plain";
|
|
116
164
|
}
|
|
117
165
|
/** The crowd the options ask for, or `undefined` for none. */
|
|
@@ -130,6 +178,8 @@ export declare function rayAt(o: Outline, cx: number, cy: number, a: number): Pt
|
|
|
130
178
|
export declare function outlinePath(o: Outline, reverse?: boolean): string;
|
|
131
179
|
/** An outline as points, for a view that raises the stands: arcs are cut into steps of about 7.5 degrees. */
|
|
132
180
|
export declare function outlinePoints(o: Outline): Pt[];
|
|
181
|
+
/** The area of an outline, in square feet. */
|
|
182
|
+
export declare const areaOfOutline: (o: Outline) => number;
|
|
133
183
|
/** The seats of a band of the stands: its area at a seat's 2 by 2.3 feet. */
|
|
134
184
|
export declare const seatsIn: (region: Outline, hole: Outline | null) => number;
|
|
135
185
|
/** A point of a rounded rectangle and the outward normal there, by its parameter `u` (any real number, taken modulo 8): the four straight sides are the even whole numbers (the top from left to right, the right from top to bottom and so on round) and the four corners the odd ones. Concentric outlines (the same corners' centres) have the same parameter at the points an aisle joins. */
|
|
@@ -139,6 +189,8 @@ export declare function rrectAt(o: Extract<Outline, {
|
|
|
139
189
|
p: Pt;
|
|
140
190
|
n: Pt;
|
|
141
191
|
};
|
|
192
|
+
/** The aisles of a band as lines from its inner edge to its outer. */
|
|
193
|
+
export declare function aislesOf(region: Outline, hole: Outline | null): [Pt, Pt][];
|
|
142
194
|
/** What the layout needs of the options and the surface. */
|
|
143
195
|
export interface LayoutInput {
|
|
144
196
|
sport: Sport;
|
|
@@ -159,6 +211,8 @@ export interface LayoutInput {
|
|
|
159
211
|
rows?: number;
|
|
160
212
|
aisles?: readonly number[];
|
|
161
213
|
};
|
|
214
|
+
/** A real venue's stands in place of the sport's usual tiers (see `venueBowl`). */
|
|
215
|
+
real?: RealBowl;
|
|
162
216
|
/** The ballpark's fence as points on the field, for a ballpark (see `parkLayout`). */
|
|
163
217
|
fence?: readonly Pt[];
|
|
164
218
|
/** The foul lines' length at the poles and the backstop's distance, for a ballpark. */
|
package/dist/crowd.draw.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Crowd, type CrowdStands } from "./crowd.ts";
|
|
1
|
+
import { type Crowd, type CrowdStands, type RealShell } from "./crowd.ts";
|
|
2
2
|
/** The tiles a crowd needs: the home tile, the home tile of the upper tiers (emptier) and the visitors', and the display tiles. */
|
|
3
3
|
export declare function patterns(id: string, crowd: Crowd, density: number, tifo: {
|
|
4
4
|
home: boolean;
|
|
@@ -12,6 +12,8 @@ export interface DrawInput {
|
|
|
12
12
|
fine: boolean;
|
|
13
13
|
ground: string;
|
|
14
14
|
}
|
|
15
|
+
/** The building of a real venue and, where its rink's orientation is known, a small arrow with an N that says where north lies. The N is a path of three strokes, so that no font is needed. */
|
|
16
|
+
export declare function realMarkup(real: RealShell): string;
|
|
15
17
|
/** The stands and the crowd as markup and the defs it uses. The markup is laid over the ground and under the surface. */
|
|
16
18
|
export declare function drawCrowd(stands: CrowdStands, o: DrawInput): {
|
|
17
19
|
defs: string;
|