Skip to content

Vizzu / Modules / vizzu / Vizzu

Class: Vizzu

vizzu.Vizzu

Class representing a single chart in Vizzu.

Constructors

constructor

new Vizzu(options, initState?): Vizzu

Creates a new chart and connects it to the div or canvas HTML element specified by its ID or DOM object. The new chart is empty by default, but can be set to an initial state in the second optional parameter.

Parameters

Name Type
options VizzuOptions
initState? Target

Returns

Vizzu

Properties

initializing

initializing: Promise\<Vizzu>

Promise representing the initialization will resolve when initialization is finished. Any API call will potentially cause an error before this promise is resolved.

Accessors

animation

get animation(): AnimControl

Returns controls for the ongoing animation, if any.

Returns

AnimControl

Deprecated

since version 0.4.0


config

get config(): ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>

Property for read-only access to chart parameter object.

Returns

ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>


data

get data(): ReadonlyObjectDeep\<RequiredObjectDeep\<Metainfo>>

Property for read-only access to data metainfo object.

Returns

ReadonlyObjectDeep\<RequiredObjectDeep\<Metainfo>>


feature

get feature(): Features

If called as a function: (name, enabled): it enables/disables built-in features and registered plugins. (plugin, enabled?): registers the given plugin. Otherwise gives access to the interfaces of the registered plugins, where every plugin acceccible as a property with the plugin name.

Returns

Features


style

get style(): ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>

Property for read-only access to style object without default values.

Returns

ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>


presets

get presets(): default

Returns the chart preset collection.

Returns

default

Methods

animate

animate(target, options?): AnimCompleting

Initiates the animation either to the new chart state passed as the first argument, or through a sequence of keyframe charts passed as the first argument. If there is a currently running animation, all subsequent calls will schedule the corresponding animation after the end of the previous one. The new chart state or keyframe can be a full state specifier object with data, config and style, or a single chart config object. It accepts also a chart snapshot acquired from a previous state using the store() method of this class or a whole previous animation acquired using the store() method of the AnimControl object, which can be queried from the promise returned by the animate() method. The optional second parameter specifies the animation control options and also all the other animation options in case of only a single chart state passed as the first argument. This second option can be a scalar value, setting the overall animation duration. Passing explicit null as second parameter will result in no animation. The method returns a promise, which will resolve when the animation is finished. Since there can be multiple animations in the queue, the result promise provides a nested promise member activated, which resolves when the requested animation gets active.

Parameters

Name Type
target AnimTarget
options? ControlOptions

Returns

AnimCompleting


detach

detach(): void

Removes the reference of the chart from every place it attached itself, this method must be called in order to get the chart properly garbage collected.

Returns

void


getComputedStyle

getComputedStyle(): ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>

Property for read-only access to the style object after setting defaults.

Returns

ReadonlyObjectDeep\<RequiredObjectDeep\<Chart>>


off

off\<T>(eventName, handler): void

Uninstalls the provided event handler from the event specified by name.

Type parameters

Name Type
T extends EventType

Parameters

Name Type
eventName T
handler EventHandler\<EventMap[T]>

Returns

void


on

on\<T>(eventName, handler): void

Installs the provided event handler to the event specified by name.

Type parameters

Name Type
T extends EventType

Parameters

Name Type
eventName T
handler EventHandler\<EventMap[T]>

Returns

void


store

store(): Snapshot

Returns a reference to the actual chart state for further reuse. This reference includes the chart config, style parameters and the data filter but does not include the actual data and the animation options.

Returns

Snapshot


version

version(): string

Returns the version number of the library.

Returns

string


initialize

initialize(): Promise\<void>

Initializes the library, if not called, first constructor call will do that.

Returns

Promise\<void>


options

options(options): void

Setter method for Library options.

Parameters

Name Type
options LoaderOptions

Returns

void