Skip to content

Documentation / @finchart/core / index / conflated

Function: conflated() ​

conflated<T>(handle, options?): ConflatedFeed<T>

Defined in: packages/core/src/extensions/conflate.ts:90

Folds a tick burst down to what a frame can actually show.

Rendering already coalesces — fifty requestRenders draw one frame. The data side does not: every updateLast pays a full-array copy and the seam checks, so fifty ticks between frames pay fifty of them for a picture that only shows the last. This feed holds the latest tick per bar and delivers it once per schedule tick, making the per-frame cost a constant instead of O(ticks × data).

Measured (100k points, candles, headless): 50 ticks/frame 16.9 → 3.8 ms/frame, 200 ticks/frame 55.8 → 3.8. Below ~10k points at modest tick rates the win is noise — this is a door you walk through when the feed is actually loud, not a default.

A new bar is never conflated over. When a tick opens a different x, the previous bar's pending state is delivered immediately — its final high/low/close are data, and last-wins across the boundary would lose them. Delivery order always matches bar order.

Latency: this feed runs its own clock, separate from the chart's render scheduler. Delivery waits for the feed's frame, and the render that delivery requests waits for the next one — so a tick can reach the screen up to two frames (~33ms) later than the unconflated path. A consumer that cannot spend that passes its own schedule; a chart wired with a custom scheduler should pass the same factory here, or the two run on different clocks.

ts
const feed = conflated(handle);
socket.on("tick", (t) => feed.push(t));
// later: feed.dispose() — or scope.add(() => feed.dispose()), the same
// one-liner every extension's disposer rides

Type Parameters ​

T ​

T extends BaseDataPoint

Parameters ​

handle ​

ConflatableHandle<T>

options? ​

ConflatedOptions<T> = {}

Returns ​

ConflatedFeed<T>