pond-ts 0.42.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 +83 -1
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,7 +8,8 @@ The `@pond-ts` packages — `pond-ts`, `@pond-ts/react`, `@pond-ts/charts`,
8
8
  tag, so this file covers them all. Pre-1.0: minor bumps may include new features
9
9
  and type-level changes; patch bumps are strictly additive.
10
10
 
11
- [Unreleased]: https://github.com/pjm17971/pond-ts/compare/v0.42.0...HEAD
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
12
13
  [0.42.0]: https://github.com/pjm17971/pond-ts/compare/v0.41.0...v0.42.0
13
14
  [0.41.0]: https://github.com/pjm17971/pond-ts/compare/v0.40.0...v0.41.0
14
15
  [0.40.0]: https://github.com/pjm17971/pond-ts/compare/v0.39.0...v0.40.0
@@ -40,6 +41,77 @@ and type-level changes; patch bumps are strictly additive.
40
41
 
41
42
  ## [Unreleased]
42
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
+
43
115
  ## [0.42.0] — 2026-07-10
44
116
 
45
117
  The **trading-calendar** release: a new `@pond-ts/financial` package (its first
@@ -82,6 +154,16 @@ collapses closed-market time (weekends, holidays, overnight, lunch breaks).
82
154
  (`theme.axis.sessionDivider`), aligned with the labels.
83
155
  - `Charts/TradingTimeAxis` stories (weekend/holiday/half-day/intraday,
84
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)
85
167
  - **`@pond-ts/charts`:** selection now has a stable series identity. `SelectInfo`
86
168
  carries an `id`, and `BarChart` / `ScatterChart` take an optional `id` prop —
87
169
  the series identity used for selection + hover. An `id` **gates interactivity**:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pond-ts",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "TypeScript-first time series primitives",
5
5
  "license": "MIT",
6
6
  "repository": {