@pond-ts/react 0.27.0 → 0.29.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +56 -3
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,7 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
7
7
  file covers both packages. Pre-1.0: minor bumps may include new features and
8
8
  type-level changes; patch bumps are strictly additive.
9
9
 
10
- [Unreleased]: https://github.com/pjm17971/pond-ts/compare/v0.27.0...HEAD
10
+ [Unreleased]: https://github.com/pjm17971/pond-ts/compare/v0.29.0...HEAD
11
+ [0.29.0]: https://github.com/pjm17971/pond-ts/compare/v0.28.0...v0.29.0
12
+ [0.28.0]: https://github.com/pjm17971/pond-ts/compare/v0.27.0...v0.28.0
11
13
  [0.27.0]: https://github.com/pjm17971/pond-ts/compare/v0.26.0...v0.27.0
12
14
  [0.26.0]: https://github.com/pjm17971/pond-ts/compare/v0.25.0...v0.26.0
13
15
  [0.25.0]: https://github.com/pjm17971/pond-ts/compare/v0.24.0...v0.25.0
@@ -21,7 +23,58 @@ type-level changes; patch bumps are strictly additive.
21
23
 
22
24
  ## [Unreleased]
23
25
 
24
- ## [0.27.0] — 2026-06-16
26
+ ## [0.29.0] — 2026-06-17
27
+
28
+ ### Added
29
+
30
+ - **`byColumn({ edges, inclusive })`** — `inclusive: '(]'` makes edge bins
31
+ upper-inclusive (`(eᵢ, eᵢ₊₁]`), for Coggan power / HR zones where a sample on a
32
+ zone's top edge belongs to the lower zone (the first edge becomes an exclusive
33
+ floor). Defaults to `'[)'` (unchanged — lower-inclusive `[eᵢ, eᵢ₊₁)`). (estela
34
+ F-geo-2 zone inclusivity.)
35
+ - **`'mean'` reducer alias for `'avg'`** — `'mean'` is now an accepted built-in
36
+ reducer name across `aggregate` / `rolling` / `byColumn` / `rollingByColumn` /
37
+ `reduce` (and the live equivalents), at **both runtime and the type level**: it
38
+ resolves to the `avg` kernel and classifies as numeric output
39
+ (`number | undefined`), exactly like `'avg'`. Matches the column API's
40
+ `Float64Column.mean()`. (estela F-reducer-naming.)
41
+
42
+ ### Fixed
43
+
44
+ - **`RowForSchema` honors `required: false`** — a **value** column declared
45
+ `required: false` now accepts `undefined` in its tuple-row cell at the type
46
+ level (matching the runtime, which records it as missing), so optional cells no
47
+ longer need an `as never` cast. The **key (first) column stays required** even
48
+ if marked `required: false` (the constructor always requires it). `null` is
49
+ still not admitted for tuple rows (only the JSON object-row path takes `null`).
50
+ Correspondingly, **`.rows` / `toRows()` now type an optional cell as
51
+ `… | undefined`** (`NormalizedRowForSchema`), so reading a possibly-missing
52
+ cell is no longer unsoundly typed as present — a type tightening on output for
53
+ schemas that use `required: false`. (estela F-geo-row-optional; Codex-hardened.)
54
+
55
+ ## [0.28.0] — 2026-06-17
56
+
57
+ ### Added
58
+
59
+ - **`TimeSeries.rollingByColumn(col, { radius }, mapping)` — windowed value-axis
60
+ aggregation.** The sliding-window sibling of `byColumn`: slides a centered
61
+ `±radius` window along a **non-decreasing** numeric column and reduces it at
62
+ every row, returning one record per row (positionally aligned with the
63
+ series). Where `byColumn` collapses rows into disjoint value-bins (the
64
+ value-axis analogue of `aggregate`), `rollingByColumn` is the value-axis
65
+ analogue of `rolling`. Built for windowed-percentile bands over a derived axis
66
+ (e.g. a spread band over cumulative distance). A missing/non-finite axis row is
67
+ excluded from every window and emits each reducer's empty value. O(n) two-pointer
68
+ sweep. See `docs/notes/rolling-by-column.md`.
69
+ - **`TimeSeries.withColumn(name, values)` — attach a computed numeric column.**
70
+ Appends a `Float64Array` / `(number | undefined)[]` as a new `number` column
71
+ (the schema type widens to include it), so a derived array — cumulative
72
+ distance, speed, gradient — can re-enter the pond pipeline as a real column
73
+ that `aggregate` / `byColumn` / `rollingByColumn` / `column(name)` can
74
+ reference. Existing key + value columns are shared by reference (zero-copy);
75
+ only the new column is added. `values` must match `series.length`; defined
76
+ cells are validated against the numeric intake contract (**non-finite is
77
+ rejected** — pass `undefined` for a missing cell, not `NaN`).
25
78
 
26
79
  ### Added
27
80
 
@@ -52,7 +105,7 @@ type-level changes; patch bumps are strictly additive.
52
105
  - **Behavior note — `array` columns:** an identity-comparing reducer (`keep`,
53
106
  or a custom reducer using `===` on the cell) on an `array`-kind source
54
107
  column now compares the value stored in the column, not the original object
55
- reference passed at construction. Two rows given the *same* array object
108
+ reference passed at construction. Two rows given the _same_ array object
56
109
  therefore read as distinct. Scalar columns (number / string / boolean) are
57
110
  unaffected. A non-finite or wrong-kind reducer result is still rejected with
58
111
  a `ValidationError`, exactly as the constructor's intake did.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pond-ts/react",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "React hooks for pond-ts live time series",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "test:runtime": "vitest run"
34
34
  },
35
35
  "peerDependencies": {
36
- "pond-ts": "^0.27.0",
36
+ "pond-ts": "^0.29.0",
37
37
  "react": "^18.0.0 || ^19.0.0"
38
38
  },
39
39
  "devDependencies": {