Documentation / @ripl/charts / RealtimeChart
Class: RealtimeChart ​
Defined in: charts/src/charts/realtime.ts:100
Realtime streaming chart rendering continuously updating line/area series.
Data is pushed incrementally via RealtimeChart.push and maintained in a fixed-size sliding window buffer. Each render cycle smoothly transitions polylines to reflect the latest data. Supports y-axis, grid, crosshair, legend, and configurable transition duration.
Extends ​
Constructors ​
Constructor ​
new RealtimeChart(
target,options):RealtimeChart
Defined in: charts/src/charts/realtime.ts:113
Parameters ​
| Parameter | Type |
|---|---|
target | string | Context<Element, Record<string, unknown>> | HTMLElement |
options | RealtimeChartOptions |
Returns ​
RealtimeChart
Overrides ​
Properties ​
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
animationOptions | protected | ChartAnimationOptions | Chart.animationOptions | charts/src/core/chart.ts:72 |
autoRender | protected | boolean | Chart.autoRender | charts/src/core/chart.ts:71 |
colorGenerator | protected | Generator<string, string, any> | Chart.colorGenerator | charts/src/core/chart.ts:78 |
options | protected | RealtimeChartOptions | Chart.options | charts/src/core/chart.ts:77 |
parent? | public | EventBus<EventMap> | Chart.parent | core/src/core/event-bus.ts:79 |
renderer | protected | Renderer | Chart.renderer | charts/src/core/chart.ts:70 |
scene | protected | Scene | Chart.scene | charts/src/core/chart.ts:69 |
titleOptions? | protected | ChartTitleOptions | Chart.titleOptions | charts/src/core/chart.ts:73 |
defaultKey | readonly | typeof defaultKey | Chart.defaultKey | core/src/core/disposer.ts:10 |
Methods ​
clear() ​
clear():
void
Defined in: charts/src/charts/realtime.ts:208
Returns ​
void
destroy() ​
destroy():
void
Defined in: charts/src/core/chart.ts:195
Destroys the chart, its scene, context, and cleans up all event subscriptions.
Returns ​
void
Inherited from ​
dispose() ​
protecteddispose(key?):void
Defined in: core/src/core/disposer.ts:24
Disposes all resources under the given key, or all resources if no key is provided.
Parameters ​
| Parameter | Type |
|---|---|
key? | PropertyKey |
Returns ​
void
Inherited from ​
emit() ​
Call Signature ​
emit<
TEvent>(event):TEvent
Defined in: core/src/core/event-bus.ts:127
Emits an event, invoking all matching handlers and bubbling to the parent if applicable.
Type Parameters ​
| Type Parameter | Default type |
|---|---|
TEvent extends Event<undefined> | Event<undefined> |
Parameters ​
| Parameter | Type |
|---|---|
event | TEvent |
Returns ​
TEvent
Inherited from ​
Call Signature ​
Defined in: core/src/core/event-bus.ts:128
Emits an event, invoking all matching handlers and bubbling to the parent if applicable.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
data | EventMap[TEvent] |
Returns ​
Inherited from ​
getAnimationDuration() ​
protectedgetAnimationDuration(referenceDuration?):number
Defined in: charts/src/core/chart.ts:132
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
referenceDuration | number | 1000 |
Returns ​
number
Inherited from ​
getChartArea() ​
protectedgetChartArea():ChartArea
Defined in: charts/src/core/chart.ts:163
Returns ​
Inherited from ​
getPadding() ​
protectedgetPadding():ChartPadding
Defined in: charts/src/core/chart.ts:153
Returns ​
Inherited from ​
getSeriesColor() ​
protectedgetSeriesColor(seriesId):string
Defined in: charts/src/core/chart.ts:190
Parameters ​
| Parameter | Type |
|---|---|
seriesId | string |
Returns ​
string
Inherited from ​
has() ​
has(
type):boolean
Defined in: core/src/core/event-bus.ts:84
Returns whether there are any listeners registered for the given event type.
Parameters ​
| Parameter | Type |
|---|---|
type | keyof EventMap |
Returns ​
boolean
Inherited from ​
init() ​
protectedinit():void
Defined in: charts/src/core/chart.ts:100
Returns ​
void
Inherited from ​
off() ​
off<
TEvent>(type,handler):void
Defined in: core/src/core/event-bus.ts:102
Removes a previously registered handler for the given event type.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
Returns ​
void
Inherited from ​
on() ​
on<
TEvent>(type,handler,options?):Disposable
Defined in: core/src/core/event-bus.ts:89
Subscribes a handler to the given event type and returns a disposable for cleanup.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
options? | EventSubscriptionOptions |
Returns ​
Inherited from ​
once() ​
once<
TEvent>(type,handler,options?):Disposable
Defined in: core/src/core/event-bus.ts:117
Subscribes a handler that is automatically removed after it fires once.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
options? | EventSubscriptionOptions |
Returns ​
Inherited from ​
push() ​
push(
values):void
Defined in: charts/src/charts/realtime.ts:187
Parameters ​
| Parameter | Type |
|---|---|
values | Record<string, number> |
Returns ​
void
render() ​
render():
Promise<void>
Defined in: charts/src/charts/realtime.ts:383
Returns ​
Promise<void>
Overrides ​
resolveSeriesColors() ​
protectedresolveSeriesColors(series):void
Defined in: charts/src/core/chart.ts:175
Parameters ​
| Parameter | Type |
|---|---|
series | object[] |
Returns ​
void
Inherited from ​
retain() ​
protectedretain(value,key?):void
Defined in: core/src/core/disposer.ts:13
Registers a disposable resource under an optional key for later cleanup.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
value | Disposable | undefined |
key | PropertyKey | Disposer.defaultKey |
Returns ​
void
Inherited from ​
update() ​
update(
options):void
Defined in: charts/src/charts/realtime.ts:215
Merges partial options into the current options and re-renders if autoRender is enabled.
Parameters ​
| Parameter | Type |
|---|---|
options | Partial<RealtimeChartOptions> |
Returns ​
void