@johnmorrisdotca/kyogijo-stadiums 0.50.0 → 0.51.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 +10 -0
- package/NOTICE.md +11 -0
- package/README.md +1 -0
- package/catalogue.json +1208 -0
- package/dist/catalogue-entry.d.ts +2 -0
- package/dist/catalogue-entry.js +3 -0
- package/dist/catalogue.d.ts +45 -0
- package/dist/catalogue.data.d.ts +2 -0
- package/dist/catalogue.data.js +1208 -0
- package/dist/catalogue.js +74 -0
- package/dist/catalogue.types.d.ts +143 -0
- package/dist/catalogue.types.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +11 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// The catalogue: every venue the package draws today (supported), the ones being built (working on) and the ones wanted, with their facts, in one list. The same data is published as a static
|
|
2
|
+
// file, `catalogue.json`, in the npm package and on the demo's site (`CATALOGUE_ADDRESS`). There is no server: a reader fetches the file or imports this entry.
|
|
3
|
+
import { CATALOGUE_DATA } from "./catalogue.data.js";
|
|
4
|
+
/** Every venue: the supported ones first, then those being built, then the wanted ones, each group in its order. */
|
|
5
|
+
export const CATALOGUE = CATALOGUE_DATA.venues;
|
|
6
|
+
/** The leagues (every venue of the season, NBA, MLB, NFL, CFL and NHL) and the collections of the Working on and Wanted sections, each with its venues in order and its name in both languages. */
|
|
7
|
+
export const CATALOGUE_GROUPS = CATALOGUE_DATA.groups;
|
|
8
|
+
/** The sports, with their names in both languages and the `sport` of `drawKyogijo` that draws each (`null`: not drawn yet). */
|
|
9
|
+
export const CATALOGUE_SPORTS = CATALOGUE_DATA.sports;
|
|
10
|
+
/** The countries of the catalogue by ISO code, with their names in English and Japanese (Wikidata's labels). */
|
|
11
|
+
export const CATALOGUE_COUNTRIES = CATALOGUE_DATA.countries;
|
|
12
|
+
/** Where `catalogue.json` is published: the same data as this entry, for a page or a program that does not install the package. */
|
|
13
|
+
export const CATALOGUE_ADDRESS = CATALOGUE_DATA.address;
|
|
14
|
+
/** The demo's address: a supported venue's `demo` is relative to it. */
|
|
15
|
+
export const CATALOGUE_SITE = CATALOGUE_DATA.site;
|
|
16
|
+
/** The counts, the day the sources were read and where they are kept, and the licence of the facts. */
|
|
17
|
+
export const CATALOGUE_ABOUT = {
|
|
18
|
+
schemaVersion: CATALOGUE_DATA.schemaVersion,
|
|
19
|
+
generatedAt: CATALOGUE_DATA.generatedAt,
|
|
20
|
+
package: CATALOGUE_DATA.package,
|
|
21
|
+
licence: CATALOGUE_DATA.licence,
|
|
22
|
+
source: CATALOGUE_DATA.source,
|
|
23
|
+
counts: CATALOGUE_DATA.counts,
|
|
24
|
+
};
|
|
25
|
+
const BY_ID = new Map(CATALOGUE.map((entry) => [entry.id, entry]));
|
|
26
|
+
/**
|
|
27
|
+
* A venue by its id, or `undefined`.
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { catalogueById } from "@johnmorrisdotca/kyogijo-stadiums/catalogue";
|
|
31
|
+
* const ashe = catalogueById("arthur-ashe-stadium")!;
|
|
32
|
+
* console.log(ashe.status, ashe.ticket, ashe.wikidata);
|
|
33
|
+
* // working-on KYOGIJO-STADIUMS-22 Q609551
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function catalogueById(id) {
|
|
37
|
+
return BY_ID.get(id);
|
|
38
|
+
}
|
|
39
|
+
/** The venues of a status, in the catalogue's order. */
|
|
40
|
+
export function catalogueByStatus(status) {
|
|
41
|
+
return CATALOGUE.filter((entry) => entry.status === status);
|
|
42
|
+
}
|
|
43
|
+
/** The venues of a sport (any of a venue's sports), in the catalogue's order. */
|
|
44
|
+
export function catalogueBySport(sport) {
|
|
45
|
+
return CATALOGUE.filter((entry) => entry.sports.includes(sport));
|
|
46
|
+
}
|
|
47
|
+
/** The venues of a group (a league or a collection), in the group's order; empty for a group that does not exist. */
|
|
48
|
+
export function catalogueByGroup(group) {
|
|
49
|
+
return (CATALOGUE_GROUPS.find((one) => one.id === group)?.ids ?? []).map((id) => BY_ID.get(id)).filter((entry) => entry !== undefined);
|
|
50
|
+
}
|
|
51
|
+
/** Every venue whose building or whole venue is wanted: the venues of the Wanted section and the supported venues of a league or a collection that are drawn as a surface only. */
|
|
52
|
+
export function catalogueWanted() {
|
|
53
|
+
return CATALOGUE.filter((entry) => entry.want !== undefined && entry.status !== "working-on");
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* How much of a league the package draws: its venues this season, how many in their buildings, how many as a field only, how many not yet.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { catalogueCoverage } from "@johnmorrisdotca/kyogijo-stadiums/catalogue";
|
|
60
|
+
* const nhl = catalogueCoverage("nhl");
|
|
61
|
+
* console.log(nhl.venues, nhl.outline, nhl.notYet);
|
|
62
|
+
* // 32 32 0
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export function catalogueCoverage(league) {
|
|
66
|
+
const venues = catalogueByGroup(league);
|
|
67
|
+
return {
|
|
68
|
+
league,
|
|
69
|
+
venues: venues.length,
|
|
70
|
+
outline: venues.filter((entry) => entry.drawn === "outline").length,
|
|
71
|
+
surface: venues.filter((entry) => entry.drawn === "surface").length,
|
|
72
|
+
notYet: venues.filter((entry) => entry.status !== "supported").length,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { PlaceSurface } from "./atlas.ts";
|
|
2
|
+
/** Where a venue stands with the package: drawn today, being built (an open ticket), or wanted. */
|
|
3
|
+
export type CatalogueStatus = "supported" | "working-on" | "wanted";
|
|
4
|
+
/**
|
|
5
|
+
* How a supported venue is drawn: `outline`, inside the outline of its real building with a bowl of its seats (`STADIUMS` and the NHL's `VENUES`), or `surface`, its field, court, rink, park or
|
|
6
|
+
* floor only, at the venue's own size where the data gives one (a key of `PARKS`, `GROUNDS`, `ARENAS` or `HALLS`), or `circuit`, the lap as OpenStreetMap maps it with its pit lane and no stands
|
|
7
|
+
* (a key of `CIRCUITS`, drawn by `drawCircuit` of the `circuits` entry).
|
|
8
|
+
*/
|
|
9
|
+
export type CatalogueDrawn = "outline" | "surface" | "circuit";
|
|
10
|
+
/** What is wanted of a venue: its building's `outline` (a venue drawn today as a surface only), or the `venue` itself (one the package does not draw at all). */
|
|
11
|
+
export type CatalogueWant = "outline" | "venue";
|
|
12
|
+
/** What has to exist before a wanted venue can be drawn: a `circuit-surface` for motor racing, which the package does not draw yet. */
|
|
13
|
+
export type CatalogueNeed = "circuit-surface";
|
|
14
|
+
/** The sports of the catalogue, in kebab case. Every one but `motor-racing` names a surface the package draws (`CATALOGUE_SPORTS[sport].surface`). */
|
|
15
|
+
export type CatalogueSport = "baseball" | "basketball" | "hockey" | "american-football" | "canadian-football" | "soccer" | "cricket" | "rugby" | "australian-football" | "gaelic-games" | "tennis" | "budo" | "athletics" | "swimming" | "skating" | "curling" | "volleyball" | "badminton" | "handball" | "boxing" | "motor-racing";
|
|
16
|
+
/** The leagues whose every venue of the season is in the catalogue. */
|
|
17
|
+
export type CatalogueLeague = "nba" | "mlb" | "nfl" | "cfl" | "nhl";
|
|
18
|
+
/** A club that plays its home games at a venue this season. */
|
|
19
|
+
export interface CatalogueTeam {
|
|
20
|
+
name: string;
|
|
21
|
+
nameJa?: string;
|
|
22
|
+
league: CatalogueLeague;
|
|
23
|
+
}
|
|
24
|
+
/** The options that draw a supported venue with `drawKyogijo`: its surface (a park, a ground, an arena or a hall), or its real building (`stadium` or `arena` with `crowd: { real: true }`). */
|
|
25
|
+
export type CatalogueDraw = PlaceSurface | {
|
|
26
|
+
sport: "nfl" | "cfl" | "soccer" | "mlb" | "boxing" | "nba" | "nhl";
|
|
27
|
+
stadium?: string;
|
|
28
|
+
park?: string;
|
|
29
|
+
arena?: string;
|
|
30
|
+
crowd: {
|
|
31
|
+
real: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** One venue of the catalogue. */
|
|
35
|
+
export interface CatalogueEntry {
|
|
36
|
+
/** Kebab case, unique: the package's own key for a venue it draws (`fenway-park`, `bc-place`), else one made from the venue's English name. */
|
|
37
|
+
id: string;
|
|
38
|
+
status: CatalogueStatus;
|
|
39
|
+
/** How a supported venue is drawn. */
|
|
40
|
+
drawn?: CatalogueDrawn;
|
|
41
|
+
/** What is wanted: the building's outline of a venue drawn as a surface that a league or a group lists, or the venue itself. */
|
|
42
|
+
want?: CatalogueWant;
|
|
43
|
+
/** What must be built first. */
|
|
44
|
+
needs?: CatalogueNeed;
|
|
45
|
+
/** Which of the package's lists a supported venue comes from: a real stadium or NHL venue (`stadium`, `venue`), or a `park`, `ground`, `arena` or `hall`. */
|
|
46
|
+
kind?: "stadium" | "venue" | "park" | "ground" | "arena" | "hall" | "circuit";
|
|
47
|
+
/** The everyday name in English. */
|
|
48
|
+
name: string;
|
|
49
|
+
/** The name in Japanese; absent where no source gives one (`missing.nameJa` says so). */
|
|
50
|
+
nameJa?: string;
|
|
51
|
+
/** Where the Japanese name was read: the package's own data, Wikidata's label, the title of the Japanese Wikipedia's article, or a name a reviewer checked. */
|
|
52
|
+
nameJaFrom?: "package" | "wikidata" | "jawiki" | "reviewed";
|
|
53
|
+
city?: string;
|
|
54
|
+
cityJa?: string;
|
|
55
|
+
/** ISO 3166-1 alpha-2. */
|
|
56
|
+
country?: string;
|
|
57
|
+
/** Wikidata's coordinates (P625), in degrees. */
|
|
58
|
+
lat?: number;
|
|
59
|
+
lon?: number;
|
|
60
|
+
sports: CatalogueSport[];
|
|
61
|
+
/** The Wikidata item. */
|
|
62
|
+
wikidata: string;
|
|
63
|
+
/** The seats, where Wikidata gives one figure (P1083), for a venue that is not drawn yet. */
|
|
64
|
+
capacity?: number;
|
|
65
|
+
/** `current` or `past`, for a supported venue. */
|
|
66
|
+
era?: "current" | "past";
|
|
67
|
+
/** The leagues that play there this season, and their clubs. */
|
|
68
|
+
leagues?: CatalogueLeague[];
|
|
69
|
+
teams?: CatalogueTeam[];
|
|
70
|
+
/** The groups the venue is listed in (a league, a collection of the Wanted section). */
|
|
71
|
+
groups: string[];
|
|
72
|
+
/** The ticket of a venue being built. */
|
|
73
|
+
ticket?: string;
|
|
74
|
+
/** The options that draw a supported venue with `drawKyogijo` (a circuit has none: `drawCircuit({ circuit: id })` of the `circuits` entry draws it). */
|
|
75
|
+
draw?: CatalogueDraw;
|
|
76
|
+
/** The demo page that shows a supported venue, relative to the demo's address (`CATALOGUE_SITE`). */
|
|
77
|
+
demo?: string;
|
|
78
|
+
/** The facts left out, each with why. */
|
|
79
|
+
missing?: Partial<Record<"nameJa" | "city" | "country" | "coordinates", string>>;
|
|
80
|
+
}
|
|
81
|
+
/** A group: a league (every venue of its season) or a collection of the Wanted or Working on section, in its order. */
|
|
82
|
+
export interface CatalogueGroup {
|
|
83
|
+
id: string;
|
|
84
|
+
kind: "league" | "collection";
|
|
85
|
+
en: string;
|
|
86
|
+
ja: string;
|
|
87
|
+
/** For a league: its sport and its season. */
|
|
88
|
+
sport?: CatalogueSport;
|
|
89
|
+
season?: string;
|
|
90
|
+
/** For a collection that is being built. */
|
|
91
|
+
status?: "working-on";
|
|
92
|
+
needs?: CatalogueNeed;
|
|
93
|
+
ids: string[];
|
|
94
|
+
}
|
|
95
|
+
/** The whole catalogue, as `catalogue.json` holds it. */
|
|
96
|
+
export interface CatalogueData {
|
|
97
|
+
/** The shape's version: a change that breaks a reader raises it. */
|
|
98
|
+
schemaVersion: 1;
|
|
99
|
+
/** The day the sources were read (not the day the file was written). */
|
|
100
|
+
generatedAt: string;
|
|
101
|
+
package: {
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
};
|
|
105
|
+
/** Where the JSON is published. */
|
|
106
|
+
address: string;
|
|
107
|
+
/** The demo's address, which `demo` is relative to. */
|
|
108
|
+
site: string;
|
|
109
|
+
licence: string;
|
|
110
|
+
source: {
|
|
111
|
+
read: string;
|
|
112
|
+
rawAnswers: string;
|
|
113
|
+
articles: Record<string, number>;
|
|
114
|
+
};
|
|
115
|
+
counts: {
|
|
116
|
+
supported: number;
|
|
117
|
+
outline: number;
|
|
118
|
+
surface: number;
|
|
119
|
+
circuit: number;
|
|
120
|
+
workingOn: number;
|
|
121
|
+
wanted: number;
|
|
122
|
+
outlineWanted: number;
|
|
123
|
+
};
|
|
124
|
+
sports: Record<CatalogueSport, {
|
|
125
|
+
en: string;
|
|
126
|
+
ja: string;
|
|
127
|
+
surface: string | null;
|
|
128
|
+
}>;
|
|
129
|
+
groups: CatalogueGroup[];
|
|
130
|
+
countries: Record<string, {
|
|
131
|
+
en: string;
|
|
132
|
+
ja?: string;
|
|
133
|
+
}>;
|
|
134
|
+
venues: CatalogueEntry[];
|
|
135
|
+
}
|
|
136
|
+
/** How many venues of a league the package draws in their buildings, as a surface only, or not at all. */
|
|
137
|
+
export interface CatalogueCoverage {
|
|
138
|
+
league: CatalogueLeague;
|
|
139
|
+
venues: number;
|
|
140
|
+
outline: number;
|
|
141
|
+
surface: number;
|
|
142
|
+
notYet: number;
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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.51.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.51.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.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",
|
|
@@ -297,6 +297,12 @@
|
|
|
297
297
|
"import": "./dist/flythrough-entry.js",
|
|
298
298
|
"default": "./dist/flythrough-entry.js"
|
|
299
299
|
},
|
|
300
|
+
"./catalogue": {
|
|
301
|
+
"types": "./dist/catalogue-entry.d.ts",
|
|
302
|
+
"import": "./dist/catalogue-entry.js",
|
|
303
|
+
"default": "./dist/catalogue-entry.js"
|
|
304
|
+
},
|
|
305
|
+
"./catalogue.json": "./catalogue.json",
|
|
300
306
|
"./element/define": {
|
|
301
307
|
"types": "./dist/element-define.d.ts",
|
|
302
308
|
"import": "./dist/element-define.js",
|
|
@@ -308,7 +314,8 @@
|
|
|
308
314
|
"README.md",
|
|
309
315
|
"LICENSE",
|
|
310
316
|
"NOTICE.md",
|
|
311
|
-
"CHANGELOG.md"
|
|
317
|
+
"CHANGELOG.md",
|
|
318
|
+
"catalogue.json"
|
|
312
319
|
],
|
|
313
320
|
"engines": {
|
|
314
321
|
"node": ">=22"
|
|
@@ -350,6 +357,8 @@
|
|
|
350
357
|
"venues:rink": "node scripts/fetch-rink-evidence.mjs",
|
|
351
358
|
"stadiums": "node scripts/build-stadiums.mjs",
|
|
352
359
|
"stadiums:fetch": "node scripts/fetch-stadiums.mjs",
|
|
360
|
+
"catalogue": "node scripts/build-catalogue.mjs",
|
|
361
|
+
"catalogue:fetch": "node scripts/fetch-catalogue.mjs",
|
|
353
362
|
"walk": "node scripts/build-walk.mjs",
|
|
354
363
|
"circuits": "node scripts/build-circuits.mjs",
|
|
355
364
|
"circuits:fetch": "node scripts/fetch-circuits.mjs",
|