@johnmorrisdotca/kyogijo-stadiums 0.25.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 +27 -0
- package/NOTICE.md +10 -0
- package/README.md +50 -32
- package/dist/crowd.d.ts +7 -2
- package/dist/crowd.js +1 -1
- 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 +10 -1
- 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/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 +11 -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.style.js +5 -0
- package/dist/types.d.ts +4 -1
- package/dist/venue.d.ts +2 -0
- package/dist/venue.js +1 -1
- package/dist/venue.real.d.ts +6 -1
- package/dist/venue.real.js +56 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +18 -1
package/dist/types.d.ts
CHANGED
|
@@ -287,7 +287,8 @@ export interface CrowdOptions {
|
|
|
287
287
|
/**
|
|
288
288
|
* The stands of the arena's real venue, for an NHL `arena` the package has one of (`VENUES`, `@johnmorrisdotca/kyogijo-stadiums/venues`): the outline of its building from OpenStreetMap, the rink lying along
|
|
289
289
|
* the building as it does in the world (a small arrow says where north is), and a bowl of the number of tiers and the seats the sources give, fitted inside the building, under its kind of roof. An arena with no venue
|
|
290
|
-
* is drawn with the usual stands. Off by default. The drawing needs the credit `VENUE_ATTRIBUTION`. See `docs/venues.md`.
|
|
290
|
+
* is drawn with the usual stands. Off by default. The drawing needs the credit `VENUE_ATTRIBUTION`. See `docs/venues.md`. The same for a football field (`sport: "cfl"`) or a soccer pitch in a real stadium (`stadium`, or a `ground` that is one;
|
|
291
|
+
* `docs/stadiums.md`): the building, the field lying in it and a bowl of the configuration's seats.
|
|
291
292
|
*/
|
|
292
293
|
real?: boolean;
|
|
293
294
|
/** `false` draws no seats: of a real venue (`real`) only its building and the arrow that says where north is, which is what the floor of the 3D view needs under the stands it raises. On by default. */
|
|
@@ -684,6 +685,8 @@ export interface SurfaceOptions {
|
|
|
684
685
|
pitch?: SoccerPitchId | SoccerSize;
|
|
685
686
|
/** The soccer ground to draw: a key of `GROUNDS`. The pitch has the size its article publishes (the international 105 by 68 m where none is), and the drawing carries the ground's name for `year`. A `pitch` of your own wins over the ground's size. */
|
|
686
687
|
ground?: string;
|
|
688
|
+
/** The stadium to draw a football field (`sport: "cfl"`) or a soccer pitch in, for `crowd: { real: true }`: a key of `STADIUMS` (`bc-place`). A soccer drawing with a `ground` that is a stadium of `STADIUMS` needs no other. */
|
|
689
|
+
stadium?: string;
|
|
687
690
|
/** The arena to draw an NHL rink or an NBA court of: a key of `ARENAS`. The rink or the court has the size its sources publish where that differs from the league's (the league's where none does), the markings are those of `year`, and the drawing carries the arena's name for `year`. A `league` of your own wins over the arena's size. */
|
|
688
691
|
arena?: string;
|
|
689
692
|
/** Draw a soccer pitch in a data provider's own coordinates (`opta`, `statsbomb`, `wyscout`, `tracab`, `metrica`, `skillcorner`, `secondspectrum`, `impect`, `uefa`, `international`), or in a frame of your own: the lines stand where the provider puts them, and an empty `ky-data` group in its units is put in the drawing for raw data. */
|
package/dist/venue.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { SurfaceOptions } from "./types.ts";
|
|
|
6
6
|
export interface VenueSettings {
|
|
7
7
|
/** Roofs and canopies over the top tier of the stands: a canopy over the back of the top tier in the open, a lid over a hall. They give way to the eye as the walls do. Off by default. */
|
|
8
8
|
roof?: boolean;
|
|
9
|
+
/** A retractable roof (a real venue's: BC Place's) drawn open, the fabric gathered into its pod, instead of closed over the opening. Closed by default. */
|
|
10
|
+
roofOpen?: boolean;
|
|
9
11
|
/** How finely the curves are cut: `low` a facet to each corner, `auto` (the default) three, `high` six; an oval is 12, 28 or 56 facets round. */
|
|
10
12
|
detail?: Cut;
|
|
11
13
|
}
|
package/dist/venue.js
CHANGED
|
@@ -151,7 +151,7 @@ export function standsVenueOf(stands, crowd, o, v, lift) {
|
|
|
151
151
|
items.push({ id: "wall-seats", kind: "wall-seats", at: centre, height: topOf(wallSeats), planes: wallSeats });
|
|
152
152
|
// The roof: a canopy over the back of the top tier, or a lid over it in a hall. A real venue has its own: the walls of its building and a roof of its kind over them.
|
|
153
153
|
if (stands.real !== undefined && v.roof === true)
|
|
154
|
-
items.push(...realBuilding(stands.real, topRing(stands), centre, lift, ARC_STEPS[cut].oval * 2));
|
|
154
|
+
items.push(...realBuilding(stands.real, topRing(stands), centre, lift, ARC_STEPS[cut].oval * 2, v.roofOpen === true));
|
|
155
155
|
const top = v.roof === true && crowd.roof && stands.real === undefined ? topRing(stands) : undefined;
|
|
156
156
|
if (top !== undefined) {
|
|
157
157
|
const lid = INDOOR.includes(String(o.sport));
|
package/dist/venue.real.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export declare const roofAt: (real: RealShell, p: Pt) => number;
|
|
|
11
11
|
* The walls and the roof of a real venue. The hall is the building's outline cut to the bowl's wall and a margin (`RealShell.hall`): its rim is where a ray from the middle meets the one or the other first, in `steps`
|
|
12
12
|
* rays. A wall stands on each stretch of the rim, up to the roof's height over it; the roof is a band from the rim in to the inner edge of the top tier (the middle stays open, as the 3D view's roofs are).
|
|
13
13
|
*/
|
|
14
|
-
export declare function realBuilding(real: RealShell, top: StandRing | undefined, centre: readonly [number, number], lift: number, steps: number): Items;
|
|
14
|
+
export declare function realBuilding(real: RealShell, top: StandRing | undefined, centre: readonly [number, number], lift: number, steps: number, open?: boolean): Items;
|
|
15
|
+
/** The pod in the middle of a cable roof's opening, as a share of the opening's size, and how thick it is, in feet (ours: the article says the fabric gathers into a pod above the video board, not how large it is). */
|
|
16
|
+
export declare const POD: {
|
|
17
|
+
readonly share: 0.24;
|
|
18
|
+
readonly thick: 9;
|
|
19
|
+
};
|
|
15
20
|
type Items = Upright[];
|
|
16
21
|
export {};
|
package/dist/venue.real.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
// The building of a real venue, raised: its walls, standing on the outline OpenStreetMap gives, and its roof over the top tier, a lid that rises towards the middle
|
|
2
|
-
// sides
|
|
1
|
+
// The building of a real venue, raised: its walls, standing on the outline OpenStreetMap gives, and its roof over the top tier, a lid that rises towards the middle, a saddle that rises at the two ends and falls at the two
|
|
2
|
+
// sides, or a cable-supported roof that rises to an opening over the surface which a retractable fabric closes (BC Place's, with the fabric gathered into its pod when `roofOpen` is asked). All are asked for with the roof
|
|
3
|
+
// (`venue: { roof: true }`) and give way to the eye as the other walls do. Pure: data in, planes out.
|
|
3
4
|
import { rayAt } from "./crowd.js";
|
|
4
5
|
import { n, shy, wall } from "./turn.kit.js";
|
|
5
6
|
import { pointList, raked } from "./venue.geom.js";
|
|
@@ -54,7 +55,7 @@ function slopeThrough(points) {
|
|
|
54
55
|
* The walls and the roof of a real venue. The hall is the building's outline cut to the bowl's wall and a margin (`RealShell.hall`): its rim is where a ray from the middle meets the one or the other first, in `steps`
|
|
55
56
|
* rays. A wall stands on each stretch of the rim, up to the roof's height over it; the roof is a band from the rim in to the inner edge of the top tier (the middle stays open, as the 3D view's roofs are).
|
|
56
57
|
*/
|
|
57
|
-
export function realBuilding(real, top, centre, lift, steps) {
|
|
58
|
+
export function realBuilding(real, top, centre, lift, steps, open = false) {
|
|
58
59
|
const items = [];
|
|
59
60
|
const c = [centre[0], centre[1]];
|
|
60
61
|
const rim = Array.from({ length: steps }, (_, k) => {
|
|
@@ -74,13 +75,17 @@ export function realBuilding(real, top, centre, lift, steps) {
|
|
|
74
75
|
});
|
|
75
76
|
if (planes.length > 0)
|
|
76
77
|
items.push({ id: "shell", kind: "walls", at: centre, height: Math.max(...planes.map((p) => p.o[2])), planes });
|
|
77
|
-
|
|
78
|
+
const crown = real.roof === "cable" ? real.crown : undefined;
|
|
79
|
+
if (top?.hole == null && crown === undefined)
|
|
78
80
|
return items;
|
|
79
81
|
const roof = [];
|
|
80
|
-
|
|
81
|
-
const inner = rim.map((_, k) =>
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
// A cable roof rises from the rim of the hall to the opening over the surface; any other is a band from the rim in to the inner edge of the top tier.
|
|
83
|
+
const inner = rim.map((_, k) => {
|
|
84
|
+
const angle = (2 * Math.PI * k) / steps;
|
|
85
|
+
return crown === undefined ? rayAt(top.hole, c[0], c[1], angle) : firstHit(crown.opening, c, angle) ?? rayAt(top.hole, c[0], c[1], angle);
|
|
86
|
+
});
|
|
87
|
+
const rise = real.roof === "saddle" || real.roof === "cable" ? 0 : LID_RISE;
|
|
88
|
+
const zOf = (p, inward) => lift + roofAt(real, p) + (inward ? (crown === undefined ? rise : crown.rise) : 0);
|
|
84
89
|
for (let k = 0; k < steps; k += 1) {
|
|
85
90
|
const [a, b] = [rim[k], rim[(k + 1) % steps]];
|
|
86
91
|
const [ai, bi] = [inner[k], inner[(k + 1) % steps]];
|
|
@@ -93,11 +98,53 @@ export function realBuilding(real, top, centre, lift, steps) {
|
|
|
93
98
|
continue;
|
|
94
99
|
const mid = [(a[0] + b[0] + ai[0] + bi[0]) / 4, (a[1] + b[1] + ai[1] + bi[1]) / 4];
|
|
95
100
|
const away = Math.hypot(mid[0] - c[0], mid[1] - c[1]);
|
|
96
|
-
|
|
101
|
+
// A cable roof's cables run from the rim to the opening along the edge of each piece (ours: the drawing's cables are as many as its pieces, not the roof's own count).
|
|
102
|
+
const paint = (corners) => `<polygon class="u-roof" points="${pointList(corners)}"/>${crown === undefined ? "" : `<path class="u-cable" d="M${n(corners[0][0])} ${n(corners[0][1])}L${n(corners[3][0])} ${n(corners[3][1])}"/>`}`;
|
|
103
|
+
const piece = raked(`roof-${k}`, "roof", quad, slope, [ex / el, ey / el], paint);
|
|
97
104
|
if (piece !== undefined)
|
|
98
105
|
roof.push({ ...piece, shy: [(mid[0] - c[0]) / away, (mid[1] - c[1]) / away] });
|
|
99
106
|
}
|
|
107
|
+
if (crown !== undefined)
|
|
108
|
+
roof.push(...cablePod(real, crown, inner, c, lift, steps, open));
|
|
100
109
|
if (roof.length > 0)
|
|
101
110
|
items.push({ id: "roof", kind: "roof", at: centre, height: Math.max(...roof.flatMap((p) => [p.o[2], p.o[2] + p.u[2], p.o[2] + p.v[2], p.o[2] + p.u[2] + p.v[2]])), planes: roof });
|
|
102
111
|
return items;
|
|
103
112
|
}
|
|
113
|
+
/** The pod in the middle of a cable roof's opening, as a share of the opening's size, and how thick it is, in feet (ours: the article says the fabric gathers into a pod above the video board, not how large it is). */
|
|
114
|
+
export const POD = { share: 0.24, thick: 9 };
|
|
115
|
+
/**
|
|
116
|
+
* What lies over the opening of a cable roof: the pod in the middle (a box hung at the crown's height) and, with the roof closed, the fabric between the pod and the opening's edge, drawn thin so that the seats
|
|
117
|
+
* show through it. Open, only the pod is there: the fabric has gathered into it.
|
|
118
|
+
*/
|
|
119
|
+
function cablePod(real, crown, edge, c, lift, steps, open) {
|
|
120
|
+
const planes = [];
|
|
121
|
+
const z = lift + real.edge + crown.rise;
|
|
122
|
+
const pod = edge.map((p) => [c[0] + (p[0] - c[0]) * POD.share, c[1] + (p[1] - c[1]) * POD.share]);
|
|
123
|
+
if (!open) {
|
|
124
|
+
for (let k = 0; k < steps; k += 1) {
|
|
125
|
+
const [a, b] = [edge[k], edge[(k + 1) % steps]];
|
|
126
|
+
const [ai, bi] = [pod[k], pod[(k + 1) % steps]];
|
|
127
|
+
const el = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
128
|
+
if (el < 1e-6)
|
|
129
|
+
continue;
|
|
130
|
+
const mid = [(a[0] + b[0] + ai[0] + bi[0]) / 4, (a[1] + b[1] + ai[1] + bi[1]) / 4];
|
|
131
|
+
const away = Math.hypot(mid[0] - c[0], mid[1] - c[1]);
|
|
132
|
+
const piece = raked(`fabric-${k}`, "roof", [ai, bi, b, a], { x0: c[0], y0: c[1], z0: z, gx: 0, gy: 0 }, [(b[0] - a[0]) / el, (b[1] - a[1]) / el], (corners) => `<polygon class="u-fabric" points="${pointList(corners)}"/>`);
|
|
133
|
+
if (piece !== undefined)
|
|
134
|
+
planes.push({ ...piece, shy: [(mid[0] - c[0]) / away, (mid[1] - c[1]) / away], fadeTo: 0.04 });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// The pod: a flat top and the sides of a ring of boxes, one to each piece.
|
|
138
|
+
const top = z + POD.thick;
|
|
139
|
+
const topFace = raked("pod-top", "roof", pod, { x0: c[0], y0: c[1], z0: top, gx: 0, gy: 0 }, [1, 0], (corners) => `<polygon class="u-pod" points="${pointList(corners)}"/>`);
|
|
140
|
+
if (topFace !== undefined)
|
|
141
|
+
planes.push(topFace);
|
|
142
|
+
for (let k = 0; k < steps; k += 1) {
|
|
143
|
+
const [a, b] = [pod[k], pod[(k + 1) % steps]];
|
|
144
|
+
const long = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
|
145
|
+
if (long < 0.5)
|
|
146
|
+
continue;
|
|
147
|
+
planes.push({ ...shy(wall(`pod-${k}`, "roof", a[0], a[1], b[0], b[1], z, top, `<rect class="u-pod" width="${n(long)}" height="${n(POD.thick)}"/>`), c), fadeTo: 0.3 });
|
|
148
|
+
}
|
|
149
|
+
return planes;
|
|
150
|
+
}
|
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.27.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.27.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Kyogijo Stadiums 競技場, 40 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, the MMA cage, 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",
|
|
@@ -133,6 +133,16 @@
|
|
|
133
133
|
"import": "./dist/venues-entry.js",
|
|
134
134
|
"default": "./dist/venues-entry.js"
|
|
135
135
|
},
|
|
136
|
+
"./stadiums": {
|
|
137
|
+
"types": "./dist/stadiums-entry.d.ts",
|
|
138
|
+
"import": "./dist/stadiums-entry.js",
|
|
139
|
+
"default": "./dist/stadiums-entry.js"
|
|
140
|
+
},
|
|
141
|
+
"./district": {
|
|
142
|
+
"types": "./dist/district-entry.d.ts",
|
|
143
|
+
"import": "./dist/district-entry.js",
|
|
144
|
+
"default": "./dist/district-entry.js"
|
|
145
|
+
},
|
|
136
146
|
"./grounds": {
|
|
137
147
|
"types": "./dist/grounds-entry.d.ts",
|
|
138
148
|
"import": "./dist/grounds-entry.js",
|
|
@@ -238,6 +248,11 @@
|
|
|
238
248
|
"import": "./dist/turn-entry.js",
|
|
239
249
|
"default": "./dist/turn-entry.js"
|
|
240
250
|
},
|
|
251
|
+
"./flythrough": {
|
|
252
|
+
"types": "./dist/flythrough-entry.d.ts",
|
|
253
|
+
"import": "./dist/flythrough-entry.js",
|
|
254
|
+
"default": "./dist/flythrough-entry.js"
|
|
255
|
+
},
|
|
241
256
|
"./element/define": {
|
|
242
257
|
"types": "./dist/element-define.d.ts",
|
|
243
258
|
"import": "./dist/element-define.js",
|
|
@@ -286,6 +301,8 @@
|
|
|
286
301
|
"arenas:check": "node scripts/check-arenas.mjs",
|
|
287
302
|
"venues": "node scripts/build-venues.mjs",
|
|
288
303
|
"venues:fetch": "node scripts/fetch-venues.mjs",
|
|
304
|
+
"stadiums": "node scripts/build-stadiums.mjs",
|
|
305
|
+
"stadiums:fetch": "node scripts/fetch-stadiums.mjs",
|
|
289
306
|
"boards": "node scripts/make-boards.mjs",
|
|
290
307
|
"grounds": "node scripts/build-grounds.mjs",
|
|
291
308
|
"grounds:check": "node scripts/check-grounds.mjs",
|