@courthive/scoring-visualizations 0.2.16 → 0.2.18

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/README.md CHANGED
@@ -4,6 +4,8 @@ Standalone scoring visualizations for tennis match data. Transforms [TODS](https
4
4
 
5
5
  Part of the [CourtHive](https://github.com/CourtHive) ecosystem. Consumed by `epixodic` (point-by-point match tracker) and `competition-factory-server`.
6
6
 
7
+ **[Live Storybook →](https://www.tennisvisuals.com/)** — every chart in the set, interactive, with live-playback and format-awareness demos.
8
+
7
9
  ## Install
8
10
 
9
11
  ```bash
@@ -257,7 +259,7 @@ pnpm storybook # Storybook dev server on :6006
257
259
  pnpm build-storybook # Build static Storybook
258
260
  ```
259
261
 
260
- Storybook (11 stories across the chart set, with live-playback and format-awareness demos) is the primary surface for visual development and testing — run `pnpm storybook` and open <http://localhost:6006>.
262
+ Storybook (11 stories across the chart set, with live-playback and format-awareness demos) is the primary surface for visual development and testing — run `pnpm storybook` and open <http://localhost:6006>. The same Storybook is published to <https://www.tennisvisuals.com/> on every push to `main` by `.github/workflows/deploy-storybook.yml`, so a merged change is live without any manual step.
261
263
 
262
264
  ### Key dependencies
263
265
 
@@ -126,7 +126,7 @@ function M(e) {
126
126
  }
127
127
  function N(e, t) {
128
128
  let n = e?.score?.sets;
129
- if (!(!Array.isArray(n) || !n[t])) return n[t].winningSide;
129
+ if (Array.isArray(n) && n[t]) return n[t].winningSide;
130
130
  }
131
131
  function P(e, t) {
132
132
  let n = e?.score?.sets;
@@ -997,7 +997,7 @@ function Oe() {
997
997
  });
998
998
  for (let e = 0; e < n.length; e++) {
999
999
  let i = n[e - 1], o = "L" + (e == 0 || i.game.complete ? r([0, 0]) : r(i.point.points)) + "x" + r(n[e].point.points);
1000
- t.points.highlight.length && !t.points.highlight.includes(e) || (a.p[o] = a.p[o] ? a.p[o] + 1 : 1, t.points.winners.includes(n[e].point.result) ? a.w[o] = a.w[o] ? a.w[o] + 1 : 1 : t.points.errors.includes(n[e].point.result) && (a.e[o] = a.e[o] ? a.e[o] + 1 : 1));
1000
+ (!t.points.highlight.length || t.points.highlight.includes(e)) && (a.p[o] = a.p[o] ? a.p[o] + 1 : 1, t.points.winners.includes(n[e].point.result) ? a.w[o] = a.w[o] ? a.w[o] + 1 : 1 : t.points.errors.includes(n[e].point.result) && (a.e[o] = a.e[o] ? a.e[o] + 1 : 1));
1001
1001
  }
1002
1002
  if (n.length > 0) {
1003
1003
  let e = n[n.length - 1];