@pond-ts/process 0.58.0 → 0.59.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/API.md +576 -0
- package/CHANGELOG.md +144 -1
- package/package.json +5 -4
package/API.md
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
# API.md — public API map for agents
|
|
2
|
+
|
|
3
|
+
A fast-navigation map of every public export across pond's six packages,
|
|
4
|
+
written **for coding agents**. Use it to find the right primitive and the file
|
|
5
|
+
it lives in without crawling `src/`. It is a map, not a reference: one line per
|
|
6
|
+
export, grouped by purpose, with the source path. Verify exact signatures in
|
|
7
|
+
the listed source file (or the generated typedoc) before writing code against
|
|
8
|
+
them.
|
|
9
|
+
|
|
10
|
+
**This file ships inside every `pond-ts` / `@pond-ts/*` npm package**, so an
|
|
11
|
+
agent working in a consuming repo has the whole export surface locally — no
|
|
12
|
+
network, no crawling `node_modules/*/dist/*.d.ts`. Every package carries the
|
|
13
|
+
same monorepo-wide copy on purpose: the packages compose, so knowing what is
|
|
14
|
+
next door is the point.
|
|
15
|
+
|
|
16
|
+
- **Authority**: each package's `src/index.ts` is the export surface. If this
|
|
17
|
+
file and `index.ts` disagree, `index.ts` wins.
|
|
18
|
+
- **Source paths** (`packages/core/src/…`) are repo-relative. From a consuming
|
|
19
|
+
repo, read them on GitHub:
|
|
20
|
+
<https://github.com/pond-ts/pond/blob/main/>`<path>`.
|
|
21
|
+
- **Human-facing docs**: <https://pond-ts.org> — narrative guides, per-feature
|
|
22
|
+
reference, and generated typedoc per package. This file is the agent-facing
|
|
23
|
+
complement, not a replacement.
|
|
24
|
+
- **Contributing to pond itself**: when a PR adds, removes, or renames a public
|
|
25
|
+
export, update the matching row here in that PR — CI enforces it (the
|
|
26
|
+
`API map` workflow).
|
|
27
|
+
|
|
28
|
+
| Package | npm name | Entry points | Docs hub |
|
|
29
|
+
| -------------------- | -------------------- | ------------------------------------------------------ | ------------------------- |
|
|
30
|
+
| `packages/core` | `pond-ts` | `.` and `./types` (zero-runtime schema contract) | `website/docs/pond-ts/` |
|
|
31
|
+
| `packages/react` | `@pond-ts/react` | `.` | `website/docs/react/` |
|
|
32
|
+
| `packages/charts` | `@pond-ts/charts` | `.` | `website/docs/charts/` |
|
|
33
|
+
| `packages/financial` | `@pond-ts/financial` | `.` and `./fluent` (prototype augmentation) | `website/docs/financial/` |
|
|
34
|
+
| `packages/fit` | `@pond-ts/fit` | `.` | `website/docs/fit/` |
|
|
35
|
+
| `packages/process` | `@pond-ts/process` | `.` and `./pool` (Node worker pool) — **experimental** | `website/docs/process/` |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## pond-ts (core) — batch
|
|
40
|
+
|
|
41
|
+
### Series classes & construction
|
|
42
|
+
|
|
43
|
+
| Export | Purpose | Source |
|
|
44
|
+
| ----------------------- | ------------------------------------------------------ | ---------------------------------------------------- |
|
|
45
|
+
| `TimeSeries` | Immutable time-indexed collection, columnar storage | `packages/core/src/batch/time-series.ts` |
|
|
46
|
+
| `ValueSeries` | Series keyed by a monotonic non-time value axis | `packages/core/src/batch/value-series.ts` |
|
|
47
|
+
| `PartitionedTimeSeries` | Scoped view for per-partition stateful transforms | `packages/core/src/batch/partitioned-time-series.ts` |
|
|
48
|
+
| `Sequence` | Infinite grid of time buckets (daily, hourly, every N) | `packages/core/src/sequence/sequence.ts` |
|
|
49
|
+
| `BoundedSequence` | Finite ordered list of explicit interval buckets | `packages/core/src/sequence/bounded-sequence.ts` |
|
|
50
|
+
|
|
51
|
+
Static constructors on `TimeSeries`: `fromJSON()` (row tuples/objects),
|
|
52
|
+
`fromColumns()` (struct-of-arrays; `number` + `string` value columns),
|
|
53
|
+
`fromArrow()` (bring-your-own Apache Arrow `Table`; zero-copy Float64 adopt +
|
|
54
|
+
BigInt-free int64 time. Readable Arrow types are an **allowlist checked
|
|
55
|
+
against each field's declared type** — `Int`, `Float32`/`Float64`, `Date`,
|
|
56
|
+
`Time`, `Timestamp`, `Utf8`/`Utf8View`, `Null`, and a `Dictionary` of any of
|
|
57
|
+
those — and anything else, notably `Decimal` and `Float16`, is refused by name
|
|
58
|
+
rather than misread; see
|
|
59
|
+
`packages/core/src/batch/operators/arrow-types.ts`), `fromEvents()`,
|
|
60
|
+
`fromPoints()` (wide rows with `ts`), `concat()`, `joinMany()`. On
|
|
61
|
+
`ValueSeries`, the same three shapes keyed on the axis instead of time:
|
|
62
|
+
`fromJSON()`, `fromColumns()`, `fromArrow()` (`{ axis }` is required — no
|
|
63
|
+
`'time'` field convention to fall back on, and no unit scaling). Arrow-ingest
|
|
64
|
+
types (`ArrowTableLike`, `ArrowVectorLike`, `ArrowDataLike`, `ArrowFieldLike`,
|
|
65
|
+
`ArrowSchemaLike`, `ArrowTimeUnit`, `FromArrowOptions`,
|
|
66
|
+
`FromArrowValueOptions`) live in
|
|
67
|
+
`packages/core/src/batch/operators/from-arrow.ts`.
|
|
68
|
+
|
|
69
|
+
Both classes also export **columnar JSON** — `toColumns()`, one plain array
|
|
70
|
+
per column with gaps as `null`, the exact `{ name, schema, columns }` envelope
|
|
71
|
+
`fromColumns()` takes back (`packages/core/src/batch/operators/to-columns.ts`).
|
|
72
|
+
A **two-edged key** (`timeRange` / `interval`) flattens into extra columns
|
|
73
|
+
named off it — `timeRange` + `timeRangeEnd`, `interval` + `intervalEnd` +
|
|
74
|
+
`intervalLabel` — the convention `toArrow` already emitted, now read by
|
|
75
|
+
`fromColumns` and by `fromArrow({ keyKind })` as well
|
|
76
|
+
(`packages/core/src/batch/operators/flat-keys.ts` owns the naming + collision
|
|
77
|
+
rules). Columnar wire types live beside their row siblings:
|
|
78
|
+
`TimeSeriesJsonColumns` / `FlatKeyColumns` / `TimeSeriesColumnarInput` /
|
|
79
|
+
`TimeSeriesColumnarOutput` in `packages/core/src/schema/json.ts`.
|
|
80
|
+
|
|
81
|
+
Going the other way, `TimeSeries.toArrow()` / `ValueSeries.toArrow()` export
|
|
82
|
+
the columns **in Arrow's memory layout with no copy** — pond's validity bitmap
|
|
83
|
+
is already LSB-first one-bit-per-value, numerics are a contiguous
|
|
84
|
+
`Float64Array`, booleans a packed bitmap, dict-encoded strings `Int32Array`
|
|
85
|
+
indices plus a dictionary. It returns `{ length, fields }` rather than an Arrow
|
|
86
|
+
`Table` (pond doesn't depend on `apache-arrow`; the caller assembles with
|
|
87
|
+
`makeData`/`makeVector`), so another columnar engine is a buffer handoff
|
|
88
|
+
instead of a re-ingest. Arrow-export types (`ArrowExport`, `ArrowExportField`,
|
|
89
|
+
`ArrowExportType`, `ToArrowOptions`) live in
|
|
90
|
+
`packages/core/src/batch/operators/to-arrow.ts`.
|
|
91
|
+
|
|
92
|
+
`ValueSeries` also exports rows (`toRows()`, `toObjects()`, `toJSON()`).
|
|
93
|
+
Value-axis wire types
|
|
94
|
+
(`ValueSeriesJsonInput`, `ValueSeriesJsonRow`, `ValueSeriesJsonObjectRow`,
|
|
95
|
+
`ValueSeriesJsonOutputArray`, `ValueSeriesJsonOutputObject`,
|
|
96
|
+
`ValueSeriesJsonCell`, `ValueSeriesRow`, `ValueSeriesObjectRow`,
|
|
97
|
+
`ValueSeriesJsonColumns`, `ValueSeriesColumnarInput`,
|
|
98
|
+
`ValueSeriesColumnarOutput`) live in `packages/core/src/schema/value-io.ts`.
|
|
99
|
+
|
|
100
|
+
### Temporal keys & events
|
|
101
|
+
|
|
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
|
+
| `Event` | Immutable event: temporal key + typed payload | `packages/core/src/core/event.ts` |
|
|
108
|
+
| `toTimeRange` | Coerce temporal values to `TimeRange` | `packages/core/src/core/time-range.ts` |
|
|
109
|
+
|
|
110
|
+
### TimeSeries methods (all in `packages/core/src/batch/time-series.ts`)
|
|
111
|
+
|
|
112
|
+
- **Query**: `at()`, `first()`, `last()`, `bisect(key)`, `includesKey(key)`,
|
|
113
|
+
`atOrBefore(key)`, `atOrAfter(key)`, `nearest(key)`, `find()`, `some()`,
|
|
114
|
+
`every()`
|
|
115
|
+
- **Export/access**: `column(name)`, `keyColumn()`, `toRows()`, `toObjects()`,
|
|
116
|
+
`toArray()`, `toJSON()`, `toColumns()`, `toArrow()`, `toPoints()`
|
|
117
|
+
- **Temporal range**: `timeRange()`, `overlaps()`, `contains()`,
|
|
118
|
+
`intersection()`, `overlapping(range)`, `containedBy(range)`, `trim(range)`,
|
|
119
|
+
`after()`, `before()`, `within()`, `tail(duration)`
|
|
120
|
+
- **Key-type conversion**: `asTime({ at })`, `asTimeRange()`, `asInterval()`
|
|
121
|
+
- **Filter/slice**: `filter()`, `sample(strategy)`, `slice(begin, end)`
|
|
122
|
+
- **Column reshape**: `select()`, `rename()`, `map()`, `mapColumns()`,
|
|
123
|
+
`withColumn()`, `collapse()`
|
|
124
|
+
- **Array columns**: `arrayContains()`, `arrayContainsAll()`,
|
|
125
|
+
`arrayContainsAny()`, `arrayAggregate()`, `arrayExplode()`
|
|
126
|
+
- **Gap fill / dedupe**: `fill()`, `materialize()`, `dedupe()`
|
|
127
|
+
- **Aggregate/group**: `aggregate(sequence, spec)`, `reduce()`, `groupBy()`,
|
|
128
|
+
`partitionBy()`, `byColumn()` (order-free, by column value),
|
|
129
|
+
`rollingByColumn()`, `byValue(axis)` (project onto a `ValueSeries`)
|
|
130
|
+
- **Windowing/smoothing**: `rolling(window, spec, opts)`, `smooth(column,
|
|
131
|
+
method)` (EMA / Butterworth / Savitzky-Golay), `align(method, opts)`
|
|
132
|
+
- **Differential/statistical**: `diff()`, `rate()`, `pctChange()`,
|
|
133
|
+
`cumulative()`, `scan()` (custom stateful reducer), `shift()`, `baseline()`
|
|
134
|
+
(rolling avg/sd/bands), `outliers()` (deviation from baseline)
|
|
135
|
+
- **Join/pivot**: `join(other, opts)`, `pivotByGroup(group, opts)`
|
|
136
|
+
|
|
137
|
+
### ValueSeries methods (all in `packages/core/src/batch/value-series.ts`)
|
|
138
|
+
|
|
139
|
+
Deliberately small — the ordering-based slice of the algebra, no calendar ops
|
|
140
|
+
(see `docs/rfcs/value-axis.md`) — except for ingest/export, which is at full
|
|
141
|
+
`TimeSeries` parity.
|
|
142
|
+
|
|
143
|
+
- **Query/read**: `length`, `axisName`, `axisValues()`, `axisAt(i)`,
|
|
144
|
+
`column(name)`, `nearestIndex(value)`, `sliceByValue(lo, hi)`
|
|
145
|
+
- **Export**: `toRows()`, `toObjects()`, `toJSON({ rowFormat })`,
|
|
146
|
+
`toColumns()`, `toArrow(opts)`
|
|
147
|
+
|
|
148
|
+
### Columnar layer & support
|
|
149
|
+
|
|
150
|
+
| Export | Purpose | Source |
|
|
151
|
+
| ---------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------------------------------- |
|
|
152
|
+
| `Float64Column` / `StringColumn` / `BooleanColumn` / `ArrayColumn` | Packed value-column storage per kind | `packages/core/src/columnar/` |
|
|
153
|
+
| `ChunkedFloat64Column` / `ChunkedStringColumn` / `ChunkedBooleanColumn` / `ChunkedArrayColumn` | Chunked variants (variable-length buffers) | `packages/core/src/columnar/chunked-column.ts` |
|
|
154
|
+
| `TimeKeyColumn` / `TimeRangeKeyColumn` / `IntervalKeyColumn` / `ValueKeyColumn` | Key-column storage per key kind | `packages/core/src/columnar/key-column.ts` |
|
|
155
|
+
| `top` | Reducer factory: top-N values | `packages/core/src/reducers/top.ts` |
|
|
156
|
+
| `ValidationError` | Error class thrown on invalid input | `packages/core/src/core/errors.ts` |
|
|
157
|
+
|
|
158
|
+
### Key exported types (batch)
|
|
159
|
+
|
|
160
|
+
| Type group | Names | Source |
|
|
161
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
162
|
+
| Schema contract | `SeriesSchema`, `RowForSchema`, `EventForSchema`, `EventDataForSchema`, `EventKeyForSchema`, `TimeSeriesInput`, `TimeSeriesJsonInput` | `packages/core/src/schema/index.ts` |
|
|
163
|
+
| Aggregation specs | `AggregateReducer`, `AggregateMap`, `AggregateOutputMap`, `AggregateSchema`, `BinReducerName`, `BinOutput` | `packages/core/src/schema/index.ts`, `packages/core/src/column.ts` |
|
|
164
|
+
| Operation schemas | `RollingSchema`, `RollingAlignment`, `AlignSchema`, `DiffSchema`, `SmoothSchema`, `SmoothMethod`, `FillStrategy`, `FillMapping` | `packages/core/src/schema/index.ts` |
|
|
165
|
+
| Column/data kinds | `Column`, `KeyColumn`, `ColumnKind`, `ScalarKind`, `ScalarValue`, `ColumnValue`, `ArrayValue`, `ValidityBitmap` | `packages/core/src/columnar/` |
|
|
166
|
+
| JSON wire format | `JsonRowFormat`, `JsonRowForSchema`, `JsonObjectRowForSchema`, `JsonValueForKind`, `JsonTimestampInput`, `JsonTimeRangeInput`, `JsonIntervalInput` | `packages/core/src/schema/index.ts` |
|
|
167
|
+
| Temporal utility | `TemporalLike`, `DurationInput`, `CalendarUnit`, `TimeZoneOptions`, `KeyLike`, `BatchSampleStrategy` | `packages/core/src/core/`, `packages/core/src/sequence/` |
|
|
168
|
+
|
|
169
|
+
The `pond-ts/types` subpath re-exports the schema-as-contract types with zero
|
|
170
|
+
runtime (`packages/core/src/schema/public.ts`).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## pond-ts (core) — live / streaming
|
|
175
|
+
|
|
176
|
+
### Classes
|
|
177
|
+
|
|
178
|
+
| Export | Purpose | Source |
|
|
179
|
+
| ----------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
180
|
+
| `LiveSeries` | Bounded in-memory buffer of time-keyed events with retention | `packages/core/src/live/live-series.ts` |
|
|
181
|
+
| `LiveView` | Stateful transformation view over a live source | `packages/core/src/live/live-view.ts` |
|
|
182
|
+
| `LivePartitionedSeries` | Routes events into per-partition sub-buffers by column value | `packages/core/src/live/live-partitioned-series.ts` |
|
|
183
|
+
| `LivePartitionedView` | Derived per-partition view over a partitioned series | `packages/core/src/live/live-partitioned-series.ts` |
|
|
184
|
+
| `LiveAggregation` | Emits aggregated buckets when `Sequence` boundaries cross | `packages/core/src/live/live-aggregation.ts` |
|
|
185
|
+
| `LiveRollingAggregation` | Single-window rolling aggregation, configurable trigger | `packages/core/src/live/live-rolling-aggregation.ts` |
|
|
186
|
+
| `LiveFusedRolling` | Multi-window rolling, shared deque, single ingest pass | `packages/core/src/live/live-fused-rolling.ts` |
|
|
187
|
+
| `LivePartitionedFusedRolling` | Fused rolling per partition, synchronized emission | `packages/core/src/live/live-partitioned-fused-rolling.ts` |
|
|
188
|
+
| `LiveReduce` | Reduce over current buffer; emits per trigger | `packages/core/src/live/live-reduce.ts` |
|
|
189
|
+
| `LiveColumnGroup` | Zero-copy column gather over a view slice | `packages/core/src/live/live-view.ts` |
|
|
190
|
+
|
|
191
|
+
### Triggers
|
|
192
|
+
|
|
193
|
+
`Trigger` factory (`packages/core/src/live/triggers.ts`): `Trigger.event()`
|
|
194
|
+
(per-event, default), `Trigger.clock(sequence)` (boundary crossing),
|
|
195
|
+
`Trigger.every(duration)` (fixed cadence sugar), `Trigger.count(n)`. Types:
|
|
196
|
+
`EventTrigger`, `ClockTrigger`, `CountTrigger`.
|
|
197
|
+
|
|
198
|
+
### Methods
|
|
199
|
+
|
|
200
|
+
- **`LiveSeries`** — static: `LiveSeries.fromJSON()`; ingest: `push()`,
|
|
201
|
+
`pushMany()`, `pushJson()`; query: same
|
|
202
|
+
key-query set as `TimeSeries` (`at`/`first`/`last`/`find`/`bisect`/
|
|
203
|
+
`atOrBefore`/`atOrAfter`/…); operators: `window()`, `aggregate()`,
|
|
204
|
+
`rolling()`, `reduce()`, `diff()`, `rate()`, `pctChange()`, `fill()`,
|
|
205
|
+
`cumulative()`, `partitionBy()`; snapshots: `toTimeSeries()`, `toRows()`;
|
|
206
|
+
subscription: `on()` (event/batch/evict) → unsubscribe fn; utilities:
|
|
207
|
+
`stats()`, `clear()`, `timeRange()`, `eventRate()`, `length`.
|
|
208
|
+
- **`LiveView`** — transform: `filter()`, `map()`, `select()`, `sample()`;
|
|
209
|
+
plus the same operator/query/snapshot/subscription surface as `LiveSeries`
|
|
210
|
+
(minus ingest).
|
|
211
|
+
- **`LivePartitionedSeries`** — `toMap()` (spawn all partitions), `apply()`
|
|
212
|
+
(per-partition factory), `collect()` (fan-in unified series), `sample()`,
|
|
213
|
+
`stats()`, `on()` (spawn callback).
|
|
214
|
+
|
|
215
|
+
### Key exported types (live)
|
|
216
|
+
|
|
217
|
+
`LiveSeriesOptions` (`name`, `schema`, `ordering: 'strict' | 'drop' |
|
|
218
|
+
'reorder'`, `graceWindow`, `retention: { maxEvents?, maxAge? }`),
|
|
219
|
+
`LivePartitionedOptions`, `LiveAggregationOptions`, `LiveRollingOptions`,
|
|
220
|
+
`RollingWindow`, `LiveFillStrategy`, `LiveFillMapping` — all under
|
|
221
|
+
`packages/core/src/live/`.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## @pond-ts/react
|
|
226
|
+
|
|
227
|
+
All hooks in `packages/react/src/<hookName>.ts`.
|
|
228
|
+
|
|
229
|
+
| Export | Signature gist | Purpose |
|
|
230
|
+
| ---------------- | --------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
231
|
+
| `useLiveSeries` | `useLiveSeries(opts, hookOpts?)` | Create + own a `LiveSeries` for the component lifetime; returns it with a snapshot |
|
|
232
|
+
| `useTimeSeries` | `useTimeSeries(input, key?)` | Memoized `TimeSeries.fromJSON` for static/fetched data |
|
|
233
|
+
| `useSnapshot` | `useSnapshot(source, opts?)` | Subscribe to a live source, return a throttled `TimeSeries` snapshot |
|
|
234
|
+
| `useWindow` | `useWindow(source, size, opts?)` | Windowed view of a live source + throttled snapshot |
|
|
235
|
+
| `useDerived` | `useDerived(series, transform)` | Batch transform of a snapshot, recomputed on change |
|
|
236
|
+
| `useLiveQuery` | `useLiveQuery(build, deps, opts?)` | Build a derived live view, subscribe, return view + snapshot |
|
|
237
|
+
| `useLatest` | `useLatest(source, opts?)` | Only the latest event |
|
|
238
|
+
| `useCurrent` | `useCurrent(source, mapping, opts?)` | Current value of a reducer over the source |
|
|
239
|
+
| `useEventRate` | `useEventRate(source, duration, opts?)` | Events-per-second over a trailing window |
|
|
240
|
+
| `useLiveVersion` | `useLiveVersion(source, opts?)` | Change signal for reading columns without a snapshot |
|
|
241
|
+
| `takeSnapshot` | `takeSnapshot(source)` | Non-hook: snapshot any live source to a `TimeSeries` |
|
|
242
|
+
|
|
243
|
+
Types: `UseSnapshotOptions`, `SnapshotSource` (structural — covers
|
|
244
|
+
`LiveSeries`, `LiveView`, …), `UseCurrentOptions`, `UseLiveVersionOptions`.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## @pond-ts/charts
|
|
249
|
+
|
|
250
|
+
### Components — layout & axes
|
|
251
|
+
|
|
252
|
+
| Component | Key props | Purpose | Source |
|
|
253
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
254
|
+
| `ChartContainer` | `width`, `range?`, `theme?`, `cursor?`, `panZoom?`, `bounds?`, `showAxis?`, `calendar?`, `origin?`, `maxBandWidth?`/`bandAlign?`, `onTrackerChanged?`, `onDrawStats?` | Root: shared x-scale, interactions, annotations | `packages/charts/src/ChartContainer.tsx` |
|
|
255
|
+
| `ChartRow` | `height`, `cursor?` (deprecated — mount a cursor in the row) | One stacked plot band; owns its y-axes | `packages/charts/src/ChartRow.tsx` |
|
|
256
|
+
| `Layers` | children | Mandatory z-stack inside a row (back-to-front) | `packages/charts/src/Layers.tsx` |
|
|
257
|
+
| `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` |
|
|
258
|
+
| `XAxis` | `side?`, `label?`, `format?`, `ticks?`, `transform?`, `dateStyle?` | Placeable x-axis strip; kind inferred from data | `packages/charts/src/XAxis.tsx` |
|
|
259
|
+
| `TimeAxis` / `CategoryAxis` | (XAxis props) | Thin `XAxis` presets | `packages/charts/src/TimeAxis.tsx`, `CategoryAxis.tsx` |
|
|
260
|
+
| `Canvas` | `width`, `height`, `draw` | Low-level DPR-aware canvas primitive | `packages/charts/src/Canvas.tsx` |
|
|
261
|
+
| `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` |
|
|
262
|
+
| `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` |
|
|
263
|
+
|
|
264
|
+
### Components — draw layers
|
|
265
|
+
|
|
266
|
+
All take `series` plus an `as?` style identifier (theme lookup) and `axis?`
|
|
267
|
+
scale id — style and scale are separate channels; there are no per-component
|
|
268
|
+
color props (see Theming).
|
|
269
|
+
|
|
270
|
+
**Column props are schema-derived** ([PND-CHARTAPI]): a name that isn't a
|
|
271
|
+
numeric column of the series fails to compile, and `<BarChart>`'s props are a
|
|
272
|
+
union of its legal source modes, so mixing `series`/`bins`/`categories` or
|
|
273
|
+
`column`/`columns` is a compile error too. Two carve-outs:
|
|
274
|
+
a **loosely-typed** series (`TimeSeries<SeriesSchema>`) still accepts any name
|
|
275
|
+
(`packages/charts/src/column-names.ts` explains the `never` fallback that makes
|
|
276
|
+
this work), and `bins` names stay `string` (they name aggregate fields, not
|
|
277
|
+
schema columns). Because the union splits per series _kind_, a value typed as
|
|
278
|
+
**either** kind must be narrowed or cast at the call site.
|
|
279
|
+
|
|
280
|
+
| Component | Data props | Purpose | Source |
|
|
281
|
+
| -------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------- |
|
|
282
|
+
| `LineChart` | `column`, `gaps?`, `sessionBreaks?` | Gap-aware line | `packages/charts/src/LineChart.tsx` |
|
|
283
|
+
| `AreaChart` | `column`, `baseline?`, `gaps?` | Filled area | `packages/charts/src/AreaChart.tsx` |
|
|
284
|
+
| `BandChart` | `lower`, `upper` | Variance-band envelope | `packages/charts/src/BandChart.tsx` |
|
|
285
|
+
| `ScatterChart` | `column`, `id?` (selection), radius/color encodings | Points; data-driven size/colour | `packages/charts/src/ScatterChart.tsx` |
|
|
286
|
+
| `BarChart` | `column` \| `columns` \| `bins` \| `categories`, `orientation?`, `thresholds?`/`bandColors?` | Bars, stacked bars, histograms, categorical | `packages/charts/src/BarChart.tsx` |
|
|
287
|
+
| `HeatMap` | `series`, `columns` (rows), `colors`, `domain?`, `scale?`, `noData?`, `gap?`, `decimate?`, `orientation?` | Grid of colour-coded cells; bins on x, columns on y | `packages/charts/src/HeatMap.tsx` |
|
|
288
|
+
| `BoxPlot` | `lower`/`q1?`/`median?`/`q3?`/`upper`, `shape?` | Box-and-whisker from quantile columns | `packages/charts/src/BoxPlot.tsx` |
|
|
289
|
+
| `Candlestick` | OHLC columns, `variant?`, `colorBy?`, `showOHLC?` | First-class OHLC candles (TimeSeries only) | `packages/charts/src/Candlestick.tsx` |
|
|
290
|
+
| `Legend` | `placement?`, `items?`, `onRowClick?`, `onRowHover?` | Series key from registered layers' resolved styles | `packages/charts/src/Legend.tsx` |
|
|
291
|
+
|
|
292
|
+
### Components — annotations & indicators
|
|
293
|
+
|
|
294
|
+
| Component | Key props | Purpose | Source |
|
|
295
|
+
| ---------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
|
|
296
|
+
| `Region` | `from`, `to`, `label?`, `id?`, `onChange?` | Shaded x-span; draggable when `onChange` given | `packages/charts/src/annotations.tsx` |
|
|
297
|
+
| `Baseline` | `value`, `axis?`, `label?`, `indicator?`, `onChange?` | Horizontal value line | `packages/charts/src/annotations.tsx` |
|
|
298
|
+
| `Marker` | `at`, `label?`, `indicator?`, `onChange?` | Vertical x line | `packages/charts/src/annotations.tsx` |
|
|
299
|
+
| `Zone` | `from`, `to`, `axis?`, `role?`, `label?`, `edges?` | Shaded y-span — a value-axis scale (AQI categories, HR zones); inert + edge-less by default, `±Infinity` for open ends | `packages/charts/src/annotations.tsx` |
|
|
300
|
+
| `YAxisIndicator` | `value?` \| `source?`, `axis?`, `format?` | Live value pill pinned to a y-axis edge | `packages/charts/src/indicators.tsx` |
|
|
301
|
+
|
|
302
|
+
### Components — cursors (mounted presets)
|
|
303
|
+
|
|
304
|
+
The `cursor` string modes as components (interaction RFC §4/A4.1) — mount one
|
|
305
|
+
as a child of `<ChartContainer>` (the default for every row) or inside a
|
|
306
|
+
`<ChartRow>` (the per-row override). Render-only presets stack; one
|
|
307
|
+
gesture-owning cursor (`Crosshair`/`Range`) per scope. The `cursor` /
|
|
308
|
+
`cursorTime` / `crosshairSnap` / `cursorFormat` / `cursorSequence` /
|
|
309
|
+
`onRegionSelect` / `regionSelectModifier` props (and `<ChartRow cursor>`) are
|
|
310
|
+
**deprecated** — they keep working for one minor via an internal shim. The
|
|
311
|
+
underlying `CursorSpec` contract stays unpublished (Q3); every drag claim on
|
|
312
|
+
the plot (annotation-create, the range drag, pan) is arbitrated by one brush
|
|
313
|
+
recognizer with a documented precedence (`src/brush.tsx`, RFC A1.5/A2.7).
|
|
314
|
+
|
|
315
|
+
| Component | Key props | Purpose | Source |
|
|
316
|
+
| ----------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
317
|
+
| `LineCursor` | `showTime?` | The synced vertical line (`cursor="line"`, the legacy default) | `packages/charts/src/cursors.tsx` |
|
|
318
|
+
| `PointCursor` | `showTime?` | A dot on each series at the cursor (`"point"`) | `packages/charts/src/cursors.tsx` |
|
|
319
|
+
| `InlineCursor` | `showTime?` | Dots + a value chip beside each (`"inline"`) | `packages/charts/src/cursors.tsx` |
|
|
320
|
+
| `FlagCursor` | `showTime?` | Dots + staffed value flags stacked at the top (`"flag"`) | `packages/charts/src/cursors.tsx` |
|
|
321
|
+
| `CrosshairCursor` | `snap?`, `showTime?`, `format?` | The inspection reticle: dashed cross, y value pill, x time pill (`"crosshair"`) | `packages/charts/src/cursors.tsx` |
|
|
322
|
+
| `RangeCursor` | `sequence?`, `onDragRelease?`, `enableDrag?`, `dragModifier?` | The hover-time band + the drag: release fires once with a `RangeSpan`, then reverts (`"region"` + `onRegionSelect` successor) | `packages/charts/src/cursors.tsx` |
|
|
323
|
+
|
|
324
|
+
### Components — standalone row lists (DOM tables, no `<ChartContainer>`)
|
|
325
|
+
|
|
326
|
+
One row per _entity_ (interface, split, symbol) on one shared value scale;
|
|
327
|
+
label + data cells, `sortBy`/`sort`, optional per-row expander. The in-plot
|
|
328
|
+
histogram stays `<BarChart orientation="horizontal">` — these are the table
|
|
329
|
+
shape (react-timeseries-charts' `HorizontalBarChart`).
|
|
330
|
+
|
|
331
|
+
| Component | Data props | Purpose | Source |
|
|
332
|
+
| --------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------- | --------------------------------- |
|
|
333
|
+
| `BarList` | `rows`, `columns` (`values` names), `sortBy?`, `before?`/`after?`, `renderExpanded?` | Ranked bar list — one proportional bar line per column per row | `packages/charts/src/BarList.tsx` |
|
|
334
|
+
| `BoxList` | `rows`, `columns` (five-number names + `value?` tick), same table props | Distribution list — range band / q1→q3 body / median / current tick | `packages/charts/src/BoxList.tsx` |
|
|
335
|
+
|
|
336
|
+
Row/option types + readers (`packages/charts/src/list.ts`): `ListRow`,
|
|
337
|
+
`ListValue`, `ListCellSpec`, `ListMarker` (reference rule through every row,
|
|
338
|
+
label above; joins the auto domain fit), `ListSortDirection`, `BarListColumn`,
|
|
339
|
+
`BoxListColumn`, `ListRowsOptions`; `listRowsFromTimeSeries` /
|
|
340
|
+
`listRowsFromValueSeries` build one `ListRow` per event / axis key (numeric +
|
|
341
|
+
string columns land in `values`).
|
|
342
|
+
|
|
343
|
+
### View builders (all in `packages/charts/src/data.ts`)
|
|
344
|
+
|
|
345
|
+
With a pond series, the components are the whole data contract (pass the
|
|
346
|
+
series directly) — these exports expose the chart-ready view shapes for
|
|
347
|
+
consumers writing custom draw code; no shipped layer needs their output.
|
|
348
|
+
The ValueSeries siblings (`fromValueSeries` etc.) are deliberately
|
|
349
|
+
**unexported** (adapters are internal; see [PND-VSADAPT]).
|
|
350
|
+
|
|
351
|
+
| Export | Signature gist | Feeds |
|
|
352
|
+
| -------------------- | ------------------------------------------------------ | --------------------------------------------------------- |
|
|
353
|
+
| `fromTimeSeries` | `(series, column) → ChartSeries` | Line/Area/Scatter |
|
|
354
|
+
| `bandFromTimeSeries` | `(series, lower, upper) → BandSeries` | BandChart |
|
|
355
|
+
| `boxFromTimeSeries` | `(series, BoxColumns) → BoxSeries` | BoxPlot |
|
|
356
|
+
| `barsFromTimeSeries` | `(series, column) → BarSeries` | BarChart |
|
|
357
|
+
| `ohlcFromTimeSeries` | `(series, OhlcColumns) → OhlcSeries` | Candlestick |
|
|
358
|
+
| `stacksFromGroups` | `(Map<string, TimeSeries>, column) → StackedBarSeries` | Stacked bars from grouped series |
|
|
359
|
+
| `stacksFromColumns` | `(series, columns[]) → StackedBarSeries` | Stacked bars from wide columns |
|
|
360
|
+
| `barsFromBins` | `(bins, column, opts?) → BarSeries` | One-column histogram (single-series path, [PND-BARSEM]) |
|
|
361
|
+
| `stacksFromBins` | `(bins, columns[], opts?) → StackedBarSeries` | Multi-column histograms from `byColumn` output |
|
|
362
|
+
| `categoryStack` | `(CategoryDatum[]) → StackedBarSeries` | Categorical bars |
|
|
363
|
+
| `categoryStacks` | `(CategoryStackDatum[], columns) → StackedBarSeries` | Stacked categorical bars ([PND-CATSTACK]) |
|
|
364
|
+
| `bandedColor` | `(value, colors[], lo, hi) → string \| undefined` | The heat map's own banding — for a matching legend |
|
|
365
|
+
| `heatValueExtent` | `(StackedBarSeries) → [lo, hi] \| null` | Finite extent across a grid; `<HeatMap>`'s domain default |
|
|
366
|
+
| `transposeRow` | `(series, opts?) → CategoryDatum[]` | One row read across as categories |
|
|
367
|
+
|
|
368
|
+
Series shapes (same file): `ChartSeries`, `BandSeries`, `BoxSeries`,
|
|
369
|
+
`BarSeries`, `OhlcSeries`, `StackedBarSeries`; option types `BoxColumns`,
|
|
370
|
+
`OhlcColumns`, `BinRecord`, `StacksFromBinsOptions`, `CategoryDatum`,
|
|
371
|
+
`CategoryStackDatum`, `RowAt`,
|
|
372
|
+
`TransposeRowOptions`.
|
|
373
|
+
|
|
374
|
+
### Theming
|
|
375
|
+
|
|
376
|
+
| Export | Purpose | Source |
|
|
377
|
+
| ------------------------------ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
|
378
|
+
| `ChartTheme` | The one styling channel: role-keyed slots per draw layer + fixed chrome slots | `packages/charts/src/theme.ts` |
|
|
379
|
+
| `defaultTheme` / `estelaTheme` | Built-in themes (neutral light / dark estela palette) | `packages/charts/src/theme.ts` |
|
|
380
|
+
| `cssVarTheme` | `(base, resolve, opts?) → ChartTheme` — static CSS-custom-property overlay | `packages/charts/src/css-theme.ts` |
|
|
381
|
+
| `useChartTheme` | Hook: re-resolves on `data-theme`/`class` flips (MutationObserver) | `packages/charts/src/useChartTheme.ts` |
|
|
382
|
+
| Style types | `LineStyle`, `AreaStyle`, `BandStyle`, `ScatterStyle`, `BarStyle`, `BoxStyle`, `CandleStyle` | `packages/charts/src/theme.ts` |
|
|
383
|
+
| State types | `ScatterStates`, `BoxStates`, `BoxLadder`, `HeatStates` — the per-state sub-objects | `packages/charts/src/theme.ts` |
|
|
384
|
+
| Helper types | `ChartThemeOverrides`, `VarReader`, `UseChartThemeOptions` | `packages/charts/src/css-theme.ts`, `useChartTheme.ts` |
|
|
385
|
+
|
|
386
|
+
### Live values, scales & key types
|
|
387
|
+
|
|
388
|
+
| Export | Purpose | Source |
|
|
389
|
+
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
390
|
+
| `createLiveValue` / `LiveValue` | Imperative push channel for high-frequency indicator updates (isolated repaint) | `packages/charts/src/indicators.tsx` |
|
|
391
|
+
| `scaleTradingTime` / `TradingTimeScale` | Discontinuous time scale collapsing closed-market gaps | `packages/charts/src/tradingTimeScale.ts` |
|
|
392
|
+
| `DiscontinuityProvider` | Gap topology consumed by the trading-time scale | `packages/charts/src/tradingTimeScale.ts` |
|
|
393
|
+
| `scaleBand` / `ScaleBand` | Ordinal slot scale for the category axis | `packages/charts/src/bandScale.ts` |
|
|
394
|
+
| `GapMode` | `'none' \| 'empty' \| 'dashed' \| 'step' \| 'fade'` (Line/Area `gaps` prop) | `packages/charts/src/gaps.ts` |
|
|
395
|
+
| `DecimateOption` | `<LineChart decimate>` — M4 viewport decimation (`bool \| { threshold }`) | `packages/charts/src/decimate.ts` |
|
|
396
|
+
| `CursorMode` | `'none' \| 'line' \| 'point' \| 'inline' \| 'flag' \| 'crosshair' \| 'region'` | `packages/charts/src/context.ts` |
|
|
397
|
+
| `TrackerInfo` / `TrackerSample` | Hover readout payload (`onTrackerChanged`) | `packages/charts/src/context.ts` |
|
|
398
|
+
| `AnnotationKind` / `CreateSpec` | Annotation identity + draw-gesture payload (`onCreate`) | `packages/charts/src/context.ts` |
|
|
399
|
+
| `SelectInfo` | Selection/hover payload (`Selector`/`MultiSelector` `onSelect`/`onHover`) | `packages/charts/src/context.ts` |
|
|
400
|
+
| `SelectModifiers` | Keyboard modifiers on a click, 2nd arg to `onSelect` | `packages/charts/src/context.ts` |
|
|
401
|
+
| `SelectorProps` | `<Selector>`'s props — `enabled?` / `selected?` / `hovered?` / `onSelect?` / `onHover?` / `children?` | `packages/charts/src/selectors.tsx` |
|
|
402
|
+
| `MultiSelectorProps` | `<MultiSelector>`'s props — the above plus `sequence?`, with plural callbacks | `packages/charts/src/selectors.tsx` |
|
|
403
|
+
| `RangeSpan` | `<RangeCursor onDragRelease>` payload — `{ x: [lo, hi], y? }` in axis units | `packages/charts/src/context.ts` |
|
|
404
|
+
| `SpanSelection` | Range entry for `selected` — one layer's marks over `x`/`y`/`rows` (RFC A5.2) | `packages/charts/src/context.ts` |
|
|
405
|
+
| `SelectionEntry` | One `selected` array entry: `SelectInfo \| SpanSelection` | `packages/charts/src/context.ts` |
|
|
406
|
+
| `selectionContains` | Is a hit in a mixed selection? The same membership predicate the layers run | `packages/charts/src/span.ts` |
|
|
407
|
+
| `sameMark` | Are two hits the same mark? Full identity (`id`, `mark`-or-`key`, `label`) | `packages/charts/src/span.ts` |
|
|
408
|
+
| `isSpanSelection` | Entry discriminant — narrows a `SelectionEntry` to `SpanSelection` | `packages/charts/src/span.ts` |
|
|
409
|
+
| `DrawStatsFrame` / `LayerDrawInfo` | Per-repaint draw-cost + decimation stats (`ChartContainer` `onDrawStats`) | `packages/charts/src/context.ts` |
|
|
410
|
+
| `TimeGrain` | Coarse time unit for grain-aware formatting | `packages/charts/src/tickLadder.ts` |
|
|
411
|
+
| `SwatchSpec` / `LegendItemInput` | Legend swatch vocabulary + explicit-rows input (`<Legend items>`) | `packages/charts/src/swatch.ts` |
|
|
412
|
+
| `useChartLegend` | Headless legend hook: rows (items grouped by chart row) + `hover`/`select` verbs | `packages/charts/src/useChartLegend.ts` |
|
|
413
|
+
| `ChartLegend` / `LegendRow` / `LegendItem` | The hook's return shape (`rows` group `items`; items carry `selected`/`hovered`) | `packages/charts/src/useChartLegend.ts` |
|
|
414
|
+
| `LegendPlacement` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `packages/charts/src/Legend.tsx` |
|
|
415
|
+
| `Curve` | Path interpolation: `'linear' \| 'monotone' \| 'natural' \| 'basis' \| 'step'` | `packages/charts/src/curve.ts` |
|
|
416
|
+
| `RadiusEncoding` / `ColorEncoding` | Data-driven scatter size/colour | `packages/charts/src/encoding.ts` |
|
|
417
|
+
| `CandleVariant` / `ColorBy` | OHLC mark shape / colouring strategy | `packages/charts/src/ohlc.ts` |
|
|
418
|
+
| `AxisFormat` / `CursorFormat` | Tick and cursor-readout formatting (d3 specifier or fn) | `packages/charts/src/format.ts` |
|
|
419
|
+
| `AxisTransform` | Monotonic `to`/`from` pair for derived-unit x-axis relabeling | `packages/charts/src/derivedTicks.ts` |
|
|
420
|
+
| `Orientation` | Bar growth direction | `packages/charts/src/bars.ts` |
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## @pond-ts/financial
|
|
425
|
+
|
|
426
|
+
### Studies (each also a fluent method after `import '@pond-ts/financial/fluent'`)
|
|
427
|
+
|
|
428
|
+
All are pure `(series, options) → TimeSeries` appending output columns;
|
|
429
|
+
`column` defaults to `'close'`; periods are bar counts; warm-up is
|
|
430
|
+
length-preserving (`undefined` head rows).
|
|
431
|
+
|
|
432
|
+
| Study | Output column(s) | Options gist | Source |
|
|
433
|
+
| --------------------------- | ----------------------------------- | --------------------------------------------------- | -------------------------------------------------- |
|
|
434
|
+
| `sma` | `sma` | `{ period, column?, output? }` | `packages/financial/src/studies/moving-average.ts` |
|
|
435
|
+
| `ema` | `ema` | `{ period, column?, output? }` (α = 2/(period+1)) | `packages/financial/src/studies/moving-average.ts` |
|
|
436
|
+
| `bollinger` | `bbMiddle`, `bbUpper`, `bbLower` | `{ period, stdDev?, column?, prefix? }` | `packages/financial/src/studies/bollinger.ts` |
|
|
437
|
+
| `envelope` | `envMiddle`, `envUpper`, `envLower` | `{ period, percent?, maType?, column?, prefix? }` | `packages/financial/src/studies/envelope.ts` |
|
|
438
|
+
| `rollingStdev` | `stdev` | `{ period, column?, output? }` (population, ddof=0) | `packages/financial/src/studies/rolling-stat.ts` |
|
|
439
|
+
| `rollingMin` / `rollingMax` | `min` / `max` | `{ period, column?, output? }` (Donchian edges) | `packages/financial/src/studies/rolling-stat.ts` |
|
|
440
|
+
| `rollingPercentile` | `p{q}` (e.g. `p90`) | `{ period, q, column?, output? }` | `packages/financial/src/studies/rolling-stat.ts` |
|
|
441
|
+
| `zScore` | `zscore` | `{ period, column?, output? }` | `packages/financial/src/studies/z-score.ts` |
|
|
442
|
+
| `percentChange` | `pctChange` | `{ periods?, column?, output? }` | `packages/financial/src/studies/percent-change.ts` |
|
|
443
|
+
|
|
444
|
+
Adding a study? Follow `packages/financial/src/studies/README.md` (uniform
|
|
445
|
+
shape + pandas oracle case + fluent method are all REQUIRED).
|
|
446
|
+
|
|
447
|
+
### Trading calendars & sessions
|
|
448
|
+
|
|
449
|
+
| Export | Purpose | Source |
|
|
450
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
|
|
451
|
+
| `TradingCalendar` | Query API: `.sessions()`, `.sessionOn()`, `.isTradingDay()`, `.isOpen()`, `.sessionsInRange()`, `.sessionSequence()`, `.barSequence(period)`, `.tagSessions()`, `.discontinuities()` | `packages/financial/src/calendar/` |
|
|
452
|
+
| `generateSessions` | `Session[]` from `SessionRules` over a date range (DST-correct) | `packages/financial/src/calendar/` |
|
|
453
|
+
| `normalizeSessions` | Validate + sort an explicit session list | `packages/financial/src/calendar/` |
|
|
454
|
+
| `identityDiscontinuity` / `segmentDiscontinuity` / `weekendSkip` | `DiscontinuityProvider`s for the trading-time axis | `packages/financial/src/calendar/` |
|
|
455
|
+
| Types | `Session`, `SessionBreak`, `SessionRules`, `DateRange`, `InstantRange`, `TaggedSchema`, `LiveSegment`, `DiscontinuityProvider` | `packages/financial/src/calendar/` |
|
|
456
|
+
|
|
457
|
+
### Contract & constants
|
|
458
|
+
|
|
459
|
+
`OhlcvColumns` (column-name contract), `DEFAULT_OHLCV`
|
|
460
|
+
(`{ open, high, low, close, volume }`), `DEFAULT_SOURCE` (`'close'`) —
|
|
461
|
+
`packages/financial/src/contract/`. `RollingReducer` (reducer-name union used
|
|
462
|
+
by studies) — `packages/financial/src/kernels/rolling.ts`.
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## @pond-ts/fit
|
|
467
|
+
|
|
468
|
+
| Group | Exports | Source |
|
|
469
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
470
|
+
| Activity model types | `ImportedActivity`, `ActivityMeta`, `ActivityStreams`, `Lap`, `GeoPoint`, `ActivitySource` | `packages/fit/src/types.ts` |
|
|
471
|
+
| Activity façade | `Activity` (`Activity.fromStreams(imported)`), `Section`, `ProfiledActivity`, `ProfiledSection`, `Sample`, `SectionMetrics` | `packages/fit/src/activity/` |
|
|
472
|
+
| Summary pipeline | `computeActivitySummary`, `prepareActivity` → `summaryFromPrepared` (reuse decode), `windowChannels` (zoom re-bucketing), `buildTrackFromStreams` (pond series from streams); types `ActivitySummary`, `PreparedActivity`, `ChannelProfile`, `ChannelSample`, `ChannelKey` | `packages/fit/src/summary/` |
|
|
473
|
+
| Track & geo | `Track` (`Track.of(points)`), `polylineCumulative`, `interpolateAtDistance`, `polylineSlice`, `boundsOf`, `bestEffortsByDistance`, `segmentsInRange` | `packages/fit/src/track/`, `packages/fit/src/geo/` |
|
|
474
|
+
| Power analytics | `computePower` (NP/IF/TSS/zones; `{ binWatts }` sets the histogram bucket width), `powerBestEfforts`; types `PowerSummary`, `PowerZone`, `PowerBin`, `PowerCurvePoint`, `PowerEffort`, `ComputePowerOptions`. `PowerBin`/`PowerZone` carry pond's canonical `start`/`end` bin edges, so they feed `@pond-ts/charts` unmapped | `packages/fit/src/power/` |
|
|
475
|
+
| Profile & zones | `Profile`, `hydrateProfile`, `profileAsOf`, `hrZonesFrom`, `paceZonesFrom`, `powerZonesFrom` (Coggan from FTP) | `packages/fit/src/profile/` |
|
|
476
|
+
| Zone distribution | `zoneDistributionByValue`, `hrZoneDistribution`, `paceZoneDistribution`, `ZoneTime` (canonical `start`/`end` edges + `openEnded`; chart-ready) | `packages/fit/src/zones/` |
|
|
477
|
+
| Quantities | Value objects with canonical units: `Distance`, `Elevation`, `Duration`, `Speed`, `Pace`, `Power`, `HeartRate`, `Cadence` | `packages/fit/src/quantities.ts` |
|
|
478
|
+
| Units | `convertDistance` / `convertElevation` / `convertTemperature` / `convertSpeed`, `metersToMiles`, `metersToFeet`, `formatDuration`, `formatPace`, `*UnitLabel` helpers, `DEFAULT_UNITS` | `packages/fit/src/units.ts` |
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
### `@pond-ts/financial/parallel` (Node-only, opt-in)
|
|
483
|
+
|
|
484
|
+
`withWorkers(series, { workers })` — opts a series into partitioned rolling
|
|
485
|
+
studies and returns it unchanged; `shutdownWorkers()`; `parallelDispatches()`;
|
|
486
|
+
`MIN_ROWS`; type `WithWorkersOptions`. Chosen **once at ingest**: the studies keep their
|
|
487
|
+
signatures and stay synchronous, and derived series inherit it (registration is
|
|
488
|
+
keyed on the key-column buffer). **Single-threaded remains the default** — the
|
|
489
|
+
main package never imports this. Node-only by construction: `Atomics.wait` on
|
|
490
|
+
the main thread is what keeps the studies synchronous, and browsers forbid it.
|
|
491
|
+
|
|
492
|
+
Accelerates any rolling study asking for `avg`/`stdev` off one column — `sma`,
|
|
493
|
+
`envelope`, `bollinger` — at 1.85×/1.35×/1.92×. **Partitioning does not change
|
|
494
|
+
the answer**: since [PND-PROCKERN] the kernel's accumulator rebuilds are pinned
|
|
495
|
+
to absolute row index, so a chunk reconstructs exactly the state a whole-column
|
|
496
|
+
pass held and the partitioned result is bit-identical. **`zScore` is not
|
|
497
|
+
accelerated**: [PND-SHIFTFRAME] moved it onto a shifted-frame kernel this pool
|
|
498
|
+
does not hook, so opting in neither speeds it up nor changes its answer. It used
|
|
499
|
+
to be the fastest entry here at 2.44×, and the only one whose error had no bound.
|
|
500
|
+
Below `MIN_ROWS` a registered series still runs sequentially and is
|
|
501
|
+
bit-identical. `parallelDispatches()` returns how many passes have actually run
|
|
502
|
+
on workers — acceleration is otherwise invisible, since a declined pass returns
|
|
503
|
+
the same answer, only slower than you expected. Source:
|
|
504
|
+
`packages/financial/src/parallel/`.
|
|
505
|
+
|
|
506
|
+
## @pond-ts/process
|
|
507
|
+
|
|
508
|
+
**Experimental — published pre-1.0, API expected to move with friction
|
|
509
|
+
reports; pin an exact version.** The declarative plan layer is the consumer
|
|
510
|
+
surface (RFC [process.md](docs/rfcs/process.md)); the engine ships exported
|
|
511
|
+
beneath it — the [PND-PROCSUB] packaging decision, resolved at first publish.
|
|
512
|
+
Docs: [website/docs/process/](website/docs/process/). Tickets:
|
|
513
|
+
[PND_PROCESS_PLAN.md](docs/plans/PND_PROCESS_PLAN.md).
|
|
514
|
+
|
|
515
|
+
Typed dataflow graphs for pipelines whose **shape is data** (runtime-assembled,
|
|
516
|
+
user-edited, one computation fanned out to several consumers). Chaining stays
|
|
517
|
+
the default for pipelines known at authoring time — see the package README.
|
|
518
|
+
|
|
519
|
+
| Group | Exports | Source |
|
|
520
|
+
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
|
521
|
+
| Worker pool (Node) | `HostPool` (`start`, `run`, `close`, `size`, `inFlight`); types `HostPoolOptions`, `PoolSetup`, `PoolSetupConfig`; `toWire` / `fromWire`, types `WireResult`, `WireColumn` — subpath `@pond-ts/process/pool` | `packages/process/src/pool/index.ts` |
|
|
522
|
+
| Ports | `Inlet`, `Outlet` (typed fields on `node.in` / `node.out`; `get()`, `peek()`, `version`, `connect`, `disconnect`) | `packages/process/src/port.ts` |
|
|
523
|
+
| Nodes | `Node` (`in`, `out`, `dirty`, `error`, `invalidate()`), `defineNode` (reusable multi-output node type), `derive` (single-output, wired inline) | `packages/process/src/node.ts` |
|
|
524
|
+
| Port declaration | `port<T>({ equals, defaultValue })`; types `PortSpec`, `PortSpecMap`, `PortValue`, `PortValues` | `packages/process/src/types.ts` |
|
|
525
|
+
| Sources | `source<T>()` → `SourceNode` (`set()`), `fromLive(liveSource)` → `LiveSourceNode` (`dispose()`); `GraphSource` (bind contract — looser than core's `LiveSource`, accepts `LiveAggregation`), `SnapshotSource`, `NoInputs` | `packages/process/src/source.ts` |
|
|
526
|
+
| Graph view | `Graph` (`Graph.from(...roots)`, `nodes`, `order()`, `edges()`, `toJSON()`); types `GraphEdge`, `GraphJson`, `GraphNodeJson`, `GraphEdgeJson` | `packages/process/src/graph.ts` |
|
|
527
|
+
| Range output buffers | `prepareRange(length, keep, prior)` → `RangeOutput` (`values`, `bits`, `set`, `clear`) carrying `[0, keep)` forward as blocks — values **and** validity; `sealRange(out, length)` → `Float64Column`; `validityByteCount`. Reached from an op as `ctx.out[n]` | `packages/process/src/column.ts` |
|
|
528
|
+
| Ranged recompute | `graph.setSourceFrom(series, changedFrom)` — declares which row first changed; `graph.recomputes` → `{ ranged, full }`. An op opts in with `OpDef.runRange(ctx)`, receiving `{ from, to, previous, previousView, out }` (type `RangeContext`) — write into `out` and return nothing for the block path alongside the usual context. Requires `lookback`. Falls back to a full `run` whenever anything is missing | `packages/process/src/plan/graph.ts` |
|
|
529
|
+
| Node budget | `bind(series, { registry, budgetBytes })` — engine-wide cap on retained node values, LRU, enforced after each `run`; `graph.retainedBytes` / `graph.evictions` / `graph.enforceBudget()`. Unbounded when omitted. Skips a node whose consumer still holds its outlet | `packages/process/src/plan/graph.ts` |
|
|
530
|
+
| Plan history | `requiredHistory(registry, plan)` → `{ known, rows?, undeclared, byOp }` — the minimum safe tail in rows, folded from per-op `OpDef.lookback`. Sums along nesting, maxes across siblings. `known: false` names ops with no declared lookback rather than defaulting to zero (type `HistoryResult`) | `packages/process/src/plan/history.ts` |
|
|
531
|
+
| Column values | `packColumn` (values → packed `Float64Column`, NaN = missing), `columnBytes` (retained size, for a byte budget), `appendColumn` (column → series; boxing-free when gapless), `columnBuffers` / `columnFromBuffers` (the buffer pair a column is, for an isolate boundary; type `ColumnBuffers`), `columnView` (zero-copy borrowed read view for in-process folds; type `ColumnView`) | `packages/process/src/column.ts` |
|
|
532
|
+
| Plan — registry | `createRegistry({ folds })` / `Registry` (`define`, `get`, `foldFor`, `outputsOf`, `resolveParams`, `byFamily`, `describe`, `toJsonSchema`), param builders `int` / `num` / `choice` / `flag`, `UnknownOpError`, `ParamError` | `packages/process/src/plan/registry.ts`, `params.ts` |
|
|
533
|
+
| Plan — identity | `specId` (content-addressed, param-order invariant, defaults materialized), `refToId`, `explain`, `unitOf`, `columnsOf`, `dependsOn`, `outputKey` | `packages/process/src/plan/identity.ts` |
|
|
534
|
+
| Plan — types | `Spec`, `Plan`, `Input` (column name \| `Spec` \| `PickedOutput`), `SpecRef`, `Def` (`OpDef` \| `FoldDef`), `OpContext`, `OpResult`, `FoldContext`, `FactBody`, `isFold`, `ParamDef`, `Params`, `Units`, `InputDef`, `OutputDef` | `packages/process/src/plan/types.ts` |
|
|
535
|
+
| Plan — bind / run | `bind(series, { registry, units })` → `BoundGraph` (`compile`, `setSource`, `ids`, `series`, `columnOf`), `run(graph, { plan, select, onError })` → `RunResult`, `UnitError` | `packages/process/src/plan/graph.ts`, `run.ts` |
|
|
536
|
+
| Plan — request/response | `RunRequest` (`PlanRequest` \| `SlotRequest`), `RunOptions`, `RunResult`, `Select` (`{ on, output?, name? }` — points at a node; what comes back is what that node produces), `ErrorPolicy`, `Fact` (carries `op`), `OutputInfo`, `Skipped`, `NodeTiming` (`slot`, `pulled`, `cached`, `ms`, `inputs`) | `packages/process/src/plan/run.ts` |
|
|
537
|
+
| Plan — host | `createHost({ registry, units, sources })` → `Host` (`add`, `has`, `datasets`, `graphFor`, `run`, `runAsync`), `toWire`, `UnknownDatasetError`; local-string `Envelope` (`PlanEnvelope` \| `SlotEnvelope`), remote-capable `AsyncEnvelope` (`AsyncPlanEnvelope` \| `AsyncSlotEnvelope` \| `Envelope`), `DatasetInfo`, `WireResult` | `packages/process/src/plan/host.ts` |
|
|
538
|
+
| Plan — slots | `expandSlots(slots, columns)` → `Map<slot, Spec>` (expands to the nested form, so ids match by construction; `slot#Output` picks one output), `SlotError`; types `SlotDef` (`{ op, params, in }`), `Slots` | `packages/process/src/plan/slots.ts` |
|
|
539
|
+
| Plan — builder | `plan(from)` → low-level `PlanBuilder`; `process(registry, from)` → typed fluent `ProcessBuilder` (`column`, op methods, `outputs`), `BuilderError`; types `NodeHandle`, `OutputHandle`, `FluentColumnRef`, `SingleColumnNode`, `MultiColumnNode`, `ColumnSelection`, `FactRef`, `BuiltRequest` | `packages/process/src/plan/builder.ts`, `fluent.ts` |
|
|
540
|
+
| Plan — async sources | `defineSource({ name, load })`, `createSourceRegistry()` / `SourceRegistry`, `sourceId`, `UnknownSourceError`; types `SourceRef`, `SourceParams`, `LoadedSource` (value + revision), `SourceLoadContext`, `SourceDef` | `packages/process/src/plan/source.ts` |
|
|
541
|
+
| Plan — folds | `STANDARD_FOLDS` and the four it holds — `last`, `extremes`, `percentileRank`, `shape` — pre-registered by `createRegistry()`; each a plain `FoldDef`, so a consumer can `define` over one | `packages/process/src/plan/folds.ts` |
|
|
542
|
+
| Errors | `ProcessError` (base), `CycleError`, `UnconnectedInputError`, `MissingOutputError`, `UnsetSourceError` | `packages/process/src/errors.ts` |
|
|
543
|
+
| Node type helpers | `NodeSpec`, `NodeFactory`, `InletsFor`, `OutletsFor`, `OutletValue`, `SpecsForOutlets`, `DerivedOutput` | `packages/process/src/node.ts` |
|
|
544
|
+
|
|
545
|
+
Note: this package's `npm test` includes a `test:dts` step that typechecks the
|
|
546
|
+
**emitted** `dist/*.d.ts` from a consumer's perspective (`test-dts/`,
|
|
547
|
+
`skipLibCheck: false`). The package's own build sets `skipLibCheck: true` and
|
|
548
|
+
never checks its own output, so a declaration referencing a type `stripInternal`
|
|
549
|
+
deleted builds green and breaks only downstream. If you mark something
|
|
550
|
+
`@internal`, confirm no public signature names it.
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
## Cross-package seams (where agents most often need the joint)
|
|
555
|
+
|
|
556
|
+
- **Batch → charts**: a draw layer takes a pond `series` + `column` directly;
|
|
557
|
+
the `data.ts` adapters are the explicit versions of what layers do
|
|
558
|
+
internally. Histogram path: `series.byColumn(...)` → `stacksFromBins(...)` →
|
|
559
|
+
`<BarChart bins>`.
|
|
560
|
+
- **Live → react → charts**: `LiveSeries` → `useSnapshot`/`useWindow` →
|
|
561
|
+
the same layer props a batch chart uses (no separate live-mode API).
|
|
562
|
+
- **Financial → charts**: `TradingCalendar.discontinuities()` →
|
|
563
|
+
`ChartContainer calendar` (trading-time axis); studies append columns that
|
|
564
|
+
`LineChart`/`BandChart` draw (`bbUpper`/`bbLower` → `BandChart`).
|
|
565
|
+
- **Core → financial**: studies compose on core kernels; fluent methods mutate
|
|
566
|
+
`TimeSeries.prototype` (runtime import of `@pond-ts/financial/fluent`
|
|
567
|
+
required).
|
|
568
|
+
- **Live → process**: `fromLive(liveSeries)` binds a live source as a graph
|
|
569
|
+
input. Events only mark the node dirty; the snapshot runs once at the next
|
|
570
|
+
pull, so per-event incremental work stays in the live layer and the graph
|
|
571
|
+
composes batch transforms over snapshots. The graph has **no partial
|
|
572
|
+
invalidation** — a dirty node recomputes from a whole snapshot — so for
|
|
573
|
+
windowed work bind the _aggregation_ (`fromLive(live.aggregate(...))`),
|
|
574
|
+
which materializes bucket count rather than event count (235x per pull on
|
|
575
|
+
a 50k buffer). Tradeoff: a live aggregation exposes closed buckets only,
|
|
576
|
+
so the in-progress bucket is invisible until it closes.
|
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.59.0...HEAD
|
|
12
|
+
[0.59.0]: https://github.com/pond-ts/pond/compare/v0.58.0...v0.59.0
|
|
12
13
|
[0.58.0]: https://github.com/pond-ts/pond/compare/v0.57.0...v0.58.0
|
|
13
14
|
[0.57.0]: https://github.com/pond-ts/pond/compare/v0.56.2...v0.57.0
|
|
14
15
|
[0.56.2]: https://github.com/pond-ts/pond/compare/v0.56.1...v0.56.2
|
|
@@ -61,6 +62,148 @@ include new features and type-level changes; patch bumps are strictly additive.
|
|
|
61
62
|
|
|
62
63
|
## [Unreleased]
|
|
63
64
|
|
|
65
|
+
## [0.59.0] — 2026-08-11
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- **charts: `<YAxis scale="symlog">` — linear through zero, logarithmic beyond**
|
|
70
|
+
([PND-SYMLOG]). The third `scale` kind, for a **diverging** measure spanning
|
|
71
|
+
orders of magnitude on both sides of zero. `scale="log"` cannot express that
|
|
72
|
+
domain at all (no zero, no negatives) and `scale="linear"` flattens everything
|
|
73
|
+
outside the top decade onto the axis line — so the small and mid-range values,
|
|
74
|
+
usually the finding, become unreadable.
|
|
75
|
+
|
|
76
|
+
The knee is set by the new **`linearWindow`** prop as a _fraction of the
|
|
77
|
+
domain's largest magnitude_ (default `0.02`): on a ±1M domain the axis is
|
|
78
|
+
linear through ±20k and logarithmic beyond. Relative rather than absolute so
|
|
79
|
+
it survives a domain change with no arithmetic at the call site. Values are
|
|
80
|
+
strictly monotonic across the knee, and zero has a real position. A fraction
|
|
81
|
+
outside `(0, 1]` is unusable as a knee, so the axis draws with the default and
|
|
82
|
+
dev-warns which window is in force.
|
|
83
|
+
|
|
84
|
+
**The tick ladder is pond's, not d3's.** `scaleSymlog` supplies the transform
|
|
85
|
+
but ticks it _linearly_, which puts every label in the top decade and none in
|
|
86
|
+
the linear window the scale exists to open up. `<YAxis scale="symlog">` grids
|
|
87
|
+
zero, ±the knee, and mirrored decades beyond it, thinned to the tick budget
|
|
88
|
+
the same way the log path thins its decades, clipped to the domain. When
|
|
89
|
+
`linearWindow` swallows the domain there is nothing left to grid
|
|
90
|
+
logarithmically, and the axis defers to the linear ticks — which is correct,
|
|
91
|
+
not a fallback: inside the knee, symlog _is_ linear.
|
|
92
|
+
|
|
93
|
+
It removes a workaround whose cost was **silence**: pre-transforming values
|
|
94
|
+
into a ±1 plot space with a linear axis pinned to `[-1, 1]` leaves tick
|
|
95
|
+
positions in plot space while their labels must read in real units, so
|
|
96
|
+
computing the two by different routes yields a chart that confidently labels
|
|
97
|
+
positions it does not occupy — no exception, no visual artifact.
|
|
98
|
+
|
|
99
|
+
**If you are replacing a hand-rolled curve, the shape will shift.** `symlog` is
|
|
100
|
+
the single smooth `sign(x) · log1p(|x / knee|)`, not two joined segments; a
|
|
101
|
+
hand-rolled curve that is exactly linear below the knee and `log10` above is the
|
|
102
|
+
same family with a different shape. Migrating one, a consumer measured small
|
|
103
|
+
values at **roughly half** their former height (on a ±9M domain, 283k moved from
|
|
104
|
+
0.44 to 0.24 of the half-plot above the zero line) with order, tail dominance and
|
|
105
|
+
the several-fold lift over a linear axis all preserved. No `linearWindow` recovers the piecewise shape — the
|
|
106
|
+
difference is the curve, not the knee.
|
|
107
|
+
|
|
108
|
+
- **charts: `<BarChart maxBarWidth>` — cap a bar's ink independently of its slot**
|
|
109
|
+
([PND-BARWIDTH]). Applied after the `gap` inset and centred in the slot, with
|
|
110
|
+
`theme.bar[as].maxWidth` as the fallback (the same relationship `gap` has) and
|
|
111
|
+
uncapped when neither is set.
|
|
112
|
+
|
|
113
|
+
It is the **absolute** half of the width vocabulary. `gap` is _relative_, so
|
|
114
|
+
with it alone bar width is always `slot - gap` and fattens as the plot widens
|
|
115
|
+
— and a fixed ink width is what makes a measure comparable **between** panes,
|
|
116
|
+
since bars that widen with their pane read as different weights of the same
|
|
117
|
+
thing. Neither existing spelling expresses "spread the slots, pin the bar":
|
|
118
|
+
`maxBandWidth = barWidth + gap` pins the bar but stops the slots spreading,
|
|
119
|
+
and `maxBandWidth = slotCap` spreads them but lets the bar grow. The
|
|
120
|
+
workaround was to compute `gap` from the band width you predicted the library
|
|
121
|
+
would pick — a re-derivation of pond's layout arithmetic in consumer code,
|
|
122
|
+
which goes silently wrong the moment that rule changes on either side.
|
|
123
|
+
|
|
124
|
+
Pairs with `<ChartContainer maxBandWidth>` (which caps the **slot**) and
|
|
125
|
+
`minWidth` still wins if the two bounds would invert. **A single-series bar's
|
|
126
|
+
hit target stays its whole slot**, so narrow ink costs nothing in clickability;
|
|
127
|
+
on a **stacked** chart the cap does narrow the target, because a stack must
|
|
128
|
+
hit-test its drawn segment rect to resolve which segment.
|
|
129
|
+
|
|
130
|
+
- **charts: `<BarChart categories columns>` — a first-class stacked category
|
|
131
|
+
chart** ([PND-CATSTACK]). Each datum is `{ label, values }` and `columns`
|
|
132
|
+
names the groups to stack bottom → top, the same relationship
|
|
133
|
+
`series` + `columns` already has. New `categoryStacks` reader and
|
|
134
|
+
`CategoryStackDatum` type; geometry, `marks` and the categorical axis are
|
|
135
|
+
unchanged from the single-value case, so this reaches the shipped
|
|
136
|
+
`drawStacks` path with no new draw code. A missing or non-finite group reads
|
|
137
|
+
as a **gap**, not a zero.
|
|
138
|
+
|
|
139
|
+
**It removes a workaround with three costs**, the third only visible since
|
|
140
|
+
0.58.0: composing the picture from one `categories` layer per _cumulative
|
|
141
|
+
total_ (drawn outermost-first so each overpaints the one beneath) meant a
|
|
142
|
+
hand-assembled legend, label thinning blind to the sibling layers, and — because
|
|
143
|
+
a selection entry keys on `(layer id, mark)` — a controlled set replicated
|
|
144
|
+
across every segment layer, where missing one made a selected bar recede
|
|
145
|
+
**from the waist up**. Because `marks` is indexed by **bin**, one entry naming
|
|
146
|
+
`(id, mark)` now matches every segment of a bar, so that failure is not
|
|
147
|
+
expressible rather than merely fixed.
|
|
148
|
+
|
|
149
|
+
### Fixed
|
|
150
|
+
|
|
151
|
+
- **charts: a selected segment of a stack with `colors` no longer collapses to
|
|
152
|
+
the flat `highlight`.** `StackStyle.groupColored` — the "a selected segment
|
|
153
|
+
keeps its own fill" exclusion — was gated on the _theme ramp_ having painted
|
|
154
|
+
the stack, so a call site passing `colors` lost it and both segments of a
|
|
155
|
+
selected bar went one `highlight` blue, losing the segment distinction exactly
|
|
156
|
+
where the reader is looking. The gate's stated reason ("a ramp entry the call
|
|
157
|
+
site overrode is no longer the ramp's colour, so its receded counterpart would
|
|
158
|
+
be wrong") applies to the _derived_ companions `dimmedFills` / `hoverFills`,
|
|
159
|
+
which must invent a per-group colour; `groupColored` derives nothing. It now
|
|
160
|
+
gates on **whether the resolved fills actually differ**, so a `colors` map keeps
|
|
161
|
+
its colours under selection, while a multi-group stack under a theme that gives
|
|
162
|
+
its groups no distinct colours at all (no ramp, no roles, no `colors` — e.g.
|
|
163
|
+
`estelaTheme`) still takes the themed `highlight`, because there is no
|
|
164
|
+
meaning-carrying colour there to preserve and suppressing the highlight would
|
|
165
|
+
leave selection invisible. Found building [PND-CATSTACK], where the old gate made
|
|
166
|
+
the first-class stack render _worse_ under selection than the workaround it
|
|
167
|
+
replaces; the second half was found in review, since every story and test renders
|
|
168
|
+
`defaultTheme`, whose ramp hides the difference.
|
|
169
|
+
|
|
170
|
+
- **all packages: `API.md` now ships inside the npm tarball.** The agent-facing
|
|
171
|
+
map of every public export across the six packages — one line per export with
|
|
172
|
+
its purpose and source path — was repo-only, so an agent working in a
|
|
173
|
+
_consuming_ repo had to crawl `node_modules/*/dist/*.d.ts` or go to the
|
|
174
|
+
network to learn the surface. It is now copied in by each package's existing
|
|
175
|
+
`prepack` (the same mechanism that already ships `README`, `LICENSE` and
|
|
176
|
+
`CHANGELOG`) and listed in `files`. ~69kB per tarball.
|
|
177
|
+
|
|
178
|
+
Every package carries the same **monorepo-wide** copy rather than a
|
|
179
|
+
per-package slice, deliberately: the packages compose, and knowing what is
|
|
180
|
+
next door is most of the value. The header now names its audience and
|
|
181
|
+
resolves repo-relative source paths against GitHub, since inside
|
|
182
|
+
`node_modules` a bare `packages/core/src/…` points nowhere.
|
|
183
|
+
|
|
184
|
+
- **charts: `BarStyle.dimmed`'s precedence over per-bar and per-band colour is
|
|
185
|
+
documented, and pinned.** A consumer migrating onto 0.58.0 read
|
|
186
|
+
`BarStyle.hover`'s documented `binColors` exclusion ("pops each bar's _own_
|
|
187
|
+
fill"), reasonably generalized it to `dimmed`, concluded their `binColors` and
|
|
188
|
+
`thresholds` charts would get no de-emphasis, and was about to hand-dim inside
|
|
189
|
+
their own colour arrays. The opposite is true: **an unselected bar takes
|
|
190
|
+
`dimmed`, discarding its per-bar colour, and a banded bar draws flat rather
|
|
191
|
+
than dimming each band.** The asymmetry is deliberate — emphasis preserves a
|
|
192
|
+
per-bar colour because that colour is what the value means, while a receded
|
|
193
|
+
bar's job is to stop competing over meaning — but only `hover` said anything,
|
|
194
|
+
so generalizing was the natural read. `dimmed` now spells out all three paths
|
|
195
|
+
(`binColors`/`binFills`, bands/thresholds, and the per-group stack fallback
|
|
196
|
+
through `StackStyle.dimmedFills`), `hover` scopes its exclusion to the live
|
|
197
|
+
states, and three tests pin the behaviour.
|
|
198
|
+
|
|
199
|
+
- **charts: the `theme.list` register no longer reads as if it carries
|
|
200
|
+
`dimmed`.** Its doc mentioned `highlight`/`dimmed` while explaining that a
|
|
201
|
+
list resolves glyph state through the bar tokens — accurate, but sitting in a
|
|
202
|
+
sentence about per-metric resolution it read as a field list, and cost the
|
|
203
|
+
same consumer a couple of passes to rule out a missing `list.dimmed`. Now
|
|
204
|
+
states explicitly that those are `BarStyle` tokens resolved via
|
|
205
|
+
`theme.bar[as]`, and that this register carries exactly its five values.
|
|
206
|
+
|
|
64
207
|
## [0.58.0] — 2026-08-10
|
|
65
208
|
|
|
66
209
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pond-ts/process",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"description": "Computations as data over pond-ts: processing graphs authored fluently or composed as JSON, resolved against a declared op vocabulary with content-addressed caching, provenance, and per-node timings. Experimental, pre-1.0.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
-
"CHANGELOG.md"
|
|
30
|
+
"CHANGELOG.md",
|
|
31
|
+
"API.md"
|
|
31
32
|
],
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "tsc -p tsconfig.json",
|
|
34
35
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"test-dts/**/*.ts\"",
|
|
35
36
|
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" \"test-dts/**/*.ts\"",
|
|
36
|
-
"prepack": "cp ../../LICENSE ./LICENSE && cp ../../CHANGELOG.md ./CHANGELOG.md && npm run build && cp cjs-fallback.cjs dist/cjs-fallback.cjs && find dist -name '*.map' -delete",
|
|
37
|
+
"prepack": "cp ../../LICENSE ./LICENSE && cp ../../CHANGELOG.md ./CHANGELOG.md && cp ../../API.md ./API.md && npm run build && cp cjs-fallback.cjs dist/cjs-fallback.cjs && find dist -name '*.map' -delete",
|
|
37
38
|
"test": "npm run test:type && npm run test:dts && npm run test:runtime",
|
|
38
39
|
"test:type": "tsc -p tsconfig.types.json",
|
|
39
40
|
"test:dts": "npm run build && tsc -p tsconfig.dts.json",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"verify": "npm run format:check && npm run build && npm test"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"pond-ts": "^0.
|
|
45
|
+
"pond-ts": "^0.59.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"typescript": "^5.6.3",
|