@pond-ts/react 0.41.0 → 0.43.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 +157 -6
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,12 +3,14 @@
3
3
  All notable changes to this project are documented here.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
- The `@pond-ts` packages — `pond-ts`, `@pond-ts/react`, `@pond-ts/charts`, and
7
- `@pond-ts/fit` — release together under a single `v*` tag, so this file covers
8
- them all. Pre-1.0: minor bumps may include new features and type-level changes;
9
- patch bumps are strictly additive.
10
-
11
- [Unreleased]: https://github.com/pjm17971/pond-ts/compare/v0.41.0...HEAD
6
+ The `@pond-ts` packages — `pond-ts`, `@pond-ts/react`, `@pond-ts/charts`,
7
+ `@pond-ts/fit`, and `@pond-ts/financial` — release together under a single `v*`
8
+ tag, so this file covers them all. Pre-1.0: minor bumps may include new features
9
+ and type-level changes; patch bumps are strictly additive.
10
+
11
+ [Unreleased]: https://github.com/pjm17971/pond-ts/compare/v0.43.0...HEAD
12
+ [0.43.0]: https://github.com/pjm17971/pond-ts/compare/v0.42.0...v0.43.0
13
+ [0.42.0]: https://github.com/pjm17971/pond-ts/compare/v0.41.0...v0.42.0
12
14
  [0.41.0]: https://github.com/pjm17971/pond-ts/compare/v0.40.0...v0.41.0
13
15
  [0.40.0]: https://github.com/pjm17971/pond-ts/compare/v0.39.0...v0.40.0
14
16
  [0.39.0]: https://github.com/pjm17971/pond-ts/compare/v0.38.0...v0.39.0
@@ -39,6 +41,155 @@ patch bumps are strictly additive.
39
41
 
40
42
  ## [Unreleased]
41
43
 
