@pond-ts/react 0.68.0 → 0.69.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.
- package/AGENTS.md +12 -3
- package/API.md +79 -75
- package/CHANGELOG.md +81 -1
- package/README.md +91 -9
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -60,8 +60,9 @@ const s = TimeSeries.fromJSON({
|
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Time cells accept ms-since-epoch numbers, `Date`s, or ISO strings **with an
|
|
63
|
-
offset** (`…Z`, `…+01:00`). A wall-clock string with no offset
|
|
64
|
-
you pass `parse: { timeZone: 'America/New_York' }
|
|
63
|
+
offset** (`…Z`, `…+01:00`). A wall-clock string with no offset is read as
|
|
64
|
+
**UTC** unless you pass `parse: { timeZone: 'America/New_York' }` — it does
|
|
65
|
+
not throw, it silently shifts by the zone's offset.
|
|
65
66
|
|
|
66
67
|
Other doors: `TimeSeries.fromPoints(points)` for wide `{ ts, a, b }` rows,
|
|
67
68
|
`fromColumns` for struct-of-arrays / `Float64Array`, `fromArrow` for an Arrow
|
|
@@ -214,7 +215,8 @@ them; `import { STUDIES } from '@pond-ts/financial/catalog'` lists them at runti
|
|
|
214
215
|
event); `align` puts rows on a grid without reducing.
|
|
215
216
|
3. **`Sequence.every('1M')` for months.** Not fixed-length → use
|
|
216
217
|
`Sequence.calendar('month', { timeZone })`.
|
|
217
|
-
4. **Wall-clock strings without a zone.** `'2025-01-01T09:00'`
|
|
218
|
+
4. **Wall-clock strings without a zone.** `'2025-01-01T09:00'` is read as
|
|
219
|
+
UTC — no error, every instant shifted by your offset. Add
|
|
218
220
|
`parse: { timeZone }` or use offset strings / ms numbers.
|
|
219
221
|
5. **Unsorted rows.** The constructor throws and names the row; pass
|
|
220
222
|
`sort: true` rather than sorting by hand.
|
|
@@ -227,6 +229,13 @@ them; `import { STUDIES } from '@pond-ts/financial/catalog'` lists them at runti
|
|
|
227
229
|
9. **Reaching for a chart-library adapter first.** If the project uses React,
|
|
228
230
|
`@pond-ts/charts` consumes the series with no adapter; `toPoints()` is the
|
|
229
231
|
bridge for other libraries.
|
|
232
|
+
10. **Aggregating in one zone and charting in another.** `Sequence.calendar`
|
|
233
|
+
defaults to **UTC**; a chart's time axis defaults to the **viewer's**
|
|
234
|
+
zone. Pass the same `timeZone` to both — `Sequence.calendar('day', {
|
|
235
|
+
timeZone })` and `<ChartContainer timeZone={timeZone}>` — and a bucket
|
|
236
|
+
edge and the tick that labels it are one instant. A
|
|
237
|
+
`TradingCalendar.fromRules` carries its zone; `calendar={cal}` renders in
|
|
238
|
+
it with no further wiring.
|
|
230
239
|
|
|
231
240
|
## Where to read next
|
|
232
241
|
|
package/API.md
CHANGED
|
@@ -45,7 +45,7 @@ next door is the point.
|
|
|
45
45
|
| `TimeSeries` | Immutable time-indexed collection, columnar storage | `packages/core/src/batch/time-series.ts` |
|
|
46
46
|
| `ValueSeries` | Series keyed by a monotonic non-time value axis | `packages/core/src/batch/value-series.ts` |
|
|
47
47
|
| `PartitionedTimeSeries` | Scoped view for per-partition stateful transforms; `<S, K, By>` — `By` is the partition column names, carried into `aggregate` / `rolling` result types | `packages/core/src/batch/partitioned-time-series.ts` |
|
|
48
|
-
| `Sequence` | Infinite grid of time buckets (
|
|
48
|
+
| `Sequence` | Infinite grid of time buckets: fixed-step (hourly, every N) or calendar (day/week/month/quarter/year in an IANA zone, default UTC) | `packages/core/src/sequence/sequence.ts` |
|
|
49
49
|
| `BoundedSequence` | Finite ordered list of explicit interval buckets | `packages/core/src/sequence/bounded-sequence.ts` |
|
|
50
50
|
|
|
51
51
|
Static constructors on `TimeSeries`: `fromJSON()` (row tuples/objects),
|
|
@@ -99,13 +99,14 @@ Value-axis wire types
|
|
|
99
99
|
|
|
100
100
|
### Temporal keys & events
|
|
101
101
|
|
|
102
|
-
| Export | Purpose
|
|
103
|
-
| ------------- |
|
|
104
|
-
| `Time` | Point-in-time event key
|
|
105
|
-
| `TimeRange` | Interval event key (start/end)
|
|
106
|
-
| `Interval` | Labeled time-interval event key
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
102
|
+
| Export | Purpose | Source |
|
|
103
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
104
|
+
| `Time` | Point-in-time event key | `packages/core/src/core/time.ts` |
|
|
105
|
+
| `TimeRange` | Interval event key (start/end) | `packages/core/src/core/time-range.ts` |
|
|
106
|
+
| `Interval` | Labeled time-interval event key | `packages/core/src/core/interval.ts` |
|
|
107
|
+
| `TimeZone` | IANA zone as a calendar: `startOf` / `next` / `parts` / `instant` / `offsetAt` / `abbreviation`; interned, transition-cached; what `Sequence.calendar` buckets with | `packages/core/src/core/time-zone.ts` |
|
|
108
|
+
| `Event` | Immutable event: temporal key + typed payload | `packages/core/src/core/event.ts` |
|
|
109
|
+
| `toTimeRange` | Coerce temporal values to `TimeRange` | `packages/core/src/core/time-range.ts` |
|
|
109
110
|
|
|
110
111
|
### TimeSeries methods (all in `packages/core/src/batch/time-series.ts`)
|
|
111
112
|
|
|
@@ -158,14 +159,14 @@ Deliberately small — the ordering-based slice of the algebra, no calendar ops
|
|
|
158
159
|
|
|
159
160
|
### Key exported types (batch)
|
|
160
161
|
|
|
161
|
-
| Type group | Names
|
|
162
|
-
| ----------------- |
|
|
163
|
-
| Schema contract | `SeriesSchema`, `RowForSchema`, `EventForSchema`, `EventDataForSchema`, `EventKeyForSchema`, `TimeSeriesInput`, `TimeSeriesJsonInput`
|
|
164
|
-
| Aggregation specs | `AggregateReducer`, `AggregateMap`, `AggregateOutputMap`, `AggregateSchema`, `BinReducerName`, `BinOutput`
|
|
165
|
-
| Operation schemas | `RollingSchema`, `RollingAlignment`, `AlignSchema`, `DiffSchema`, `SmoothSchema`, `SmoothMethod`, `FillStrategy`, `FillMapping`
|
|
166
|
-
| Column/data kinds | `Column`, `KeyColumn`, `ColumnKind`, `ScalarKind`, `ScalarValue`, `ColumnValue`, `ArrayValue`, `ValidityBitmap`
|
|
167
|
-
| JSON wire format | `JsonRowFormat`, `JsonRowForSchema`, `JsonObjectRowForSchema`, `JsonValueForKind`, `JsonTimestampInput`, `JsonTimeRangeInput`, `JsonIntervalInput`
|
|
168
|
-
| Temporal utility | `TemporalLike`, `DurationInput`, `CalendarUnit`, `TimeZoneOptions`, `KeyLike`, `BatchSampleStrategy`, `SequenceSample`, `SequenceCoverage`
|
|
162
|
+
| Type group | Names | Source |
|
|
163
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
164
|
+
| Schema contract | `SeriesSchema`, `RowForSchema`, `EventForSchema`, `EventDataForSchema`, `EventKeyForSchema`, `TimeSeriesInput`, `TimeSeriesJsonInput` | `packages/core/src/schema/index.ts` |
|
|
165
|
+
| Aggregation specs | `AggregateReducer`, `AggregateMap`, `AggregateOutputMap`, `AggregateSchema`, `BinReducerName`, `BinOutput` | `packages/core/src/schema/index.ts`, `packages/core/src/column.ts` |
|
|
166
|
+
| Operation schemas | `RollingSchema`, `RollingAlignment`, `AlignSchema`, `DiffSchema`, `SmoothSchema`, `SmoothMethod`, `FillStrategy`, `FillMapping` | `packages/core/src/schema/index.ts` |
|
|
167
|
+
| Column/data kinds | `Column`, `KeyColumn`, `ColumnKind`, `ScalarKind`, `ScalarValue`, `ColumnValue`, `ArrayValue`, `ValidityBitmap` | `packages/core/src/columnar/` |
|
|
168
|
+
| JSON wire format | `JsonRowFormat`, `JsonRowForSchema`, `JsonObjectRowForSchema`, `JsonValueForKind`, `JsonTimestampInput`, `JsonTimeRangeInput`, `JsonIntervalInput` | `packages/core/src/schema/index.ts` |
|
|
169
|
+
| Temporal utility | `TemporalLike`, `DurationInput`, `CalendarUnit`, `TimeZoneOptions`, `Disambiguation`, `ZonedParts`, `ZonedPartsInput`, `StartOfOptions`, `KeyLike`, `BatchSampleStrategy`, `SequenceSample`, `SequenceCoverage` | `packages/core/src/core/`, `packages/core/src/sequence/` |
|
|
169
170
|
|
|
170
171
|
The `pond-ts/types` subpath re-exports the schema-as-contract types with zero
|
|
171
172
|
runtime (`packages/core/src/schema/public.ts`).
|
|
@@ -250,17 +251,17 @@ Types: `UseSnapshotOptions`, `SnapshotSource` (structural — covers
|
|
|
250
251
|
|
|
251
252
|
### Components — layout & axes
|
|
252
253
|
|
|
253
|
-
| Component | Key props
|
|
254
|
-
| --------------------------- |
|
|
255
|
-
| `ChartContainer` | `width`, `range?`, `theme?`, `cursor?`, `panZoom?`, `xScale?`, `bounds?`, `showAxis?`, `calendar?`, `origin?`, `maxBandWidth?`/`bandAlign?`, `onTrackerChanged?`, `onDrawStats?` | Root: shared x-scale, interactions, annotations
|
|
256
|
-
| `ChartRow` | `height`, `cursor?` (deprecated — mount a cursor in the row)
|
|
257
|
-
| `Layers` | children
|
|
258
|
-
| `YAxis` | `id` (req), `side?`, `scale?` (`'linear'` \| `'log'` \| `'symlog'`), `linearWindow?`, `min?`/`max?`, `format?`, `width?`, `hide?`
|
|
259
|
-
| `XAxis` | `side?`, `label?`, `format?`, `ticks?`, `transform?`, `dateStyle?`
|
|
260
|
-
| `TimeAxis` / `CategoryAxis` | (XAxis props)
|
|
261
|
-
| `Canvas` | `width`, `height`, `draw`
|
|
262
|
-
| `Selector` | `enabled?` (default `true`), `selected?` (mark \| set), `hovered?`, `onSelect?`, `onHover?`, `children?`
|
|
263
|
-
| `MultiSelector` | `enabled?`, `selected?`, `hovered?`, `sequence?`, `onSelect?`, `onHover?`, `children?`
|
|
254
|
+
| Component | Key props | Purpose | Source |
|
|
255
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
256
|
+
| `ChartContainer` | `width`, `range?`, `theme?`, `cursor?`, `panZoom?`, `xScale?`, `bounds?`, `showAxis?`, `calendar?`, `timeZone?`, `origin?`, `maxBandWidth?`/`bandAlign?`, `onTrackerChanged?`, `onDrawStats?` | Root: shared x-scale, interactions, annotations; `timeZone` renders the time axis in an IANA zone (default: viewer-local; a `calendar.timeZone` supplies the default) | `packages/charts/src/ChartContainer.tsx` |
|
|
257
|
+
| `ChartRow` | `height`, `cursor?` (deprecated — mount a cursor in the row) | One stacked plot band; owns its y-axes | `packages/charts/src/ChartRow.tsx` |
|
|
258
|
+
| `Layers` | children | Mandatory z-stack inside a row (back-to-front) | `packages/charts/src/Layers.tsx` |
|
|
259
|
+
| `YAxis` | `id` (req), `side?`, `scale?` (`'linear'` \| `'log'` \| `'symlog'`), `linearWindow?`, `min?`/`max?`, `format?`, `width?`, `hide?` | Y-axis gutter; layers bind via their `axis` prop | `packages/charts/src/YAxis.tsx` |
|
|
260
|
+
| `XAxis` | `side?`, `label?`, `format?`, `ticks?`, `transform?`, `dateStyle?`, `timeZone?` (this strip in another IANA zone) | Placeable x-axis strip; kind inferred from data | `packages/charts/src/XAxis.tsx` |
|
|
261
|
+
| `TimeAxis` / `CategoryAxis` | (XAxis props) | Thin `XAxis` presets | `packages/charts/src/TimeAxis.tsx`, `CategoryAxis.tsx` |
|
|
262
|
+
| `Canvas` | `width`, `height`, `draw` | Low-level DPR-aware canvas primitive | `packages/charts/src/Canvas.tsx` |
|
|
263
|
+
| `Selector` | `enabled?` (default `true`), `selected?` (mark \| set), `hovered?`, `onSelect?`, `onHover?`, `children?` | Wraps its scope; mounting enables click-select and owns the state it drives (RFC A10) | `packages/charts/src/selectors.tsx` |
|
|
264
|
+
| `MultiSelector` | `enabled?`, `selected?`, `hovered?`, `sequence?`, `onSelect?`, `onHover?`, `children?` | Sweep-select superset of `Selector`: drag sweeps marks, release reports `(hits, modifiers, spans)` — plural, one per swept layer (RFC A5.2) | `packages/charts/src/selectors.tsx` |
|
|
264
265
|
|
|
265
266
|
### Components — draw layers
|
|
266
267
|
|
|
@@ -386,44 +387,47 @@ Series shapes (same file): `ChartSeries`, `BandSeries`, `BoxSeries`,
|
|
|
386
387
|
|
|
387
388
|
### Live values, scales & key types
|
|
388
389
|
|
|
389
|
-
| Export | Purpose
|
|
390
|
-
| ------------------------------------------ |
|
|
391
|
-
| `createLiveValue` / `LiveValue` | Imperative push channel for high-frequency indicator updates (isolated repaint)
|
|
392
|
-
| `scaleTradingTime` / `TradingTimeScale` | Discontinuous time scale collapsing closed-market gaps
|
|
393
|
-
| `DiscontinuityProvider` | Gap topology consumed by the trading-time scale
|
|
394
|
-
| `
|
|
395
|
-
| `
|
|
396
|
-
| `
|
|
397
|
-
| `
|
|
398
|
-
| `
|
|
399
|
-
| `
|
|
400
|
-
| `
|
|
401
|
-
| `
|
|
402
|
-
| `
|
|
403
|
-
| `
|
|
404
|
-
| `
|
|
405
|
-
| `
|
|
406
|
-
| `
|
|
407
|
-
| `
|
|
408
|
-
| `
|
|
409
|
-
| `
|
|
410
|
-
| `
|
|
411
|
-
| `
|
|
412
|
-
| `
|
|
413
|
-
| `
|
|
414
|
-
| `
|
|
415
|
-
| `
|
|
416
|
-
| `
|
|
417
|
-
| `
|
|
418
|
-
| `
|
|
419
|
-
| `
|
|
420
|
-
| `
|
|
421
|
-
| `
|
|
422
|
-
| `
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
390
|
+
| Export | Purpose | Source |
|
|
391
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------- |
|
|
392
|
+
| `createLiveValue` / `LiveValue` | Imperative push channel for high-frequency indicator updates (isolated repaint) | `packages/charts/src/indicators.tsx` |
|
|
393
|
+
| `scaleTradingTime` / `TradingTimeScale` | Discontinuous time scale collapsing closed-market gaps; `scaleTradingTime(provider, { timeZone })` runs its tick ladder and labels in an IANA zone; `.withTimeZone(zone)` / `.timeZone()` re-derive the same mapping in another zone | `packages/charts/src/tradingTimeScale.ts` |
|
|
394
|
+
| `DiscontinuityProvider` | Gap topology consumed by the trading-time scale; optional `withTimeZone(zone)` for providers whose day anchors move with the zone | `packages/charts/src/tradingTimeScale.ts` |
|
|
395
|
+
| `identityProvider` | The gap-free provider a plain continuous time axis runs on; `identityProvider({ timeZone })` puts its day anchors on that zone's midnights | `packages/charts/src/tradingTimeScale.ts` |
|
|
396
|
+
| `TradingCalendarLike` | Structural shape of a trading calendar `ChartContainer calendar` accepts: `discontinuities({ spacing })` + optional `timeZone` (the axis default) | `packages/charts/src/tradingTimeScale.ts` |
|
|
397
|
+
| `ScaleTimeZoneOptions` | `{ timeZone? }` for `scaleTradingTime` / `identityProvider` | `packages/charts/src/tradingTimeScale.ts` |
|
|
398
|
+
| `scaleBand` / `ScaleBand` | Ordinal slot scale for the category axis | `packages/charts/src/bandScale.ts` |
|
|
399
|
+
| `GapMode` | `'none' \| 'empty' \| 'dashed' \| 'step' \| 'fade'` (Line/Area `gaps` prop) | `packages/charts/src/gaps.ts` |
|
|
400
|
+
| `DecimateOption` | `<LineChart decimate>` — M4 viewport decimation (`bool \| { threshold }`) | `packages/charts/src/decimate.ts` |
|
|
401
|
+
| `CursorMode` | `'none' \| 'line' \| 'point' \| 'inline' \| 'flag' \| 'crosshair' \| 'region'` | `packages/charts/src/context.ts` |
|
|
402
|
+
| `TrackerInfo` / `TrackerSample` | Hover readout payload (`onTrackerChanged`) | `packages/charts/src/context.ts` |
|
|
403
|
+
| `AnnotationKind` / `CreateSpec` | Annotation identity + draw-gesture payload (`onCreate`) | `packages/charts/src/context.ts` |
|
|
404
|
+
| `SelectInfo` | Selection/hover payload (`Selector`/`MultiSelector` `onSelect`/`onHover`) | `packages/charts/src/context.ts` |
|
|
405
|
+
| `SelectModifiers` | Keyboard modifiers on a click, 2nd arg to `onSelect` | `packages/charts/src/context.ts` |
|
|
406
|
+
| `SelectorProps` | `<Selector>`'s props — `enabled?` / `selected?` / `hovered?` / `onSelect?` / `onHover?` / `children?` | `packages/charts/src/selectors.tsx` |
|
|
407
|
+
| `MultiSelectorProps` | `<MultiSelector>`'s props — the above plus `sequence?`, with plural callbacks | `packages/charts/src/selectors.tsx` |
|
|
408
|
+
| `RangeSpan` | `<RangeCursor onDragRelease>` payload — `{ x: [lo, hi], y? }` in axis units | `packages/charts/src/context.ts` |
|
|
409
|
+
| `SpanSelection` | Range entry for `selected` — one layer's marks over `x`/`y`/`rows` (RFC A5.2) | `packages/charts/src/context.ts` |
|
|
410
|
+
| `SelectionEntry` | One `selected` array entry: `SelectInfo \| SpanSelection` | `packages/charts/src/context.ts` |
|
|
411
|
+
| `selectionContains` | Is a hit in a mixed selection? The same membership predicate the layers run | `packages/charts/src/span.ts` |
|
|
412
|
+
| `sameMark` | Are two hits the same mark? Full identity (`id`, `mark`-or-`key`, `label`) | `packages/charts/src/span.ts` |
|
|
413
|
+
| `isSpanSelection` | Entry discriminant — narrows a `SelectionEntry` to `SpanSelection` | `packages/charts/src/span.ts` |
|
|
414
|
+
| `DrawStatsFrame` / `LayerDrawInfo` | Per-repaint draw-cost + decimation stats (`ChartContainer` `onDrawStats`) | `packages/charts/src/context.ts` |
|
|
415
|
+
| `TimeGrain` | Coarse time unit for grain-aware formatting | `packages/charts/src/tickLadder.ts` |
|
|
416
|
+
| `SwatchSpec` / `LegendItemInput` | Legend swatch vocabulary + explicit-rows input (`<Legend items>`) | `packages/charts/src/swatch.ts` |
|
|
417
|
+
| `useChartLegend` | Headless legend hook: rows (items grouped by chart row) + `hover`/`select` verbs | `packages/charts/src/useChartLegend.ts` |
|
|
418
|
+
| `ChartLegend` / `LegendRow` / `LegendItem` | The hook's return shape (`rows` group `items`; items carry `selected`/`hovered`) | `packages/charts/src/useChartLegend.ts` |
|
|
419
|
+
| `useChartFrame` | Resolved plot geometry: plot rect, gutters, x scale, a row's y scales, band slot edges | `packages/charts/src/useChartFrame.ts` |
|
|
420
|
+
| `ChartFrame` / `ChartFrameRow` | The hook's return shape — container x half, plus a row y half that is `null` outside a `<ChartRow>` | `packages/charts/src/useChartFrame.ts` |
|
|
421
|
+
| `ChartBands` / `ChartBand` | Ordinal slot geometry on a category axis (`count`/`pitch`/`labels`/`at(i)`); `null` on time/value | `packages/charts/src/useChartFrame.ts` |
|
|
422
|
+
| `ChartXScale` | The union the container's shared x scale resolves to (time / linear / trading / band / elapsed) | `packages/charts/src/context.ts` |
|
|
423
|
+
| `LegendPlacement` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `packages/charts/src/Legend.tsx` |
|
|
424
|
+
| `Curve` | Path interpolation: `'linear' \| 'monotone' \| 'natural' \| 'basis' \| 'step'` | `packages/charts/src/curve.ts` |
|
|
425
|
+
| `RadiusEncoding` / `ColorEncoding` | Data-driven scatter size/colour | `packages/charts/src/encoding.ts` |
|
|
426
|
+
| `CandleVariant` / `ColorBy` | OHLC mark shape / colouring strategy | `packages/charts/src/ohlc.ts` |
|
|
427
|
+
| `AxisFormat` / `CursorFormat` | Tick and cursor-readout formatting (d3 specifier or fn) | `packages/charts/src/format.ts` |
|
|
428
|
+
| `AxisTransform` | Monotonic `to`/`from` pair for derived-unit x-axis relabeling | `packages/charts/src/derivedTicks.ts` |
|
|
429
|
+
| `AxisMouseEvent` / `AxisMouseHandler` | Axis `onMouseEvent` payload — the mouse event, the axis's `id`, and the value/label under the pointer | `packages/charts/src/axis-events.ts` |
|
|
430
|
+
| `Orientation` | Bar growth direction | `packages/charts/src/bars.ts` |
|
|
427
431
|
|
|
428
432
|
---
|
|
429
433
|
|
|
@@ -618,16 +622,16 @@ erased types. A separate subpath: importing it pulls in every study.
|
|
|
618
622
|
|
|
619
623
|
### Trading calendars & sessions
|
|
620
624
|
|
|
621
|
-
| Export | Purpose
|
|
622
|
-
| ------------------------------------------------------------------------ |
|
|
623
|
-
| `TradingCalendar` |
|
|
624
|
-
| `generateSessions` | `Session[]` from `SessionRules` over a date range (DST-correct)
|
|
625
|
-
| `normalizeSessions` | Validate + sort an explicit session list
|
|
626
|
-
| `identityDiscontinuity` / `segmentDiscontinuity` / `weekendSkip` | `DiscontinuityProvider`s for the trading-time axis
|
|
627
|
-
| Types | `Session`, `SessionBreak`, `SessionRules`, `DateRange`, `InstantRange`, `TaggedSchema`, `LiveSegment`, `DiscontinuityProvider`
|
|
628
|
-
| `SessionSource` / `SessionAnchorOptions` | The session-anchored studies' input: `TradingCalendar \| Session[]` (`sessions`), or a session-id column name (`session`), plus `stamped`
|
|
629
|
-
| `PIVOT_METHODS` / `PivotMethod` | The four pivot formula sets (`standard`, `fibonacci`, `woodie`, `camarilla`)
|
|
630
|
-
| `PivotPointsSchema` / `CamarillaPivotPointsSchema` / `PivotPointsResult` | `pivotPoints`' method-dependent appended-schema types (7 columns, or 9 for Camarilla)
|
|
625
|
+
| Export | Purpose | Source |
|
|
626
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
627
|
+
| `TradingCalendar` | `timeZone` (the exchange zone: `fromRules`' `rules.timeZone`, or `fromSessions(list, { timeZone })`) + query API: `.sessions()`, `.sessionOn()`, `.isTradingDay()`, `.isOpen()`, `.sessionsInRange()`, `.sessionSequence()`, `.barSequence(period)`, `.tagSessions()`, `.discontinuities()` | `packages/financial/src/calendar/` |
|
|
628
|
+
| `generateSessions` | `Session[]` from `SessionRules` over a date range (DST-correct) | `packages/financial/src/calendar/` |
|
|
629
|
+
| `normalizeSessions` | Validate + sort an explicit session list | `packages/financial/src/calendar/` |
|
|
630
|
+
| `identityDiscontinuity` / `segmentDiscontinuity` / `weekendSkip` | `DiscontinuityProvider`s for the trading-time axis | `packages/financial/src/calendar/` |
|
|
631
|
+
| Types | `Session`, `SessionBreak`, `SessionRules`, `DateRange`, `InstantRange`, `TaggedSchema`, `LiveSegment`, `DiscontinuityProvider` | `packages/financial/src/calendar/` |
|
|
632
|
+
| `SessionSource` / `SessionAnchorOptions` | The session-anchored studies' input: `TradingCalendar \| Session[]` (`sessions`), or a session-id column name (`session`), plus `stamped` | `packages/financial/src/contract/session-anchor.ts` |
|
|
633
|
+
| `PIVOT_METHODS` / `PivotMethod` | The four pivot formula sets (`standard`, `fibonacci`, `woodie`, `camarilla`) | `packages/financial/src/kernels/pivot.ts` |
|
|
634
|
+
| `PivotPointsSchema` / `CamarillaPivotPointsSchema` / `PivotPointsResult` | `pivotPoints`' method-dependent appended-schema types (7 columns, or 9 for Camarilla) | `packages/financial/src/studies/pivot-points.ts` |
|
|
631
635
|
|
|
632
636
|
### Contract & constants
|
|
633
637
|
|
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,8 @@ The `@pond-ts` packages — `pond-ts`, `@pond-ts/react`, `@pond-ts/charts`,
|
|
|
8
8
|
under a single `v*` tag, so this file covers them all. Pre-1.0: minor bumps may
|
|
9
9
|
include new features and type-level changes; patch bumps are strictly additive.
|
|
10
10
|
|
|
11
|
-
[Unreleased]: https://github.com/pond-ts/pond/compare/v0.
|
|
11
|
+
[Unreleased]: https://github.com/pond-ts/pond/compare/v0.69.0...HEAD
|
|
12
|
+
[0.69.0]: https://github.com/pond-ts/pond/compare/v0.68.0...v0.69.0
|
|
12
13
|
[0.68.0]: https://github.com/pond-ts/pond/compare/v0.67.0...v0.68.0
|
|
13
14
|
[0.67.0]: https://github.com/pond-ts/pond/compare/v0.66.0...v0.67.0
|
|
14
15
|
[0.66.0]: https://github.com/pond-ts/pond/compare/v0.65.0...v0.66.0
|
|
@@ -71,6 +72,85 @@ include new features and type-level changes; patch bumps are strictly additive.
|
|
|
71
72
|
|
|
72
73
|
## [Unreleased]
|
|
73
74
|
|
|
75
|
+
## [0.69.0] — 2026-09-13
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- **`<ChartContainer timeZone>` — the time axis in any IANA zone
|
|
80
|
+
([PND-TZAXIS]).** Day / week / month ticks land on that zone's midnights,
|
|
81
|
+
Mondays and month starts; labels, the stacked date bands, the hierarchical
|
|
82
|
+
grid, session dividers and every cursor / marker / annotation readout read
|
|
83
|
+
in it. **Omitted ⇒ the viewer's zone**, exactly as before. The d3 specifier
|
|
84
|
+
strings on `timeFormat` / `cursorFormat` are unchanged; `%Z` / `%z` now read
|
|
85
|
+
the zone's abbreviation / offset. Sub-day ticks align to the zone's wall
|
|
86
|
+
clock, so a 6 h grain reads 00 / 06 / 12 / 18 across a DST jump instead of
|
|
87
|
+
drifting by an hour until the next midnight. The resolved zone is on the
|
|
88
|
+
chart context as `timeZone`. Built on core's `TimeZone` ([PND-TZCAL]), so a
|
|
89
|
+
`Sequence.calendar('day', { timeZone })` bucket edge and the tick that
|
|
90
|
+
labels it are one instant — pinned by a cross-package test.
|
|
91
|
+
- **`<XAxis timeZone>` — a second strip in another zone.** Two time axes
|
|
92
|
+
over one shared mapping, each ticking and labelling (and pilling) in its
|
|
93
|
+
own zone: `<XAxis side="top" timeZone="America/New_York" />` above a
|
|
94
|
+
UTC container's own strip below. Backed by
|
|
95
|
+
`TradingTimeScale.withTimeZone(zone)` / `.timeZone()` and an optional
|
|
96
|
+
`DiscontinuityProvider.withTimeZone` (the identity provider re-derives its
|
|
97
|
+
day anchors; a trading calendar's session opens are zone-independent).
|
|
98
|
+
- **`TradingCalendarLike.timeZone?`** — a calendar that carries its exchange
|
|
99
|
+
zone supplies the axis default (`calendar={cal}` renders in exchange time
|
|
100
|
+
wherever it is viewed); an explicit `timeZone` prop wins.
|
|
101
|
+
- `scaleTradingTime(provider, { timeZone })` and
|
|
102
|
+
`identityProvider({ timeZone })` take the zone directly for consumers
|
|
103
|
+
building the scale themselves; `identityProvider`, `TradingCalendarLike`
|
|
104
|
+
and `ScaleTimeZoneOptions` are now exported. Internally the tick ladder
|
|
105
|
+
runs on a `TickCalendar` seam whose local implementation is the previous
|
|
106
|
+
`Date` arithmetic verbatim — the default path is unchanged.
|
|
107
|
+
- **`TradingCalendar.timeZone` ([PND-TZFIN]).** `@pond-ts/financial`'s
|
|
108
|
+
calendar keeps the zone its sessions were resolved in — `fromRules` carries
|
|
109
|
+
`rules.timeZone`, `fromSessions(list, { timeZone })` takes it — so
|
|
110
|
+
`<ChartContainer calendar={cal}>` renders the axis in exchange time with no
|
|
111
|
+
further wiring.
|
|
112
|
+
- `@pond-ts/charts` now depends on `d3-time-format` directly (it was already
|
|
113
|
+
a transitive dependency via `d3-scale`).
|
|
114
|
+
- **`TimeZone` — the zone-calendar primitive ([PND-TZCAL]).** `pond-ts`
|
|
115
|
+
exports `TimeZone.of(id)` (interned; also `TimeZone.UTC`,
|
|
116
|
+
`TimeZone.local()`) with `startOf(unit, t)`, `next(unit, t)`, `parts(t)`,
|
|
117
|
+
`instant(parts, { disambiguation })`, `offsetAt(t)` and
|
|
118
|
+
`abbreviation(t, { locale })`. Temporal underneath, but each zone caches its
|
|
119
|
+
offset transitions as it discovers them, so steady-state calls are integer
|
|
120
|
+
arithmetic: `startOf('day')` went from ~24 µs to ~23 ns per call, and a
|
|
121
|
+
three-year hourly series aggregated to `America/New_York` days from 38 ms
|
|
122
|
+
to 0.5 ms. `Sequence.calendar`, `TimeRange.fromCalendar` and
|
|
123
|
+
`Interval.fromCalendar` now bucket through it (no behaviour change; pinned
|
|
124
|
+
against Temporal on eight zones including southern-hemisphere DST, a
|
|
125
|
+
30-minute DST shift, a +05:30 zone, a day with no midnight and Samoa's
|
|
126
|
+
skipped day). This is the primitive the charts' time axis will place and
|
|
127
|
+
label ticks with, so a bucket edge and the tick that labels it are one
|
|
128
|
+
instant. First task of the time-zone plan
|
|
129
|
+
(`docs/plans/PND_TIMEZONE_PLAN.md`).
|
|
130
|
+
- **`CalendarUnit` gains `'quarter'` and `'year'`** for
|
|
131
|
+
`Sequence.calendar`, `TimeRange.fromCalendar` and `Interval.fromCalendar`.
|
|
132
|
+
|
|
133
|
+
### Changed
|
|
134
|
+
|
|
135
|
+
- **`Sequence.calendar` validates its inputs at construction.** An unknown
|
|
136
|
+
unit (`'hour'`) or zone (`'Nowhere'`) now throws `RangeError` immediately;
|
|
137
|
+
before, an unknown unit silently produced wrong buckets (the two unit
|
|
138
|
+
dispatchers fell through to different defaults — the 2026-06 audit's §6
|
|
139
|
+
finding) and an unknown zone failed only on first `bounded()`.
|
|
140
|
+
|
|
141
|
+
### Fixed
|
|
142
|
+
|
|
143
|
+
- **`pond-ts`: two type-level corners of [PND-PARTCOL] (0.68.0) found by the Codex pass on #724.** (1) On a broad `TimeSeries<SeriesSchema>` with a _literal_ partition column, the injected `'first'` could not look up a kind and typed the column as `undefined`; `WithPartitionColumns` now takes the schema and leaves the mapping alone when the schema is broad, so the result type is exactly 0.67's. (2) `By` had no variance pin, so `PartitionedTimeSeries<S, K, 'host'>` accepted a view partitioned by `region` (and an untyped view could be narrowed to any column); a phantom contravariant member now rejects both while a specialised view still assigns to the legacy `PartitionedTimeSeries<S>` shape. Type tests cover both plus the `K`-survives-`smooth`/`baseline` claim. No runtime change.
|
|
144
|
+
- **Docs said a wall-clock string without `parse.timeZone` throws. It never
|
|
145
|
+
did** ([PND-TZDOCS]) — it is read as UTC, silently. `creating.mdx`, the
|
|
146
|
+
agent guide (`AGENTS.md`) and the decision table now say so and describe
|
|
147
|
+
how the shift shows up. The agent guide also gains the one time-zone rule:
|
|
148
|
+
pass the same `timeZone` to `Sequence.calendar` and `<ChartContainer>`.
|
|
149
|
+
The aggregation page cross-links `Sequence.calendar` for weekly / monthly
|
|
150
|
+
bars (issue #358 item 1, supersedes #359). The finance gallery's off-chart
|
|
151
|
+
readout takes the calendar's zone instead of hard-coding New York; the
|
|
152
|
+
Niño 3.4 heat map's year grain uses `Sequence.calendar('year')`.
|
|
153
|
+
|
|
74
154
|
## [0.68.0] — 2026-09-13
|
|
75
155
|
|
|
76
156
|
### Added
|
package/README.md
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
# pond-ts
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/pond-ts)
|
|
4
|
+
[](https://github.com/pond-ts/pond/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/pond-ts/pond/blob/main/LICENSE)
|
|
6
|
+
[](https://pond-ts.org)
|
|
7
|
+
|
|
3
8
|
**Highly optimised, fully typed Timeseries library for TypeScript**
|
|
4
9
|
|
|
5
10
|
Schema-driven events, composable batch transforms, push-based streaming
|
|
6
|
-
ingest, multi-entity partitioning
|
|
7
|
-
|
|
11
|
+
ingest, multi-entity partitioning — and, optionally, React hooks and
|
|
12
|
+
canvas charts that read the series directly. All strict TypeScript end to
|
|
13
|
+
end, all immutable.
|
|
8
14
|
|
|
9
15
|
**pond-ts** is the TypeScript-first successor to
|
|
10
16
|
[pondjs](https://github.com/esnet/pond), rewritten from scratch with a
|
|
11
17
|
focus on type safety, composability, and the live-streaming patterns
|
|
12
18
|
that pondjs never grew.
|
|
13
19
|
|
|
20
|
+
## The packages
|
|
21
|
+
|
|
22
|
+
Three packages carry most projects. The core has no dependency on the other
|
|
23
|
+
two; add them only if you render.
|
|
24
|
+
|
|
25
|
+
| Package | What it is | Needs |
|
|
26
|
+
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
|
|
27
|
+
| **[`pond-ts`](https://www.npmjs.com/package/pond-ts)** — core | `TimeSeries` (batch) and `LiveSeries` (streaming) with one operator vocabulary: aggregate, rolling, align, fill, partition, join, typed columns. Node or browser, no React. | nothing |
|
|
28
|
+
| **[`@pond-ts/charts`](https://www.npmjs.com/package/@pond-ts/charts)** — optional | Declarative React charts on a canvas data plane that consume a pond series with no adapter: line, area, band, bar, scatter, box, candlestick, heat map; cursors, selection, pan/zoom, annotations. | `pond-ts`, `@pond-ts/react`, React 18/19 |
|
|
29
|
+
| **[`@pond-ts/react`](https://www.npmjs.com/package/@pond-ts/react)** — optional | Hooks to own a series in a component and read live views on a throttled snapshot cadence (`useLiveSeries`, `useSnapshot`, …). | `pond-ts`, React 18/19 |
|
|
30
|
+
|
|
14
31
|
```sh
|
|
15
|
-
npm install pond-ts
|
|
16
|
-
npm install @pond-ts/react
|
|
32
|
+
npm install pond-ts # core — enough for Node pipelines and non-React apps
|
|
33
|
+
npm install @pond-ts/charts @pond-ts/react pond-ts # add the React chart stack
|
|
17
34
|
```
|
|
18
35
|
|
|
36
|
+
Two domain packages ([`@pond-ts/financial`](#domain-packages) for markets,
|
|
37
|
+
[`@pond-ts/fit`](#domain-packages) for activity data) and one experimental
|
|
38
|
+
runtime ([`@pond-ts/process`](#domain-packages)) sit on top — see
|
|
39
|
+
[Domain packages](#domain-packages) below. All six release together under
|
|
40
|
+
one version; keep them in step.
|
|
41
|
+
|
|
19
42
|
- **Typed schemas** — declare once, every transform downstream narrows
|
|
20
43
|
off it. `event.get('cpu')` returns `number | undefined` straight from
|
|
21
44
|
the schema; no `as` casts.
|
|
@@ -108,6 +131,43 @@ The full live surface (`filter`, `map`, `select`, `window`, `aggregate`,
|
|
|
108
131
|
`sample`) is incremental — events flow, views emit, retention bounds
|
|
109
132
|
memory.
|
|
110
133
|
|
|
134
|
+
## Quick start: charts (React)
|
|
135
|
+
|
|
136
|
+
`@pond-ts/charts` reads a `TimeSeries` or `LiveSeries` directly — do the maths
|
|
137
|
+
in pond, hand the result to a layer. Rows share one x scale, so they pan,
|
|
138
|
+
zoom and track the cursor together.
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
import {
|
|
142
|
+
BandChart,
|
|
143
|
+
ChartContainer,
|
|
144
|
+
ChartRow,
|
|
145
|
+
Layers,
|
|
146
|
+
LineChart,
|
|
147
|
+
YAxis,
|
|
148
|
+
} from '@pond-ts/charts';
|
|
149
|
+
|
|
150
|
+
// `bands` is the baseline() result from the batch quick start:
|
|
151
|
+
// cpu + avg / sd / upper / lower columns.
|
|
152
|
+
export function CpuChart({ width }: { width: number }) {
|
|
153
|
+
return (
|
|
154
|
+
<ChartContainer width={width} cursor="crosshair" panZoom>
|
|
155
|
+
<ChartRow height={240}>
|
|
156
|
+
<YAxis id="cpu" format=".0%" />
|
|
157
|
+
<Layers>
|
|
158
|
+
<BandChart series={bands} lower="lower" upper="upper" axis="cpu" />
|
|
159
|
+
<LineChart series={bands} column="cpu" axis="cpu" />
|
|
160
|
+
</Layers>
|
|
161
|
+
</ChartRow>
|
|
162
|
+
</ChartContainer>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Pass `width="auto"` to measure the parent instead. Live data renders through
|
|
168
|
+
the same layers: own the series with `useLiveSeries` from `@pond-ts/react`
|
|
169
|
+
and pass its snapshot as `series`.
|
|
170
|
+
|
|
111
171
|
## Quick start: multi-entity
|
|
112
172
|
|
|
113
173
|
`partitionBy` routes events into per-key buffers. Every stateful
|
|
@@ -182,6 +242,26 @@ it is behind. Run locally:
|
|
|
182
242
|
npm run build && node packages/core/bench/vs-pondjs.cjs
|
|
183
243
|
```
|
|
184
244
|
|
|
245
|
+
## Domain packages
|
|
246
|
+
|
|
247
|
+
Optional, domain-specific, all on plain pond series:
|
|
248
|
+
|
|
249
|
+
- **[`@pond-ts/financial`](https://www.npmjs.com/package/@pond-ts/financial)**
|
|
250
|
+
— sixty-plus oracle-verified technical studies (SMA, EMA, RSI, MACD,
|
|
251
|
+
Bollinger, ATR, VWAP, …) that append columns to a bar series, a fluent
|
|
252
|
+
`bars.sma({ period: 20 }).rsi({ period: 14 })` form, and a
|
|
253
|
+
`TradingCalendar` so session-aligned bars, rolling windows and chart axes
|
|
254
|
+
stop at the close.
|
|
255
|
+
- **[`@pond-ts/fit`](https://www.npmjs.com/package/@pond-ts/fit)** — fitness
|
|
256
|
+
and activity analytics: typed quantities with units, canonical activity
|
|
257
|
+
series, geo (distance, elevation, best efforts), power (NP / IF / TSS,
|
|
258
|
+
curves), heart-rate zones, splits.
|
|
259
|
+
- **[`@pond-ts/process`](https://www.npmjs.com/package/@pond-ts/process)** —
|
|
260
|
+
**experimental.** Computations as data: processing graphs authored fluently
|
|
261
|
+
or composed as JSON, resolved against a declared op vocabulary with
|
|
262
|
+
content-addressed caching, provenance and per-node timings. The API is
|
|
263
|
+
expected to move.
|
|
264
|
+
|
|
185
265
|
## Documentation
|
|
186
266
|
|
|
187
267
|
The full guide is at **<https://pond-ts.org/>**.
|
|
@@ -233,20 +313,22 @@ the loop:
|
|
|
233
313
|
|
|
234
314
|
## Develop
|
|
235
315
|
|
|
236
|
-
The repo is an npm-workspaces monorepo with
|
|
237
|
-
(`pond-ts`, `@pond-ts/react
|
|
316
|
+
The repo is an npm-workspaces monorepo with six published packages
|
|
317
|
+
(`pond-ts`, `@pond-ts/react`, `@pond-ts/charts`, `@pond-ts/financial`,
|
|
318
|
+
`@pond-ts/fit`, `@pond-ts/process`). Node 18+ for runtime; Node 20+ for the
|
|
238
319
|
docs site (Docusaurus).
|
|
239
320
|
|
|
240
321
|
```sh
|
|
241
|
-
npm install # one-time, hoists deps for
|
|
322
|
+
npm install # one-time, hoists deps for all packages
|
|
242
323
|
npm run build # build both packages
|
|
243
324
|
npm test # runtime + type-level tests on both packages
|
|
244
325
|
npm run format # prettier write across the repo
|
|
245
326
|
npm run verify # format check + build + test (CI parity)
|
|
246
327
|
```
|
|
247
328
|
|
|
248
|
-
`packages
|
|
249
|
-
|
|
329
|
+
Each package lives under `packages/<name>/` (`core` is `pond-ts`, the rest
|
|
330
|
+
match their scoped names). Docs live in `website/` — its own npm root, not a
|
|
331
|
+
workspace.
|
|
250
332
|
|
|
251
333
|
## License
|
|
252
334
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pond-ts/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.0",
|
|
4
4
|
"description": "React hooks for pond-ts: subscribe to LiveSeries and derived views with throttled snapshots",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"time-series",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"test:runtime": "vitest run"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"pond-ts": "^0.
|
|
55
|
+
"pond-ts": "^0.69.0",
|
|
56
56
|
"react": "^18.0.0 || ^19.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|