Skip to content

Interface: Chart ​

Defined in: packages/core/src/dashboard.ts:65

A live chart returned by Dashboard.chart.

Properties ​

PropertyModifierTypeDescription
datareadonlyChartData | nullThe latest aggregates, or null before the first update.
filterreadonlyFilter | nullThis chart's own filter, or null.
idreadonlystringThe chart's id, which is also its key in the filter store.
readyreadonlyPromise<DimensionInfo>Resolves once the engine has indexed the dimension.

Methods ​

apply() ​

ts
apply(intent): void;

Defined in: packages/core/src/dashboard.ts:75

Apply an intent as if the renderer had emitted it.

Parameters ​

ParameterType
intentIntent

Returns ​

void


destroy() ​

ts
destroy(): void;

Defined in: packages/core/src/dashboard.ts:85

Remove the chart, its views, its dimension and its filter.

Returns ​

void


mount() ​

ts
mount<View>(
   target, 
   view?, 
   renderer?
): () => void;

Defined in: packages/core/src/dashboard.ts:81

Draw this chart in one more place, e.g. a compact copy in an overview. Every view shares the chart's data and filter. Returns a function that removes the view.

Type Parameters ​

Type ParameterDefault type
Viewunknown

Parameters ​

ParameterType
targetstring | HTMLElement
view?View
renderer?Renderer<View>

Returns ​

() => void


subscribe() ​

ts
subscribe(listener): () => void;

Defined in: packages/core/src/dashboard.ts:83

Listen for fresh aggregates, e.g. to draw without a renderer. Returns a function that unsubscribes.

Parameters ​

ParameterType
listenerChartListener

Returns ​

() => void

Released under the MIT License.