UNPKG

26.4 kBTypeScriptView Raw
1declare namespace Lib
2{
3
4/** Options for the library. */
5interface Options {
6
7 /** The URL for the webassembly binary (cvizzu.wasm). */
8 wasmUrl?: string;
9
10}
11
12}
13
14declare namespace Data
15{
16
17/** Additional info about a data series besides the contained data. */
18interface SeriesMetaInfo
19{
20 /** Name of the data series. It will be the unique id of the series to
21 reference it in various parts of the API, mainly in {@link Channel} and
22 {@link Data.Record}. This name will also be used by default for Axis and
23 Legend title. */
24 name: string;
25 /** Type of the data series:
26 - 'dimension' - categorical data containing strings
27 (dates should also be added as strings);
28 - 'measure' - continuous data containing numbers.
29 If not set, the library will attempt to determine the type based on
30 the type of the first value. Number type will result in measure,
31 string type will result in dimension. */
32 type?: 'dimension'|'measure';
33}
34
35/** Represents a categorical or data value */
36type Value = string|number;
37
38/** List of data values in a series. */
39type Values = string[]|number[];
40
41/** Defines a data series of the data set, and contains a particular variable's
42 values in the data set and meta info about the variable. */
43interface Series extends SeriesMetaInfo {
44 /** The array that contains the values of the data series. The value types
45 should match {@link Data.SeriesMetaInfo.type}. If the data series
46 is shorter than the longest data series defined, it will be internally
47 extended with empty values. */
48 values: Values;
49}
50
51/** A record of the data set, containing one value of each data series
52 corresponding to the same index. */
53interface Record {
54 /** Properties are provided for each data series, providing access to the value within
55 the record referenced by its {@link Data.Series.name|name}. */
56 [seriesName: Series["name"]]: Value;
57}
58
59type FilterCallback = (record: Record) => boolean;
60
61interface Filter {
62 /** A filter callback is called on each record of the dataset on chart
63 generation. If the callback returns false, the record will not be shown on the chart.
64 */
65 filter?: FilterCallback | null;
66}
67
68/** Data table specified by series. */
69interface TableBySeries extends Filter
70{
71 /** The series that make up the the data set. */
72 series: Series[];
73}
74
75/** Data table specified by records. */
76interface TableByRecords extends Filter
77{
78 /** The information about the data series in the records of the data set.
79 Note: not needed if it was previously specified. */
80 series?: SeriesMetaInfo[];
81 /** The array of data records that make up the data set. */
82 records: Value[][];
83}
84
85type CubeRow = Values|CubeRow[];
86
87/** Defines a data series of the data cube, and contains a particular variable's
88 values in the data cube and meta info about that variable. */
89interface CubeData extends SeriesMetaInfo {
90 /** A nested array that contains the values of the data series. Nesting
91 level should match the number of {@link Data.Cube.dimensions}. */
92 values: CubeRow;
93}
94
95/** N dimensional data cude */
96interface Cube extends Filter
97{
98 /** The list of the dimensions of the data cube. */
99 dimensions?: Series[];
100 /** The list of measures of the data cube. */
101 measures?: CubeData[];
102}
103
104/** Data set is a collection of related {@link Data.Series|data series}.
105 Each chart works on a single data set. */
106type Set = TableBySeries|TableByRecords|Cube;
107
108type SeriesList = string[]|string;
109
110}
111
112declare namespace Config
113{
114
115/* Units:
116 - no unit: the same unit as in the data;
117 - %: percentage relative to the min/max of the data;
118 - min,max: offset from min/max of the data;
119 - auto: automatic range based on chart config;
120 */
121type ChannelExtrema = number|`${number}%`|`${number}min`|`${number}max`|'auto';
122
123/** Channel range specifies how to scale the represented data. */
124interface ChannelRange {
125 min?: ChannelExtrema|null;
126 max?: ChannelExtrema|null;
127}
128
129/** Channels are the main building blocks of the chart. Each channel describes
130 a particular aspect of the markers (vertical & horizontal position, color, etc.)
131 and connects them to the underlying data. A single measure and an ordered list of
132 dimensions can be on each channel. The dimensions will recursively slice the
133 measure on the channel. The channels are represented on the chart as an
134 axis or legend. */
135interface Channel {
136 /** This title is shown on the axis or legend corresponding to the channel.
137 If 'auto', the title will be the name of the measure attached to
138 that channel. */
139 title?: string|'auto'|null;
140 /** List of {@link Data.Series.name|data series names} on the
141 channel. */
142 set? : Data.SeriesList|null;
143 /** List of {@link Data.Series.name|data series names} to be added to the
144 channel beside the ones already added. */
145 attach?: Data.SeriesList;
146 /** List of {@link Data.Series.name|data series names} to be removed from the
147 channel. */
148 detach?: Data.SeriesList;
149 /** Specifies the range that determines how the represented data scales
150 on the channel. */
151 range?: ChannelRange;
152 /** Only one dimension can be shown on an axis or legend by
153 name. This index specifies which attached series should be used. */
154 labelLevel?: number;
155}
156
157/** Channel configuration.
158 A data series' name or a list of the data series' names can be used as a
159 short-hand - instead of the {@link Channel|channel object} - to set data series
160 for the channel. Setting a channel to null will remove all data series from it. */
161interface Channels {
162 /** Parameters for the X-axis, determining the position of the markers on the
163 x-axis - or their angle when using polar coordinates.
164 Note: leaving x and y channels empty will result in a
165 chart "without coordinates" like a Treemap or a Bubble Chart. */
166 x?: Channel|Data.SeriesList|null;
167 /** Parameters for the Y-axis, determining the position of the markers on the
168 y-axis - or their radius when using polar coordinates) . */
169 y?: Channel|Data.SeriesList|null;
170 /** Parameters for the markers' base color. The markers' actual color can
171 also be affected by the lightness channel. */
172 color?: Channel|Data.SeriesList|null;
173 /** Parameters for markers' lightness. */
174 lightness?: Channel|Data.SeriesList|null;
175 /** Parameters for the markers' size. Effective only for circle and line
176 geometry affecting the circle area or the line width respectively.
177 */
178 size?: Channel|Data.SeriesList|null;
179 /** Parameters for the content of the labels that appear on the markers. */
180 label?: Channel|Data.SeriesList|null;
181 /** Splits the markers as all the other channels, but have no
182 effect on the markers' appearance. Thus, it only works with dimensions. */
183 noop?: Channel|Data.SeriesList|null;
184}
185
186/** The config contains all of the parameters needed to render a particular
187 static chart or a state of an animated chart. */
188interface Chart extends Channels {
189 /** List of the chart's channels' configuration. The chart object also
190 extends the channels object as a configuration shorthand. */
191 channels?: Channels;
192 /** This is the title shown on the top of the chart.
193 If set to null, the title will not be shown and will not take up any
194 space in the chart layout. */
195 title?: string|null;
196 /** Specifies which channel should be shown on the legend.
197 If set to null, the legend will not be shown and will not take up any
198 space in the chart layout. */
199 legend?: 'color'|'lightness'|'size'|null;
200 /** Sets the coordinate system for the chart. Switch to the 'polar'
201 coordinate system to create a chart from the pie/radial chart family. */
202 coordSystem?: 'cartesian'|'polar';
203 /** Rotates the plot area by the specified angle in degree.
204 Note: this is an experimental, not tested feature. */
205 rotate?: number;
206 /** Sets the geometric elements used for the markers to represent the data.*/
207 geometry?: 'rectangle'|'circle'|'area'|'line';
208 /** If both axes have measures on them, this parameter sets the
209 orientation of the chart, meaning to which axis the graphical elements
210 are oriented to. */
211 orientation?: 'horizontal'|'vertical';
212 /** - 'none': markers are sorted in the order as the corresponding data
213 appear in the data set.
214 - 'byValue': markers will be sorted by the corresponding measure (if present)
215 in decreasing order. */
216 sort?: 'none'|'byValue';
217 /** Reverts the order of the markers if set. */
218 reverse?: boolean;
219 /** Sets the alignment of the markers with relation to the x- or the y-axis depending
220 on where the measure is. In case both axes have measures on them, this is determined
221 by the {@link Chart.orientation|orientation} of the chart.
222 */
223 align?: 'none'|'min'|'center'|'max'|'stretch';
224 /** If set to true, markers will be split by the dimension(s) along the axis.
225 This works if you have at least one dimension and a measure on the same axis.In case
226 both axes have measures and dimension(s) on them, this is determined by the
227 {@link Chart.orientation|orientation} of the chart.*/
228 split?: boolean;
229}
230
231}
232
233declare namespace Styles
234{
235
236/** Length can be set in pixels or in percentage of the element or the element's
237 font size. Pixel is the default unit. */
238type Length = `${number}px`|`${number}%`|`${number}em`|number;
239
240/** Angle can be set in radians, degrees, gradians and turns.
241 Radians is the default unit. */
242type Angle = `${number}rad`|`${number}grad`|`${number}deg`|`${number}turn`
243 |number;
244
245/** The following CSS color formats are available:
246 rgb(), rgba(), #RRGGBB, #RRGGBBAA, #RGB. */
247type Color = `#${string}`
248 |`rgb(${number},${number},${number})`
249 |`rgba(${number},${number},${number},${number})`;
250
251interface Padding {
252 /** Top padding of the element. */
253 paddingTop?: Length|null;
254 /** Right padding of the element. */
255 paddingRight?: Length|null;
256 /** Bottom padding of the element. */
257 paddingBottom?: Length|null;
258 /** Left padding of the element. */
259 paddingLeft?: Length|null;
260}
261
262interface Font {
263 /** The family of the font. If not set, it inherits the root style font
264 family. */
265 fontFamily?: string|null;
266 /** The style of the font. */
267 fontStyle?: 'normal'|'italic'|'oblique'|null;
268 /** The weight of the font, numbers use the same scale as CSS. */
269 fontWeight?: 'normal'|'bold'|number|null;
270 /** The size of the font. Percentage values are relative to the root style font
271 size */
272 fontSize?: Length|null;
273}
274
275interface Box {
276 /** The background color of the element. */
277 backgroundColor?: Color|null;
278 /** The border color of the element. */
279 borderColor?: Color|null;
280 /** The border width of the element. */
281 borderWidth?: number|null;
282}
283
284interface Text {
285 /** The color of the displayed text. */
286 color?: Color|null;
287 /** The alignment of the displayed text. */
288 textAlign?: 'center'|'left'|'right'|null;
289 /** The background color of the displayed text. */
290 backgroundColor?: Color|null;
291 /** The format of the number. Only applicable for texts showing numerical
292 data such as marker and axis labels. 'grouped' uses thousand separators,
293 'prefixed' uses scientific notation. */
294 numberFormat?: 'none'|'grouped'|'prefixed'|null;
295 /** The maximum number of digits in fraction part if the text contains a
296 number. */
297 maxFractionDigits?: number|null;
298}
299
300/** The following CSS like filters can be used to alter the color:
301
302 - color: overrides the color.
303 - lightness: lightens or darkens the color; 0 means the original color, -1
304 means black, 1 means white.
305 - grayscale: desaturates the color. 0 means the original color, 1 means fully
306 desaturated.
307
308 none: no change.
309 */
310type ColorTransform = `color(${Color})`
311 | `lightness(${number})`
312 | `grayscale(${number})`
313 | `opacity(${number})`
314 | 'none';
315
316interface OrientedLabel extends Label {
317 /** Orientation of the label relatively to the axis or marker it is attached to. */
318 orientation?: 'normal'|'tangential'|'horizontal'|'vertical'|null;
319 /** Additional rotation of the label. */
320 angle?: Angle|null;
321}
322
323interface MarkerLabel extends OrientedLabel {
324 /** The label position relatively to the marker. */
325 position?: 'center'|'top'|'left'|'bottom'|'right'|null;
326 /** Defines the transformation used for calculating the label color
327 from the marker color. */
328 filter?: ColorTransform|null;
329 /** Sets the order of values on the label if both a measure and a dimension are
330 present. */
331 format?: 'measureFirst'|'dimensionsFirst'|null;
332}
333
334interface Guides {
335 /** The color of the guides.*/
336 color?: Color|null;
337 /** Line width of the guide in pixel. */
338 lineWidth?: number|null;
339}
340
341interface Tooltip extends Font, Box {
342 /** The layout of the tooltip text */
343 layout?: 'singleLine'|'multiLine';
344 /** The foreground color of the tooltip text */
345 color?: Color;
346 /** Color of the drop shadow */
347 shadowColor?: Color;
348 /** Corner radius for the info bubble */
349 borderRadius?: number;
350 /** Drop shadow distance from the info bubble */
351 dropShadow?: number;
352 /** Data point marker radius */
353 radius?: number;
354 /** Base size of the info bubble arrow */
355 arrowSize?: number;
356 /** Distance between the data point and the info bubble */
357 distance?: number;
358 /** Specifies the name of the data series dispalyed
359 at the first position on the tooltip */
360 seriesName?: string|null;
361}
362
363interface Logo extends Padding
364{
365 /** Width of the Vizzu logo */
366 width?: Length|null;
367 /** Color transformation applied on the colored Vizzu Logo */
368 filter?: ColorTransform|null;
369}
370
371interface DataPoint {
372 /** Color gradient used for the measure on the color channel.*/
373 colorGradient?: ColorGradient|null;
374 /** Color palette used for the dimension on the color channel.*/
375 colorPalette?: ColorPalette|null;
376 /** Lightness value associated with the minimum value of the lightness
377 channel's range. */
378 minLightness?: number|null;
379 /** Lightness value associated with the maximum value of the lightness
380 channel's range. */
381 maxLightness?: number|null;
382 /** Minimum of line width specified as proportion of plot area size.
383 e.g.: 0.01 means 1% of the width of the plot area. */
384 lineMinWidth?: number|null;
385 /** Maximum line width specified as proportion of plot area size.
386 e.g.: 0.01 means 1% of the width of the plot area. */
387 lineMaxWidth?: number|null;
388 /** Minimum circle radius specified as proportion of plot area size.
389 e.g.: 0.01 means 1% of the width of the plot area. */
390 circleMinRadius?: number|null;
391 /** Maximum circle radius specified as proportion of plot area size.
392 e.g.: 0.01 means 1% of the width of the plot area. */
393 circleMaxRadius?: number|null;
394 /** Spacing between bars/columns. The value specifies the size of the
395 spacing as a factor of the marker size.
396 e.g.: 0.1 means 10% of marker height/width depending on the chart's orientation. */
397 rectangleSpacing?: number|null;
398}
399
400interface Marker extends DataPoint {
401 /** Width of the marker border in pixels. */
402 borderWidth?: number|null;
403 /** Opacity of the marker border. */
404 borderOpacity?: number|null;
405 borderOpacityMode?: 'straight'|'premultiplied'|null;
406 /** Opacity of the marker fill color. */
407 fillOpacity?: number|null;
408 /** Style settings for guide lines drawn for the markers. */
409 guides?: Guides|null;
410 /** Style settings for the marker labels. */
411 label?: MarkerLabel|null;
412}
413
414 /** Style settings for the values shown on the axis to display the scale
415 being used or the categories along the axis. */
416interface AxisLabel extends OrientedLabel {
417 /** Label position relatively to the plot. */
418 position?: 'axis'|'max-edge'|'min-edge'|null;
419 /** Label alignment relatively to the position on the plot. */
420 side?: 'positive'|'negative'|null;
421}
422
423 /** Style settings of the {@link Config.Channel.title|Axis title} */
424interface AxisTitle extends Label {
425 /** Title position relatively to the plot. */
426 position?: 'axis'|'min-edge'|'max-edge'|null;
427 /** Title alignment relatively to the position on the plot. */
428 side?: 'positive'|'upon'|'negative'|null;
429 /** Title position on the axis or edge. */
430 vposition?: 'begin'|'middle'|'end'|null;
431 /** Title alignment on the axis or edge. */
432 vside?: 'positive'|'upon'|'negative'|null;
433 /** The orientation of the title. */
434 orientation?: 'horizontal'|'vertical'|null;
435}
436
437interface Ticks {
438 /** Color of the ticks on the axis. */
439 color?: Color|null;
440 /** Line width of the ticks on the axis. */
441 lineWidth?: number|null;
442 /** Length of the ticks on the axis. */
443 length?: Length|null;
444 /** Position of the ticks on the axis relatively to the axis line. */
445 position?: 'outside'|'inside'|'center'|null;
446}
447interface Interlacing {
448 /** Color of the interlacing pattern. */
449 color?: Color|null;
450}
451
452interface Axis {
453 /** Color of the axis line. */
454 color?: Color|null;
455 /** Style parameters of the axis title. */
456 title?: AxisTitle|null;
457 /** Style parameters of the axis labels. */
458 label?: AxisLabel|null;
459 ticks?: Ticks|null;
460 guides?: Guides|null;
461 interlacing?: Interlacing|null;
462}
463
464interface Plot extends Padding, Box {
465 /** Style settings for the markers. */
466 marker?: Marker|null;
467 /** Style settings for the x-axis - or the angle when using polar coordinates. */
468 xAxis?: Axis|null;
469 /** Style settings for the y-axis - or the radius when using polar coordinates. */
470 yAxis?: Axis|null;
471 /** Controls drawing outside of the plot area. If hidden, clipping will be
472 set for the boundary of the coordinate system. */
473 overflow?: 'hidden'|'visible';
474}
475
476interface LegendMarker {
477 /** Shape of the legend marker. */
478 type?: 'circle'|'square'|null;
479 /** Size of the legend marker (diameter or side length). */
480 size?: Length|null;
481}
482
483interface Legend extends Padding, Box {
484 /** Width of the legend's boundary box. */
485 width?: Length|null;
486 /** Limit for the width of the boundary box. */
487 maxWidth?: Length|null;
488 /** Style settings for the legend's title. */
489 title?: Label|null;
490 /** Style settings for the labels on the legend. */
491 label?: Label|null;
492 marker?: LegendMarker|null;
493}
494
495 /** Color and position pairs separated by spaces,
496 where position is a number between 0 and 1. */
497type ColorStop = `${Color} ${number}`;
498
499/** Color gradient is specified by a comma separated list of ColorStops.
500 This is used when a measure is on the color channel. */
501type ColorGradient = ColorStop
502 | `${ColorStop},${ColorStop}`
503 | `${ColorStop},${ColorStop},${ColorStop}`
504 | `${ColorStop},${ColorStop},${ColorStop},${ColorStop}`
505 | `${ColorStop},${ColorStop},${ColorStop},${ColorStop},${ColorStop}`;
506
507/** Color palette is a list of colors separated by spaces.
508 This is used when only dimensions are on the color channel*/
509type ColorPalette = Color
510 | `${Color} ${Color}`
511 | `${Color} ${Color} ${Color}`
512 | `${Color} ${Color} ${Color} ${Color}`
513 | `${Color} ${Color} ${Color} ${Color} ${Color}`;
514
515type Label = Padding & Font & Text;
516
517interface Chart extends Padding, Box, Font {
518 /** Style settings for the plot area. */
519 plot?: Plot|null;
520 /** Style settings for the legend. */
521 legend?: Legend|null;
522 /** Style settings for the main chart title. */
523 title?: Label|null;
524 /** Style settings for the tooltip. */
525 tooltip?: Tooltip|null;
526 /** Style settings of the Vizzu logo. */
527 logo?: Logo|null;
528}
529
530}
531
532
533/** Represents a state in the animation describing the data, the chart, and
534 the style parameters to be changed from the actual state.
535 Passing null as style will reset every style parameter to default. */
536interface AnimTarget {
537 /** Data set. */
538 data?: Data.Set;
539 /** Chart configuration changes. */
540 config?: Config.Chart;
541 /** Style changes. */
542 style?: Styles.Chart|null;
543}
544
545declare namespace Anim
546{
547
548/** Duration can be set in seconds or milliseconds.
549 In case no unit is set, it defaults to seconds. */
550type Duration = `${number}s`|`${number}ms`|number;
551
552type Easing = 'none' | 'linear' | 'step-start' | 'step-end' | 'ease'
553 | 'ease-in' | 'ease-out' | 'ease-in-out'
554 | `cubic-bezier(${number},${number},${number},${number})`;
555
556/** Animation parameters for an animation group. */
557interface GroupOptions
558{
559 /** Sets the easing used for the animation. */
560 easing?: Easing;
561 /** The length of time an animation should take to complete. */
562 duration?: Duration;
563 /** Waiting time interval before the animation starts. */
564 delay?: Duration;
565}
566
567/** If no animation settings are passed to Vizzu, it will use an automatic
568 setting depending on the actual configuration of the chart. This behavior can be
569 overridden via the animation setting parameter.
570
571 The animation between two states of the chart can require the transitioning
572 of several different chart properties. These properties are grouped into
573 separately configurable animation groups.
574
575 The parameters can also be set for the animation as a whole. These settings
576 rescale the durations and delays of the animation groups to the
577 specified total delay and duration.
578 */
579interface Options extends GroupOptions {
580 /** Determines if the animation should start automatically after the
581 animate() call. */
582 playState?: 'paused'|'running';
583 /** Animation group for style parameters. */
584 style?: GroupOptions;
585 /** Title animation parameters. */
586 title?: GroupOptions;
587 /** Legend animation parameters. */
588 legend?: GroupOptions;
589 /** Animation group for new markers fading in
590 (due to filtering or added/removed data series). */
591 show?: GroupOptions;
592 /** Animation group for markers fading out
593 (due to filtering or added/removed data series). */
594 hide?: GroupOptions;
595 /** Marker color animation group. */
596 color?: GroupOptions;
597 /** Coordinate system transformations animation group. */
598 coordSystem?: GroupOptions;
599 /** Marker geometry morph animation group. */
600 geometry?: GroupOptions;
601 /** Animation group for marker transitions in the direction of the y-axis. */
602 y?: GroupOptions;
603 /** Animation group for marker transitions in the direction of the x-axis. */
604 x?: GroupOptions;
605 /** Animation group for tooltip transitions. */
606 tooltip?: GroupOptions;
607}
608
609/** Control object for animation. */
610interface Control extends Promise<Vizzu> {
611 /** Seeks the animation to the position specified by time or progress
612 percentage. Seeking the animation to the end position will not trigger
613 the (@link Vizzu.animate|animation promise) to resolve. */
614 seek(value: `${number}%`|Duration): void;
615 /** Pauses the controlled animation. */
616 pause(): void;
617 /** Plays/resumes playing of the controlled animation. */
618 play(): void;
619 /** Stops the current animation seeking it back to its start position. */
620 stop(): void;
621 /** Changes the direction of the controlled animation. */
622 reverse(): void;
623}
624
625}
626
627declare namespace Event
628{
629
630type Type =
631 'click'
632 |'mouseon'
633 |'mousemove'
634 |'wheel'
635 |'update'
636 |'background-draw'
637 |'title-draw'
638 |'logo-draw'
639 |'legend-background-draw'
640 |'legend-title-draw'
641 |'legend-label-draw'
642 |'legend-marker-draw'
643 |'legend-bar-draw'
644 |'plot-background-draw'
645 |'plot-marker-draw'
646 |'plot-marker-label-draw'
647 |'plot-marker-guide-draw'
648 |'plot-axis-draw'
649 |'plot-axis-title-draw'
650 |'plot-axis-label-draw'
651 |'plot-axis-tick-draw'
652 |'plot-axis-guide-draw'
653 |'plot-axis-interlacing-draw'
654 |'animation-begin'
655 |'animation-complete';
656
657/** The interface of the event object is passed to event handlers by the library.
658 Additional properties will vary by event type. */
659interface Object {
660 /** If called, the default action of the event will be canceled. */
661 preventDefault: () => void;
662}
663
664}
665
666type Snapshot = number;
667
668/** List of additional features:
669 - tooltip: tooltips on the chart appearing on markers on mouse over.
670 Since the tooltip uses the animation interface, calling animate() while
671 the tooltip is enabled can cause unwanted behaviour. */
672type Feature = 'tooltip';
673
674/** Class representing a single chart in Vizzu. */
675export default class Vizzu {
676 /** Creates a new chart and connects it to the div or canvas HTML
677 element specified by its ID or DOM object. The new chart is empty by
678 default, but can be set to an initial state in the second optional
679 parameter. */
680 constructor(container: string|HTMLElement, initState?: AnimTarget|Config.Chart);
681 /** Promise representing the initialization will resolve when
682 initialization is finished. Any API call will potentially cause
683 an error before this promise is resolved. */
684 initializing: Promise<Vizzu>;
685 /** Installs the provided event handler to the event specified by name. */
686 on(eventName: Event.Type, handler: (event: Event.Object) => void): void;
687 /** Uninstalls the provided event handler from the event specified by name.
688 */
689 off(eventName: Event.Type, handler: (event: Event.Object) => void): void;
690 /** Initiates the animation to the new chart state passed as the first
691 argument. If there is a currently running animation, all subsequent
692 calls will schedule the corresponding animation after the end of the
693 previous one.
694
695 The new chart state can be a full state specifier object with
696 data, config and style, or a single chart config object.
697 It accepts also a chart snapshot acquired from a previous state using
698 the store() method.
699
700 The optional second parameter specifies the animation
701 options. This second option can be a scalar value, setting the overall
702 animation duration. Passing explicit null as second parameter will
703 result in no animation.
704
705 The animation will be initiated in the next cycle of the JS event loop.
706 The method returns a promise, which will resolve when the animation is
707 finished. */
708 animate(
709 animTarget: AnimTarget|Config.Chart|Snapshot,
710 animOptions?: Anim.Options|Anim.Duration|null)
711 : Anim.Control;
712 /** Returns a reference to the actual chart state for further reuse.
713 This reference includes the chart config and style parameters but
714 does not include the data parameter and the animation options.
715 */
716 store(): Snapshot;
717 /** Returns controls for the ongoing animation, if any.
718 @deprecated since version 0.4.0 */
719 get animation(): Anim.Control;
720 /** Returns the version number of the library. */
721 version(): string;
722 /** Property for read-only access to style object. */
723 style: Readonly<Styles.Chart>;
724 /** Property for read-only access to chart parameter object. */
725 config: Readonly<Config.Chart>;
726 /** Enable/disable additional features. */
727 feature(name: Feature, enabled: boolean): void;
728 /** Setter method for Library options. */
729 static options(options: Lib.Options): void;
730}