@johnmorrisdotca/kyogijo-stadiums 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -5
- package/NOTICE.md +340 -331
- package/README.md +21 -21
- package/dist/charts.curling.d.ts +1 -1
- package/dist/charts.curling.js +1 -1
- package/dist/draw.d.ts +3 -3
- package/dist/draw.js +3 -3
- package/dist/mount.d.ts +3 -3
- package/dist/mount.js +3 -3
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/turn.dom.d.ts +1 -1
- package/dist/turn.dom.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,14 +20,14 @@ The NFL, CFL and IFAF football fields, the NHL rink, the NBA court, the soccer p
|
|
|
20
20
|
<td align="center" valign="top">
|
|
21
21
|
<picture>
|
|
22
22
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-desk-dark.webp">
|
|
23
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-desk-light.webp" alt="The demo on a desk, in English: the heading Kyogijo Stadiums with the language chooser, the Docs and API reference links, five cloth patches and the Help switch, and an NHL rink drawn wide on
|
|
23
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-desk-light.webp" alt="The demo on a desk, in English: the heading Kyogijo Stadiums with the language chooser, the Docs and API reference links, five cloth patches and the Help switch, and an NHL rink drawn wide on an ice-blue background of faint skate marks and rink lines, with a made-up game on it, the USA and its flag on the left, Canada and its flag on the right, and a panel of the score 3 to 2, Final/OT, in the middle. The controls on the right list the sports, from the NFL and the NHL to handball, and then the layout and the teams." width="640">
|
|
24
24
|
</picture>
|
|
25
25
|
<br><em>The demo on a desk: a rink, with the teams on their sides and the score in the middle.</em>
|
|
26
26
|
</td>
|
|
27
27
|
<td align="center" valign="top">
|
|
28
28
|
<picture>
|
|
29
29
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-phone-dark.webp">
|
|
30
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-phone-light.webp" alt="The demo on a phone: the heading Kyogijo Stadiums over the page's controls, and under them a football field turned a quarter to stand tall, Mexico's green end zone at the top and the USA's navy end zone at the bottom, each with its flag and name written across it, the yard numbers upright, and a score panel at midfield reading 27 to 24, Final." width="240">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/hero-phone-light.webp" alt="The demo on a phone: the heading Kyogijo Stadiums over the page's controls, and under them, on a background of floodlight beams, a football field turned a quarter to stand tall, Mexico's green end zone at the top and the USA's navy end zone at the bottom, each with its flag and name written across it, the yard numbers upright, and a score panel at midfield reading 27 to 24, Final." width="240">
|
|
31
31
|
</picture>
|
|
32
32
|
<br><em>On a phone the same surface stands tall, the words still upright.</em>
|
|
33
33
|
</td>
|
|
@@ -93,8 +93,8 @@ console.log(svg.startsWith("<svg"), svg.includes("USA 3, Canada 2"));
|
|
|
93
93
|
- **The situation of a game.** `situation` draws what is happening: hockey's power play or empty net as a pill with the attacking zone tinted, and a shootout as a strip of dots; baseball's runners lit on the diamond with a scorebug (outs, inning, count); football's line of scrimmage, first-down line, red zone and down-and-distance tag, with a drive chart; in the badge and the compact card too, and in the description. [The situation](./docs/situation.md).
|
|
94
94
|
- **Lineups.** A `lineup` layer places a team's players by position code (`GK`, `CB`, `HK`, `C`) with no coordinates: it reads where each stands from a formation (36 of them, in 13 sports), draws a disc or a jersey with the shirt number and the name under it, a captain's C and a flag, and puts the visitors at the other end. A drawing with a lineup puts the score in the strip under it, so the panel hides no player. [Lineups](./docs/team-shape.md#lineups).
|
|
95
95
|
- **A pageant.** Each team's flag or crest laid large over its half of the surface, as a stadium lays giant flags and crests for a final: `pageant: "carpet"` (a flag at its own ratio with a border and a gentle fabric) or `"stage"` (a crest on a round disc with a gold ring), an emblem or a trophy of your own in the centre circle, the score in the middle or in the strip, upright wide and tall, in light and dark, with an entrance in CSS for readers who have not asked for less motion. [The pageant](./docs/pageant.md).
|
|
96
|
-
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports
|
|
97
|
-
- **Country flags, by code.** `useFlags(render)` plugs in the sister package [Hata
|
|
96
|
+
- **Trophies, medals, balls and crests, by id.** `useEmblems(renderEmblem)` plugs in the sister package [Dougu Sports](https://johnmorrisdotca.github.io/dougu-sports/) in one line, and an id goes wherever a logo, a flag or a mark is taken: `logo: "crest:shield"` (a crest in the team's colour with its letters), `pageant: { emblem: "trophy:hockey-cup" }`, `"sport:nhl/line"`, `"ball:puck"`, `"cup"`. Kyogijo bundles no emblem and keeps zero dependencies; without the plug-in an id is refused like any unsafe address. [Emblems](./docs/emblems.md).
|
|
97
|
+
- **Country flags, by code.** `useFlags(render)` plugs in the sister package [Hata](https://github.com/johnmorrisdotca/hata) through a small adapter, and a team's `flag: "CA"` is its flag: round in a round mark, at its own proportions on a banner, a badge or a pageant's carpet. The same adapter serves [Taisen Brackets](https://github.com/johnmorrisdotca/taisen-brackets). Kyogijo bundles no flag and keeps zero dependencies; without the plug-in a code is ignored. [Flags](./docs/flags.md).
|
|
98
98
|
- **Zoom to a part of a surface.** `range: "offensive-zone"` crops a drawing to a rink's zone, a half court, the paint, the red zone, a soccer half, third or penalty area, the infield, a curling house, or a box of your own in any frame, with its data, heat, labels and score following. [Display ranges](./docs/ranges.md).
|
|
99
99
|
- **Wide, tall or fit the box.** Every surface lies wide or tall: tall turns it a quarter, keeps every word upright and puts the teams top and bottom. With `orientation: "auto"` the browser helpers follow the box.
|
|
100
100
|
- **Where a point lies, by the rules, and a click as a place.** `zoneAt("nhl", [69, 22], { frame: "nhl-api" })` names the zone and the area in it from the rink's, court's, pitch's, park's or field's own figures (the offensive zone and its face-off circle, the frontcourt and the corner three, the attacking third and the six-yard box, the infield and the warning track, the red zone and between the hashes), with `isThreePointer`, `inSlot`, `inPenaltyArea`, `isFair`, `overWall` and the like, and `isHomeRun(park, point, { height })` from the park's fence and wall; `clientPointToField(svg, x, y, { provider })` is a pointer's place in any of the frames, with the zone, and `fieldPointToClient` the way back. `marks: true` writes `data-mark-id`, `data-index` and `data-zone` on every mark of a layer, for one listener to link it to a table. [Zones](./docs/zones.md), [pointing](./docs/pointer.md).
|
|
@@ -179,7 +179,7 @@ console.log(svg.includes("Cup Final, Game 7"), svg.includes("Final/OT"));
|
|
|
179
179
|
<p align="center">
|
|
180
180
|
<picture>
|
|
181
181
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-dark.webp">
|
|
182
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-light.webp" alt="A football field drawn wide on
|
|
182
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/football-desk-light.webp" alt="A football field drawn wide on a background of floodlight beams: Mexico's green end zone on the left with its flag and its name written along it, the USA's navy end zone on the right with its flag, the yard lines, hash marks and upright and upside-down yard numbers between them, and the score panel at midfield reading 27 to 24, Final, Championship Game." width="720">
|
|
183
183
|
</picture>
|
|
184
184
|
<br><em>A football field: the end zones in the teams' colours, the score at midfield.</em>
|
|
185
185
|
</p>
|
|
@@ -196,12 +196,12 @@ useEmblems(renderEmblem);
|
|
|
196
196
|
|
|
197
197
|
const svg = drawKyogijo({
|
|
198
198
|
sport: "soccer",
|
|
199
|
-
away: { name: "
|
|
200
|
-
home: { name: "
|
|
199
|
+
away: { name: "Brazil", abbr: "BRA", score: 2, color: "#009739", logo: "crest:shield" },
|
|
200
|
+
home: { name: "England", abbr: "ENG", score: 1, color: "#c8102e", logo: "crest:roundel" },
|
|
201
201
|
status: "final",
|
|
202
202
|
pageant: { style: "stage", emblem: "trophy:soccer-globe", emblemName: "Northern Cup" },
|
|
203
203
|
});
|
|
204
|
-
console.log(svg.includes(encodeURIComponent(">
|
|
204
|
+
console.log(svg.includes(encodeURIComponent(">BRA<")), svg.includes("Northern Cup"));
|
|
205
205
|
// true true
|
|
206
206
|
```
|
|
207
207
|
|
|
@@ -213,7 +213,7 @@ import { drawKyogijo, drawSurface } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
|
213
213
|
// No teams: just the NFL field at its true shape, 120 by 53⅓ yards with 12 feet of ground round it.
|
|
214
214
|
console.log(/viewBox="-12 -12 384 184"/.test(drawSurface({ sport: "nfl" })));
|
|
215
215
|
// true
|
|
216
|
-
const game = { away: { name: "
|
|
216
|
+
const game = { away: { name: "Mexico", score: 27 }, home: { name: "USA", score: 24 }, status: "final" };
|
|
217
217
|
const wide = drawKyogijo({ sport: "nfl", ...game, orientation: "landscape" });
|
|
218
218
|
const tall = drawKyogijo({ sport: "nfl", ...game, orientation: "portrait" });
|
|
219
219
|
const box = (svg: string) => /viewBox="[^ ]+ [^ ]+ ([^ ]+) ([^ "]+)"/.exec(svg)!.slice(1).map(Number);
|
|
@@ -224,7 +224,7 @@ console.log(box(wide), box(tall));
|
|
|
224
224
|
<p align="center">
|
|
225
225
|
<picture>
|
|
226
226
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/tall-phone-dark.webp">
|
|
227
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/tall-phone-light.webp" alt="A hockey rink standing tall on a phone, the same game as on the desk: the USA's flag and name in the upper zone, Canada's in the lower, each reading upright, the score panel between them over the centre line." width="240">
|
|
227
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/tall-phone-light.webp" alt="A hockey rink standing tall on a phone, on an ice-blue background, the same game as on the desk: the USA's flag and name in the upper zone, Canada's in the lower, each reading upright, the score panel between them over the centre line." width="240">
|
|
228
228
|
</picture>
|
|
229
229
|
<br><em>The same game tall: the teams top and bottom, every word upright.</em>
|
|
230
230
|
</p>
|
|
@@ -259,7 +259,7 @@ console.log(svg.includes("甲子園球場のグラウンド"), svg.includes("阪
|
|
|
259
259
|
<p align="center">
|
|
260
260
|
<picture>
|
|
261
261
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/ballpark-desk-dark.webp">
|
|
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 with the outfield fence drawn through its published distances, 95 metres at the lines and 118 metres in the alleys and the middle, with mown arcs on the grass, the warning track, the infield dirt, and a red and a navy panel in the foul ground at the bottom for the teams' dugouts, each with its country's flag, Japan's and the USA's." width="640">
|
|
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 a royal purple background, with the outfield fence drawn through its published distances, 95 metres at the lines and 118 metres in the alleys and the middle, with mown arcs on the grass, the warning track, the infield dirt, and a red and a navy panel in the foul ground at the bottom for the teams' dugouts, each with its country's flag, Japan's and the USA's." width="640">
|
|
263
263
|
</picture>
|
|
264
264
|
<br><em>A ballpark's fence, drawn through the distances its article publishes.</em>
|
|
265
265
|
</p>
|
|
@@ -307,8 +307,8 @@ import { drawBadge } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
|
307
307
|
|
|
308
308
|
const badge = drawBadge({
|
|
309
309
|
sport: "nba",
|
|
310
|
-
away: { name: "
|
|
311
|
-
home: { name: "
|
|
310
|
+
away: { name: "Australia", abbr: "AUS", score: 98, color: "#00843d" },
|
|
311
|
+
home: { name: "Japan", abbr: "JPN", score: 104, color: "#bc002d" },
|
|
312
312
|
status: "Q4 2:31",
|
|
313
313
|
});
|
|
314
314
|
console.log(/viewBox="0 0 440 64"/.test(badge));
|
|
@@ -318,7 +318,7 @@ console.log(/viewBox="0 0 440 64"/.test(badge));
|
|
|
318
318
|
<p align="center">
|
|
319
319
|
<picture>
|
|
320
320
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-dark.webp">
|
|
321
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-light.webp" alt="A list of eight score strips in the demo, each a team block with its country's flag, a short name and its score at each end, in the team's colour, and in the middle a small picture of the sport and the state of the game, such as Final, Final/OT and 2nd period." width="640">
|
|
321
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/badges-desk-light.webp" alt="A list of eight score strips in the demo, on a midnight-blue background, each a team block with its country's flag, a short name and its score at each end, in the team's colour, and in the middle a small picture of the sport and the state of the game, such as Final, Final/OT and 2nd period." width="640">
|
|
322
322
|
</picture>
|
|
323
323
|
<br><em>Badges for a list of games.</em>
|
|
324
324
|
</p>
|
|
@@ -339,7 +339,7 @@ console.log(svg.includes("--ky-key:#1e4f8f"), svg.includes("METRO BOLTS"));
|
|
|
339
339
|
<p align="center">
|
|
340
340
|
<picture>
|
|
341
341
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/court-desk-dark.webp">
|
|
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: a pale floor with a deep blue key, centre circle and border, the words AUSTRALIA and JAPAN along the baselines, each country's flag and name on its half, and the score panel at centre court reading 108 to 112, Finals, Game 6." width="640">
|
|
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, the words AUSTRALIA and JAPAN along the baselines, each country's flag and name on its half, and the score panel at centre court reading 108 to 112, Finals, Game 6." width="640">
|
|
343
343
|
</picture>
|
|
344
344
|
<br><em>A court in a look of its own: the paint, the border and the words on the baselines are options.</em>
|
|
345
345
|
</p>
|
|
@@ -369,7 +369,7 @@ The flat drawing is the floor, turned by a drag, a swipe, the keys or four viewp
|
|
|
369
369
|
<p align="center">
|
|
370
370
|
<picture>
|
|
371
371
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-volleyball-desk-dark.webp">
|
|
372
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-volleyball-desk-light.webp" alt="A volleyball court from behind an end line, turned in the demo: the net at 2.43 metres on its posts with the red and white antennae, and under it the buttons for the four viewpoints, turning, raising, zooming and resetting." width="640">
|
|
372
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-volleyball-desk-light.webp" alt="A volleyball court from behind an end line under a spotlight, turned in the demo: the net at 2.43 metres on its posts with the red and white antennae, and under it the buttons for the four viewpoints, turning, raising, zooming and resetting." width="640">
|
|
373
373
|
</picture>
|
|
374
374
|
<br><em>A volleyball net at its rulebook height, with its posts and antennae.</em>
|
|
375
375
|
</p>
|
|
@@ -377,7 +377,7 @@ The flat drawing is the floor, turned by a drag, a swipe, the keys or four viewp
|
|
|
377
377
|
<p align="center">
|
|
378
378
|
<picture>
|
|
379
379
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-rink-desk-dark.webp">
|
|
380
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-rink-desk-light.webp" alt="An ice rink from a low corner, turned in the demo: the boards with their glass round the ice, a goal at each end, and the score on the ice." width="640">
|
|
380
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-rink-desk-light.webp" alt="An ice rink from a low corner on an ice-blue background, turned in the demo: the boards with their glass round the ice, a goal at each end, and the score on the ice." width="640">
|
|
381
381
|
</picture>
|
|
382
382
|
<br><em>A rink with its boards, glass and goals.</em>
|
|
383
383
|
</p>
|
|
@@ -385,7 +385,7 @@ The flat drawing is the floor, turned by a drag, a swipe, the keys or four viewp
|
|
|
385
385
|
<p align="center">
|
|
386
386
|
<picture>
|
|
387
387
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-court-desk-dark.webp">
|
|
388
|
-
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-court-desk-light.webp" alt="A basketball court from the main camera, turned in the demo: a basket on its backboard and padded stanchion at each end of the floor." width="640">
|
|
388
|
+
<img src="https://raw.githubusercontent.com/johnmorrisdotca/kyogijo-stadiums/main/docs/images/turn-court-desk-light.webp" alt="A basketball court from the main camera in a warm glow, turned in the demo: a basket on its backboard and padded stanchion at each end of the floor." width="640">
|
|
389
389
|
</picture>
|
|
390
390
|
<br><em>A court with a basket at each end, the rim at 10 feet.</em>
|
|
391
391
|
</p>
|
|
@@ -497,7 +497,7 @@ console.log(svg.includes('viewBox="0 0 1200 675"'), svg.includes("Three ballpark
|
|
|
497
497
|
|
|
498
498
|
<!-- score is home-away; home-score and away-score say it the other way -->
|
|
499
499
|
<kyogijo-field sport="nba" size="compact" orientation="auto"
|
|
500
|
-
home="
|
|
500
|
+
home="Japan" away="Australia" score="112-108"
|
|
501
501
|
home-color="#c2410c" away-color="#14233f" status="final"></kyogijo-field>
|
|
502
502
|
```
|
|
503
503
|
|
|
@@ -527,7 +527,7 @@ import "@johnmorrisdotca/kyogijo-stadiums/element/define";
|
|
|
527
527
|
</script>
|
|
528
528
|
|
|
529
529
|
<template>
|
|
530
|
-
<kyogijo-field sport="nfl" orientation="auto" away="
|
|
530
|
+
<kyogijo-field sport="nfl" orientation="auto" away="Mexico" home="USA" away-score="27" home-score="24" status="final" />
|
|
531
531
|
</template>
|
|
532
532
|
```
|
|
533
533
|
|
|
@@ -659,7 +659,7 @@ pnpm check # lint, types, every test, the build and the packed package
|
|
|
659
659
|
pnpm test:package # pack, install and import it as somebody who installed it would
|
|
660
660
|
pnpm test:demo # build the demo and the docs and play them in a real browser, at a phone's width and a desk's
|
|
661
661
|
pnpm site # build the demo and the docs site into site/, as the Pages workflow publishes it
|
|
662
|
-
pnpm screenshots:readme #
|
|
662
|
+
pnpm screenshots:readme # remake every README picture from the built demo, in light and dark, each on one of the family's backgrounds
|
|
663
663
|
pnpm test:readme # run every example in the README and the docs against the built package
|
|
664
664
|
pnpm docs:make # rewrite what the docs make from the source: the Japanese words, the leagues, the frames and units tables
|
|
665
665
|
```
|
package/dist/charts.curling.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare function curlingScore(stones: readonly CurlingStone[], options?:
|
|
|
41
41
|
* { x: 1.9, y: 1.1, team: "away", number: 7 },
|
|
42
42
|
* { x: 0, y: -12, team: "away", number: 3 },
|
|
43
43
|
* ],
|
|
44
|
-
* { end: 6, hammer: "home", names: { home: "
|
|
44
|
+
* { end: 6, hammer: "home", names: { home: "Canada", away: "Japan" } },
|
|
45
45
|
* );
|
|
46
46
|
* console.log(chart.totals.points, chart.totals.scoring, chart.title);
|
|
47
47
|
* // 2 home Curling stones, End 6
|
package/dist/charts.curling.js
CHANGED
|
@@ -109,7 +109,7 @@ const LOOKS = { stone: {}, counting: { hollow: true }, "shot-rock": { hollow: tr
|
|
|
109
109
|
* { x: 1.9, y: 1.1, team: "away", number: 7 },
|
|
110
110
|
* { x: 0, y: -12, team: "away", number: 3 },
|
|
111
111
|
* ],
|
|
112
|
-
* { end: 6, hammer: "home", names: { home: "
|
|
112
|
+
* { end: 6, hammer: "home", names: { home: "Canada", away: "Japan" } },
|
|
113
113
|
* );
|
|
114
114
|
* console.log(chart.totals.points, chart.totals.scoring, chart.title);
|
|
115
115
|
* // 2 home Curling stones, End 6
|
package/dist/draw.d.ts
CHANGED
|
@@ -39,11 +39,11 @@ export declare function describe(o: SurfaceOptions | ScoreOptions): {
|
|
|
39
39
|
* import { drawKyogijo } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
40
40
|
* const svg = drawKyogijo({
|
|
41
41
|
* sport: "nhl",
|
|
42
|
-
* away: { name: "
|
|
43
|
-
* home: { name: "
|
|
42
|
+
* away: { name: "USA", abbr: "USA", score: 3, color: "#1c3f7a" },
|
|
43
|
+
* home: { name: "Canada", abbr: "CAN", score: 2, color: "#d52b1e" },
|
|
44
44
|
* status: "final-ot",
|
|
45
45
|
* });
|
|
46
|
-
* console.log(svg.startsWith("<svg"), svg.includes("
|
|
46
|
+
* console.log(svg.startsWith("<svg"), svg.includes("USA"));
|
|
47
47
|
* // true true
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
package/dist/draw.js
CHANGED
|
@@ -812,11 +812,11 @@ export function describe(o) {
|
|
|
812
812
|
* import { drawKyogijo } from "@johnmorrisdotca/kyogijo-stadiums";
|
|
813
813
|
* const svg = drawKyogijo({
|
|
814
814
|
* sport: "nhl",
|
|
815
|
-
* away: { name: "
|
|
816
|
-
* home: { name: "
|
|
815
|
+
* away: { name: "USA", abbr: "USA", score: 3, color: "#1c3f7a" },
|
|
816
|
+
* home: { name: "Canada", abbr: "CAN", score: 2, color: "#d52b1e" },
|
|
817
817
|
* status: "final-ot",
|
|
818
818
|
* });
|
|
819
|
-
* console.log(svg.startsWith("<svg"), svg.includes("
|
|
819
|
+
* console.log(svg.startsWith("<svg"), svg.includes("USA"));
|
|
820
820
|
* // true true
|
|
821
821
|
* ```
|
|
822
822
|
*/
|
package/dist/mount.d.ts
CHANGED
|
@@ -44,11 +44,11 @@ export declare function containerAspect(host: HTMLElement, breakpoint?: number):
|
|
|
44
44
|
* const card = mountKyogijo(document.querySelector("#game")!, {
|
|
45
45
|
* sport: "nhl",
|
|
46
46
|
* orientation: "auto",
|
|
47
|
-
* away: { name: "
|
|
48
|
-
* home: { name: "
|
|
47
|
+
* away: { name: "USA", score: 1 },
|
|
48
|
+
* home: { name: "Canada", score: 0 },
|
|
49
49
|
* status: "live",
|
|
50
50
|
* });
|
|
51
|
-
* card.update({ sport: "nhl", orientation: "auto", away: { name: "
|
|
51
|
+
* card.update({ sport: "nhl", orientation: "auto", away: { name: "USA", score: 2 }, home: { name: "Canada", score: 0 } });
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export declare function mountKyogijo(host: HTMLElement, options: SurfaceOptions | ScoreOptions, settings?: MountSettings): KyogijoMount;
|
package/dist/mount.js
CHANGED
|
@@ -59,11 +59,11 @@ export function containerAspect(host, breakpoint = 560) {
|
|
|
59
59
|
* const card = mountKyogijo(document.querySelector("#game")!, {
|
|
60
60
|
* sport: "nhl",
|
|
61
61
|
* orientation: "auto",
|
|
62
|
-
* away: { name: "
|
|
63
|
-
* home: { name: "
|
|
62
|
+
* away: { name: "USA", score: 1 },
|
|
63
|
+
* home: { name: "Canada", score: 0 },
|
|
64
64
|
* status: "live",
|
|
65
65
|
* });
|
|
66
|
-
* card.update({ sport: "nhl", orientation: "auto", away: { name: "
|
|
66
|
+
* card.update({ sport: "nhl", orientation: "auto", away: { name: "USA", score: 2 }, home: { name: "Canada", score: 0 } });
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
export function mountKyogijo(host, options, settings = {}) {
|
package/dist/react.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function kyogijoHtml(options: SurfaceOptions | ScoreOptions): {
|
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
11
|
* import { kyogijoProps } from "@johnmorrisdotca/kyogijo-stadiums/react";
|
|
12
|
-
* const props = kyogijoProps({ sport: "nba", away: { name: "
|
|
12
|
+
* const props = kyogijoProps({ sport: "nba", away: { name: "Australia", score: 108 }, home: { name: "Japan", score: 112 }, status: "final" });
|
|
13
13
|
* console.log(props["data-kyogijo"], props.dangerouslySetInnerHTML.__html.startsWith("<svg"));
|
|
14
14
|
* // nba true
|
|
15
15
|
* ```
|
package/dist/react.js
CHANGED
|
@@ -10,7 +10,7 @@ export function kyogijoHtml(options) {
|
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
12
12
|
* import { kyogijoProps } from "@johnmorrisdotca/kyogijo-stadiums/react";
|
|
13
|
-
* const props = kyogijoProps({ sport: "nba", away: { name: "
|
|
13
|
+
* const props = kyogijoProps({ sport: "nba", away: { name: "Australia", score: 108 }, home: { name: "Japan", score: 112 }, status: "final" });
|
|
14
14
|
* console.log(props["data-kyogijo"], props.dangerouslySetInnerHTML.__html.startsWith("<svg"));
|
|
15
15
|
* // nba true
|
|
16
16
|
* ```
|
package/dist/turn.dom.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare function turnSupported(win?: {
|
|
|
40
40
|
* @example
|
|
41
41
|
* ```ts no-run
|
|
42
42
|
* import { mountKyogijoTurn } from "@johnmorrisdotca/kyogijo-stadiums/turn";
|
|
43
|
-
* const view = mountKyogijoTurn(document.querySelector("#court")!, { sport: "volleyball", home: { name: "
|
|
43
|
+
* const view = mountKyogijoTurn(document.querySelector("#court")!, { sport: "volleyball", home: { name: "Japan", score: 3 }, away: { name: "USA", score: 2 } }, { preset: "end" });
|
|
44
44
|
* view.preset("corner");
|
|
45
45
|
* view.set({ yaw: 60, pitch: 40 });
|
|
46
46
|
* ```
|
package/dist/turn.dom.js
CHANGED
|
@@ -24,7 +24,7 @@ const between = (from, to, t) => ({ yaw: from.yaw + (nearest(from.yaw, to.yaw) -
|
|
|
24
24
|
* @example
|
|
25
25
|
* ```ts no-run
|
|
26
26
|
* import { mountKyogijoTurn } from "@johnmorrisdotca/kyogijo-stadiums/turn";
|
|
27
|
-
* const view = mountKyogijoTurn(document.querySelector("#court")!, { sport: "volleyball", home: { name: "
|
|
27
|
+
* const view = mountKyogijoTurn(document.querySelector("#court")!, { sport: "volleyball", home: { name: "Japan", score: 3 }, away: { name: "USA", score: 2 } }, { preset: "end" });
|
|
28
28
|
* view.preset("corner");
|
|
29
29
|
* view.set({ yaw: 60, pitch: 40 });
|
|
30
30
|
* ```
|
package/dist/types.d.ts
CHANGED
|
@@ -479,7 +479,7 @@ export interface PageantOptions {
|
|
|
479
479
|
}
|
|
480
480
|
/** One team of a score. */
|
|
481
481
|
export interface Team {
|
|
482
|
-
/** The name, as it is to be written: "
|
|
482
|
+
/** The name, as it is to be written: "Canada". */
|
|
483
483
|
name: string;
|
|
484
484
|
/** A short form, three letters or so, for the score and the badge. Taken from the name when missing. */
|
|
485
485
|
abbr?: string;
|
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.10.1";
|
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.10.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/kyogijo-stadiums",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Kyogijo Stadiums 競技場, 39 sports' surfaces as SVG, drawn to scale from the rulebooks: NFL, CFL and IFAF football fields, an NHL rink, an NBA court, MLB ballparks, soccer pitches, curling sheets, athletics stadiums, speed skating, short track and figure skating rinks, swimming pools, water polo fields, diving wells, artistic swimming areas, and the courts and fields of tennis, volleyball (indoor, beach and sitting), badminton, pickleball, table tennis, padel, squash, racquetball, sepak takraw, teqball, roundnet, netball, lacrosse, rugby, Australian football, Gaelic games, cricket, field hockey and handball, and the budo of judo, karate, kendo, sumo and kyudo with a dojo of tatami laid as real units, with each team's name and logo on its side and the score in the middle, stands and a crowd, a pageant of flags, and a 3D view. Light and dark, accessible, a compact badge for lists, a helper for React and a custom element. Zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sports",
|