44
+ ## [0.43.0] — 2026-07-11
45
+
46
+ The **categorical x-axis** release: a first-class ordinal band scale (ticker /
47
+ account / expiry on x — the transpose view of a time series), plus the charts
48
+ **interaction** wave that landed after v0.42.0 was cut — the region cursor and
49
+ its drag-to-select gesture, per-bin band colour, and annotation edges that snap
50
+ to session boundaries.
51
+
52
+ ### Added
53
+
54
+ - **`@pond-ts/charts`: a first-class categorical x-axis.** `<BarChart
55
+ categories={[{ label, value }]}>` draws one bar per category on an ordinal
56
+ **band scale** (the transpose view's "columns on x" — ticker / account / zone
57
+ on x). The container infers `xKind:'category'` and builds a `scaleBand` over the
58
+ labels; `<CategoryAxis>` ticks once per category. Colour per category via
59
+ `binColors`; selection reports the category name. **Negative** category values
60
+ draw below the baseline (the P&L / delta case) — a single-series category bar
61
+ honours its sign. New exports `scaleBand` / `ScaleBand`, `CategoryAxis`,
62
+ `categoryStack` / `CategoryDatum`. Additive — a new x-kind alongside time /
63
+ value; existing charts are unchanged. First slice of the categorical-axis RFC
64
+ (`docs/rfcs/categorical-axis.md`, Phase 1).
65
+ - **`@pond-ts/charts`: `transposeRow`** — read one **row** of a wide `TimeSeries`
66
+ **across** into `{ label, value }[]` for `<BarChart categories>`: the schema's
67
+ numeric columns (a `pivotByGroup` output's per-group columns, a term
68
+ structure's per-expiry columns) become the categories at one instant. Pick the
69
+ row with `at` (`'last'` — the head/live row — by default; `'first'`, an index,
70
+ or `{ time }`); bound / order the set with `columns`.
71
+ - **`@pond-ts/charts`: stable per-column selection identity.** `SelectInfo` gains
72
+ an optional **`mark`** — a stable per-mark identity within a layer. A categorical
73
+ bar reports its **column name** as `mark`, and a controlled `selected` echo /
74
+ the highlight match key on `(id, mark)`, so a pinned selection survives a column
75
+ reorder (the slot index doesn't; the name does). Additive — `mark` is
76
+ `undefined` for a time / value bar (whose sample `key` is already its identity).
77
+ Plus a category-axis **label policy**: a dense axis thins (keeps every k-th) and
78
+ ellipsis-truncates its labels so they stay legible while every bar draws.
79
+ - **`@pond-ts/charts`: region cursor (`cursor="region"`).** A shaded **band**
80
+ highlights the bucket under the pointer, bucketed by a new **`cursorSequence`**
81
+ prop — a `Sequence` (`Sequence.every('15m')`, `Sequence.calendar('week')`)
82
+ realized over the view, or a `BoundedSequence` (a `TradingCalendar`'s
83
+ `sessionSequence()` / `barSequence()`) used as-is. The band maps through the x
84
+ scale, so on a trading-time axis the closed part of a bucket collapses (crops
85
+ to live sessions). Time-axis only (a no-op on a value axis). (#409, #413)
86
+ - **`@pond-ts/charts`: draggable region cursor → one-shot select.** Opt-in
87
+ **`onRegionSelect?: (range: TimeRange) => void`** makes the region cursor
88
+ draggable: the band extends bucket by bucket and fires **once** on release
89
+ with the selected `[start, end)` `TimeRange` (the cursor doesn't keep it —
90
+ typical use is to zoom the view). With **no `cursorSequence`** it degenerates
91
+ to a hover **line** + **freeform** drag. **`regionSelectModifier="shift"`**
92
+ resolves the gesture conflict with `panZoom` (plain drag pans, shift-drag
93
+ selects); omitted, a region-drag preempts pan. (#416)
94
+ - **`@pond-ts/charts`: `binColors` — per-bin colour for single-series bars.**
95
+ `<BarChart binColors={[...]}>` colours each bar/band segment individually (one
96
+ colour per bin, in order), the single-series analog of the stacked `colors`
97
+ prop — used by the category axis (colour per category) and any single-series
98
+ band chart. (#408)
99
+ - **`@pond-ts/charts`: annotation edges snap to session boundaries.** When a
100
+ `<ChartContainer>` carries a trading calendar (disjoint x axis), dragging a
101
+ `<Region>` edge (or creating one) snaps to the nearest **session boundary**
102
+ rather than raw wall-clock, so a drawn span aligns with real market sessions.
103
+ (#410)
104
+
105
+ ### Fixed
106
+
107
+ - **`@pond-ts/charts`: region body-move no longer distorts across a session
108
+ boundary.** On a trading-time (discontinuous) axis, dragging a `<Region>`
109
+ annotation by its body now translates it rigidly in pixel space, so the box
110
+ keeps its width as it crosses a collapsed gap (it previously applied one
111
+ value-delta to both edges, which stretched the box in the different
112
+ rate-contexts either side of a session boundary). No-op on a continuous axis.
113
+ (#405)
114
+
115
+ ## [0.42.0] — 2026-07-10
116
+
117
+ The **trading-calendar** release: a new `@pond-ts/financial` package (its first
118
+ publish) and a discontinuous **trading-time x axis** in `@pond-ts/charts` that
119
+ collapses closed-market time (weekends, holidays, overnight, lunch breaks).
120
+
121
+ ### Added
122
+
123
+ - **`@pond-ts/financial` — new package (first release).** A calendar/analytics
124
+ layer on `pond-ts` (peer dep; ESM, no React; `@js-temporal/polyfill` for
125
+ DST-correct session generation):
126
+ - **`TradingCalendar`** — `fromSessions` (explicit schedule) and `fromRules`
127
+ (weekmask / holidays / early-closes / breaks, DST-correct via Temporal);
128
+ query surface (`sessionOn`, `sessionContaining`, `isOpen`, `sessionsInRange`,
129
+ `nextSession`, `previousSession`).
130
+ - **Bucketing seam** — `sessionSequence()` / `barSequence(period)` return a
131
+ `BoundedSequence` that flows straight through `aggregate` / `materialize`,
132
+ so every bucket is a real trading session/bar (no weekend/holiday buckets,
133
+ no bucket spanning a closure). Zero core edits.
134
+ - **`tagSessions(series, { column?, stamped? })`** — appends a session-id
135
+ column (`number | undefined`) for `partitionBy` so stateful ops don't bridge
136
+ a session boundary. `stamped: 'close'` bins a bar stamped at its close into
137
+ the closing session (`(open, close]`) for OHLC feeds.
138
+ - **`DiscontinuityProvider`** — the d3fc-style 5-method provider
139
+ (`clampUp`/`clampDown`/`distance`/`offset`/`copy` + optional `boundaries`);
140
+ `identityDiscontinuity`, `weekendSkip` (bundled reference), and
141
+ `segmentDiscontinuity(segments, { spacing })`.
142
+ - **`TradingCalendar.discontinuities({ range?, spacing?, period? })`** — the
143
+ chart-ready provider; `spacing: 'proportional'` (default, true-time) or
144
+ `'uniform'` (equal-width per session/bar, the TradingView ordinal look).
145
+ - **`@pond-ts/charts`: trading-time x axis.** Pass a `@pond-ts/financial`
146
+ provider (structurally — charts never imports that package) to collapse
147
+ closed-market gaps:
148
+ - **`ChartContainer` `discontinuities` prop** (low-level) and **`calendar` +
149
+ `spacing` props** (high-level sugar; `calendar` is a structural
150
+ `TradingCalendarLike`, `spacing` defaults to proportional).
151
+ - **`scaleTradingTime`** — a d3-scale-shaped discontinuous time scale; ticks
152
+ coarsen to a **calendar grain** (week/month/quarter/year starts) with
153
+ date/year labels, and **session dividers** draw at the collapse points
154
+ (`theme.axis.sessionDivider`), aligned with the labels.
155
+ - `Charts/TradingTimeAxis` stories (weekend/holiday/half-day/intraday,
156
+ continuous-vs-trading, daily-months, proportional-vs-uniform).
157
+ - **`@pond-ts/charts`: first-class histograms.** `<BarChart>` gains **stacking**
158
+ — a group-by dimension → stacked segments, from a wide series (`columns`), a
159
+ `Map<group, TimeSeries>` (the `partitionBy().aggregate().toMap()` shape), or a
160
+ `byColumn` `bins` array; per-group colour via `colors` or theme roles — and an
161
+ **`orientation`** prop (`'vertical'` default | `'horizontal'`, bars grow right
162
+ with the bins on a y band axis). New readers `stacksFromGroups` /
163
+ `stacksFromColumns` / `stacksFromBins` plus `StackedBarSeries` / `BinRecord` /
164
+ `Orientation` types. All data generation composes from existing operators
165
+ (`aggregate` / `byColumn` / `partitionBy`); no core changes. Guide: How-to
166
+ guides → Histograms. (#401)
167
+ - **`@pond-ts/charts`:** selection now has a stable series identity. `SelectInfo`
168
+ carries an `id`, and `BarChart` / `ScatterChart` take an optional `id` prop —
169
+ the series identity used for selection + hover. An `id` **gates interactivity**:
170
+ a layer is selectable/hoverable only when given one (a layer with no `id`
171
+ renders and reads out but can't be selected). A dev-warning fires when
172
+ `selected`/`onSelect` is wired but no layer carries an `id`. First slice of the
173
+ selection RFC (`docs/rfcs/selection.md`, Amendments 2–3).
174
+ - **`pond-ts`: `bin(W, 'minMaxFirstLast')`** — the four-channel M4 downsampling
175
+ reducer (per-bin min/max/first/last, validity-aware, chunked-delegating); the
176
+ foundation for the charts decimator wave.
177
+ - **`pond-ts`: `binBy`** — key-domain bucketed reduction (the M4 gappy-data
178
+ decimation path).
179
+
180
+ ### Changed
181
+
182
+ - **BREAKING (`@pond-ts/charts`):** `SelectInfo` gained a required `id` field
183
+ (`{ id, key, value, color, label }`) — `id` is the selection identity, `key` /
184
+ `value` are now click provenance. Code that constructs a `SelectInfo` by hand
185
+ must add `id`, and selection equality/dedup now keys on `id`, not the sample
186
+ `begin`.
187
+ - **BREAKING (`@pond-ts/charts`):** `BarChart` / `ScatterChart` selection now
188
+ requires an explicit `id` prop — the previous implicit `as ?? column` selection
189
+ identity is gone. A selectable bar/scatter layer must add `id` (e.g.
190
+ `<BarChart series={s} column="v" id="v" />`); without it the layer is
191
+ display-only.
192
+
42
193
  ## [0.41.0] — 2026-07-06
43
194
 
44
195
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pond-ts/react",
3
- "version": "0.41.0",
3
+ "version": "0.43.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.41.0",
36
+ "pond-ts": "^0.43.0",
37
37
  "react": "^18.0.0 || ^19.0.0"
38
38
  },
39
39
  "devDependencies": {