UNPKG

29.4 kBTypeScriptView Raw
1// Type definitions for Chartist v0.11.4
2// Project: https://github.com/gionkunz/chartist-js
3// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Anastasiia Antonova <https://github.com/affilnost>, Sunny Juneja <https://github.com/sunnyrjuneja>, Sam Raudabaugh <https://github.com/raudabaugh>, Manuel Borrajo <https://github.com/borrajo>, Alexander Goooseman <https://github.com/goooseman>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6declare namespace Chartist {
7
8 interface ChartistStatic {
9
10 /**
11 * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
12 */
13 precision: number;
14
15 /**
16 * A map with characters to escape for strings to be safely used as attribute values.
17 */
18 escapingMap: IChartistEscapeMap;
19
20 Pie: IChartistPieChart;
21 Bar: IChartistBarChart;
22 Line: IChartistLineChart;
23 Candle: IChartistCandleChart;
24
25 FixedScaleAxis: IFixedScaleAxisStatic;
26 AutoScaleAxis: IAutoScaleAxisStatic;
27 StepAxis: IStepAxisStatic;
28
29 Svg: ChartistSvgStatic;
30 Interpolation: ChartistInterpolationStatic;
31
32 noop: Function;
33
34 alphaNumerate(n: number): string;
35
36 extend(target: Object, ...sources: Object[]): Object;
37
38 replaceAll(str: string, subStr: string, newSubStr: string): string;
39
40 ensureUnit(value: number, unit: string): string;
41
42 quantity(input: string | number): Object;
43
44 query(query: Node | string): Node;
45
46 times(length: number): Array<any>;
47
48 sum(previous: number, current: number): number;
49
50 mapMultiply(factor: number): (num: number) => number;
51
52 mapAdd(addend: number): (num: number) => number;
53
54 serialMap(arr: Array<any>, cb: Function): Array<any>;
55
56 roundWithPrecision(value: number, digits?: number): number;
57
58 getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples
59
60 serialize(data: Object | string | number): string;
61
62 deserialize(data: string): Object | string | number;
63
64 createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement
65
66 plugins: any;
67 }
68
69 interface IChartistEscapeMap {
70 [Key: string]: string;
71 }
72
73 interface IResponsiveOptionTuple<T extends IChartOptions> extends Array<string | T> {
74 0: string;
75 1: T;
76 }
77
78 // these have no other purpose than to help define the types that can be placed on
79 // a line chart axisX
80 // in the actual chartist library these are classes that project their options onto
81 // the parent class
82 interface IFixedScaleAxisStatic {
83 }
84
85 interface IAutoScaleAxisStatic {
86 }
87
88 interface IStepAxisStatic {
89 }
90
91 // data formats are not well documented on all the ways they can be passed to the constructors
92 // this definition gives some intellisense, but does not protect the user from misuse
93 // TODO: come in and tidy this up and make it fit better
94 interface IChartistData {
95 labels?: Array<string> | Array<number> | Array<Date>;
96 series: Array<IChartistSeriesData> | Array<Array<IChartistSeriesData>> | Array<Array<IChartistData>> | Array<number> | Array<Array<number>>;
97 }
98
99 interface IChartistSeriesData {
100 name?: string;
101 value?: number;
102 data?: Array<number> | Array<{ x: number | Date, y: number }>;
103 className?: string;
104 meta?: any;
105 }
106
107 interface IChartistBase<T extends IChartOptions> {
108 container: any;
109 data: IChartistData;
110 defaultOptions: T;
111 options: T;
112 responsiveOptions: Array<IResponsiveOptionTuple<T>>;
113
114 // this most likely doesn't need to be exposed to the user
115 eventEmitter: any;
116
117 supportsForeignObject: boolean;
118 supportsAnimations: boolean;
119 resizeListener: any;
120
121 plugins?: Array<any>; // all of these plugins seem to be functions with options, but keeping type any for now
122
123 update(data: Object, options?: T, override?: boolean): void;
124
125 detach(): void;
126
127 /**
128 * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
129 *
130 * @method on
131 * @param event {string} Name of the event. Check the examples for supported events.
132 * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.
133 */
134 on(event: string, handler: Function): IChartistBase<T>;
135
136 /**
137 * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.
138 *
139 * @method off
140 * @param event {string} Name of the event for which a handler should be removed
141 * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.
142 */
143 off(event: string, handler?: Function): IChartistBase<T>;
144 }
145
146 interface IChartistPieChart extends IChartistBase<IPieChartOptions> {
147 new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IPieChartOptions>>): IChartistPieChart;
148 }
149
150 interface IChartistLineChart extends IChartistBase<ILineChartOptions> {
151 new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<ILineChartOptions>>): IChartistLineChart;
152 }
153
154 interface IChartistBarChart extends IChartistBase<IBarChartOptions> {
155 new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IBarChartOptions>>): IChartistBarChart;
156 }
157
158 interface IChartistCandleChart extends IChartistBase<ICandleChartOptions> {
159 new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<ICandleChartOptions>>): IChartistCandleChart;
160 }
161
162 interface IChartOptions {
163 /**
164 * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
165 */
166 reverseData?: boolean;
167
168 plugins?: Array<any>;
169 }
170
171 interface IPieChartOptions extends IChartOptions {
172 /**
173 * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
174 */
175 width?: number | string;
176
177 /**
178 * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
179 */
180 height?: number | string;
181
182 /**
183 * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
184 */
185 chartPadding?: IChartPadding | number;
186
187 /**
188 * Override the class names that are used to generate the SVG structure of the chart
189 */
190 classNames?: IPieChartClasses;
191
192 /**
193 * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise.
194 */
195 startAngle?: number;
196
197 /**
198 * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts.
199 */
200 total?: number;
201
202 /**
203 * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices.
204 */
205 donut?: boolean;
206
207 /**
208 * If specified the donut segments will be drawn as shapes instead of strokes.
209 */
210 donutSolid?: boolean;
211
212 /**
213 * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future.
214 * This option can be set as number or string to specify a relative width (i.e. 100 or '30%').
215 */
216 donutWidth?: number | string;
217
218 /**
219 * Specify if a label should be shown or not
220 */
221 showLabel?: boolean;
222
223 /**
224 * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center.
225 */
226 labelOffset?: number;
227
228 /**
229 * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option.
230 */
231 labelPosition?: string;
232
233 /**
234 * An interpolation function for the label value
235 */
236 labelInterpolationFnc?: Function;
237
238 /**
239 * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center.
240 */
241 labelDirection?: string;
242
243 /**
244 * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
245 */
246 reverseData?: boolean;
247
248 /**
249 * If true empty values will be ignored to avoid drawing unncessary slices and labels
250 */
251 ignoreEmptyValues?: boolean;
252 }
253
254 interface IChartPadding {
255 top?: number;
256 right?: number;
257 bottom?: number;
258 left?: number;
259 }
260
261 interface IChartRect {
262 height: () => void;
263 width: () => void;
264 padding: IChartPadding;
265 x1: number;
266 x2: number;
267 y1: number;
268 y2: number;
269 }
270
271 interface IChartUnits {
272 dir: "vertical" | "horizontal";
273 len: "height" | "width";
274 pos: "x" | "y";
275 rectEnd: string;
276 rectOffset: string;
277 rectStart: string;
278 }
279
280 interface IChartAxis {
281 axisLength: number;
282 chartRect: IChartRect;
283 counterUnits: IChartUnits;
284 divisor: number;
285 gridOffset: number;
286 options: unknown;
287 range: {
288 min: number;
289 max: number;
290 };
291 stepLength: number;
292 ticks: number[];
293 units: IChartUnits;
294 }
295
296 interface IChartDrawLabelData {
297 type: "label";
298 axis: IChartAxis;
299 element: IChartistSvg;
300 group: IChartistSvg;
301 height: number;
302 index: number;
303 text: number;
304 width: number;
305 x: number;
306 y: number;
307 }
308
309 interface IChartDrawGridData {
310 type: "grid";
311 axis: IChartAxis;
312 element: IChartistSvg;
313 group: IChartistSvg;
314 index: number;
315 x1: number;
316 x2: number;
317 y1: number;
318 y2: number;
319 }
320
321 interface IChartDrawBarData {
322 type: "bar";
323 axisX: IChartAxis;
324 axisY: IChartAxis;
325 chartRect: IChartRect;
326 element: IChartistSvg;
327 group: IChartistSvg;
328 index: number;
329 meta: unknown;
330 series: number[];
331 seriesIndex: number;
332 value: {
333 x?: number;
334 y?: number;
335 };
336 x1: number;
337 x2: number;
338 y1: number;
339 y2: number;
340 }
341
342 type ChartDrawData =
343 | IChartDrawLabelData
344 | IChartDrawGridData
345 | IChartDrawBarData;
346
347 interface IPieChartClasses {
348 chartPie?: string;
349 chartDonut?: string;
350 series?: string;
351 slicePie?: string;
352 sliceDonut?: string;
353 label?: string;
354 }
355
356 interface IBarChartOptions extends IChartOptions {
357 axisX?: IBarChartAxis;
358 axisY?: IBarChartAxis;
359 width?: number | string;
360 height?: number | string;
361 high?: number;
362 low?: number;
363 ticks?: Array<string | number>;
364 onlyInteger?: boolean;
365 chartPadding?: IChartPadding;
366 seriesBarDistance?: number;
367 /**
368 * Override the class names that are used to generate the SVG structure of the chart
369 */
370 classNames?: IBarChartClasses;
371 /**
372 * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.
373 */
374 stackBars?: boolean;
375 stackMode?: 'overlap' | 'accumulate';
376
377 horizontalBars?: boolean;
378 distributeSeries?: boolean;
379 }
380
381 interface IBarChartAxis {
382 offset?: number;
383 position?: string;
384 labelOffset?: {
385 x?: number;
386 y?: number;
387 };
388 showLabel?: boolean;
389 showGrid?: boolean;
390 labelInterpolationFnc?: Function;
391 scaleMinSpace?: number;
392 onlyInteger?: boolean;
393 }
394
395 interface IBarChartClasses {
396 chart?: string;
397 horizontalBars?: string;
398 label?: string;
399 labelGroup?: string;
400 series?: string;
401 bar?: string;
402 grid?: string;
403 gridGroup?: string;
404 vertical?: string;
405 horizontal?: string;
406 start?: string;
407 end?: string;
408 }
409
410 interface ILineChartOptions extends IChartOptions {
411 axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
412 axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
413 width?: number | string;
414 height?: number | string;
415 showLine?: boolean;
416 showPoint?: boolean;
417 showArea?: boolean;
418 areaBase?: number;
419 lineSmooth?: Function | boolean;
420 low?: number;
421 high?: number;
422 ticks?: Array<string | number>;
423 chartPadding?: IChartPadding;
424 fullWidth?: boolean;
425 classNames?: ILineChartClasses;
426 series?: {
427 [key: string]: {
428 lineSmooth?: Function | boolean;
429 showLine?: boolean;
430 showPoint?: boolean;
431 showArea?: boolean;
432 areaBase?: number;
433 }
434 }
435 }
436
437 interface ILineChartAxis {
438 offset?: number;
439 position?: string;
440 labelOffset?: {
441 x?: number;
442 y?: number;
443 };
444 showLabel?: boolean;
445 showGrid?: boolean;
446 labelInterpolationFnc?: Function;
447 }
448
449 interface IChartistStepAxis extends ILineChartAxis {
450 type?: IStepAxisStatic;
451 ticks?: Array<string> | Array<number>;
452 stretch?: boolean;
453 }
454
455 interface IChartistFixedScaleAxis extends ILineChartAxis {
456 type?: IFixedScaleAxisStatic;
457 high?: number;
458 low?: number;
459 divisor?: number;
460 ticks?: Array<string> | Array<number>;
461 }
462
463 interface IChartistAutoScaleAxis extends ILineChartAxis {
464 high?: number;
465 low?: number;
466 scaleMinSpace?: number;
467 onlyInteger?: boolean;
468 referenceValue?: number;
469 type?: IAutoScaleAxisStatic;
470 }
471
472 interface ILineChartClasses {
473 /**
474 * Default is 'ct-chart-line'
475 */
476 chart?: string;
477 label?: string;
478 labelGroup?: string;
479 series?: string;
480 line?: string;
481 point?: string;
482 area?: string;
483 grid?: string;
484 gridGroup?: string;
485 gridBackground?: string;
486 vertical?: string;
487 horizontal?: string;
488 start?: string;
489 end?: string;
490 }
491
492 interface ICandleChartOptions extends IChartOptions {
493
494 /**
495 * Options for X-Axis
496 */
497 axisX?: ICandleChartAxis;
498
499 /**
500 * Options for Y-Axis
501 */
502 axisY?: ICandleChartAxis;
503
504 /**
505 * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
506 */
507 width?: number | string;
508
509 /**
510 * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
511 */
512 height?: number | string;
513
514 /**
515 * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
516 */
517 hight?: number | string;
518
519 /**
520 * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
521 */
522 low?: number | string;
523
524 /**
525 * Width of candle body in pixel (IMO is 2 px best minimum value)
526 */
527 candleWidth?: number | string;
528
529 /**
530 * Width of candle wick in pixel (IMO is 1 px best minimum value)
531 */
532 candleWickWidth?: number | string;
533
534 /**
535 * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used.
536 */
537 useStepLengthAsCandleWidth?: boolean | string;
538
539 /**
540 * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used.
541 */
542 useOneThirdAsCandleWickWidth?: boolean | string;
543
544 /**
545 * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
546 */
547 chartPadding?: IChartPadding | number;
548
549 /**
550 * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler.
551 */
552 fullWidth?: boolean | string;
553
554 /**
555 * Override the class names that get used to generate the SVG structure of the chart
556 */
557 classNames?: ICandleChartClasses;
558 }
559
560 interface ICandleChartAxis {
561 /**
562 * The offset of the chart drawing area to the border of the container
563 */
564 offset?: number;
565 /**
566 * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
567 */
568 position?: string;
569 /**
570 * Allows you to correct label positioning on this axis by positive or negative x and y offset.
571 */
572 labelOffset?: {
573 x?: number;
574 y?: number;
575 };
576 /**
577 * If labels should be shown or not
578 */
579 showLabel?: boolean;
580 /**
581 * If the axis grid should be drawn or not
582 */
583 showGrid?: boolean;
584 /**
585 * Interpolation function that allows you to intercept the value from the axis label
586 */
587 labelInterpolationFnc?: Function;
588 /**
589 * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
590 */
591 type?: any;
592 }
593
594 interface ICandleChartClasses {
595 chart?: string;
596 label?: string;
597 labelGroup?: string;
598 series?: string;
599 candlePositive?: string;
600 candleNegative?: string,
601 grid?: string,
602 gridGroup?: string,
603 gridBackground?: string,
604 vertical?: string,
605 horizontal?: string,
606 start?: string,
607 end?: string,
608 }
609
610
611 interface ChartistSvgStatic {
612 new (name?: HTMLElement | string, attributes?: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg;
613
614 Easing: ChartistEasingStatic;
615
616 /**
617 * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.
618 */
619 isSupported(feature: string): boolean;
620 }
621
622 interface IChartistSvg {
623 /**
624 * The SVG DOM element wrapped by IChartistSvg
625 */
626 _node: HTMLElement;
627
628 /**
629 * Set attributes on the current SVG element of the wrapper you're currently working on.
630 */
631 attr(attributes: Object | string, ns?: string): Object | string;
632
633 /**
634 * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
635 */
636 elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
637
638 /**
639 * Returns the parent Chartist.SVG wrapper object
640 */
641 parent(): IChartistSvg;
642
643 /**
644 * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.
645 */
646 root(): IChartistSvg;
647
648 /**
649 * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.
650 */
651 querySelector(selector: string): IChartistSvg;
652
653 /**
654 * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.
655 */
656 querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list
657
658 /**
659 * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
660 */
661 foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
662
663 /**
664 * This method adds a new text element to the current Chartist.Svg wrapper.
665 */
666 text(t: string): IChartistSvg;
667
668 /**
669 * This method will clear all child nodes of the current wrapper object.
670 */
671 empty(): IChartistSvg;
672
673 /**
674 * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
675 */
676 remove(): IChartistSvg;
677
678 /**
679 * This method will replace the element with a new element that can be created outside of the current DOM.
680 */
681 replace(): IChartistSvg;
682
683 /**
684 * This method will append an element to the current element as a child.
685 */
686 append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg;
687
688 /**
689 * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
690 */
691 classes(): Array<string>;
692
693 /**
694 * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
695 *
696 * @method addClass
697 * @param names {string} A white space separated list of class names
698 */
699 addClass(names: string): IChartistSvg;
700
701 /**
702 * Removes one or a space separated list of classes from the current element.
703 *
704 * @method removeClass
705 * @param names {string} A white space separated list of class names
706 */
707 removeClass(names: string): IChartistSvg;
708
709 /**
710 * Removes all classes from the current element.
711 */
712 removeAllClasses(): IChartistSvg;
713
714 /**
715 * Get element height with fallback to svg BoundingBox or parent container dimensions
716 */
717 height(): number;
718
719 /**
720 * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes.
721 */
722 animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg;
723
724 /**
725 * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node.
726 * THIS IS A WORKAROUND
727 */
728 getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static
729 }
730
731 interface IChartistAnimations {
732 [Key: string]: IChartistAnimationOptions;
733 }
734
735 interface IChartistAnimationOptions {
736 id?: string;
737 dur: string | number;
738 from: string | number;
739 to: string | number;
740 easing?: IChartistEasingDefinition | string;
741 fill?: string;
742 begin?: string;
743 }
744
745 interface IChartistEasingDefinition {
746 0: number;
747 1: number;
748 2: number;
749 3: number;
750 }
751
752 interface ChartistEasingStatic {
753 easeInSine: IChartistEasingDefinition;
754 easeOutSine: IChartistEasingDefinition;
755 easeInOutSine: IChartistEasingDefinition;
756 easeInQuad: IChartistEasingDefinition;
757 easeOutQuad: IChartistEasingDefinition;
758 easeInOutQuad: IChartistEasingDefinition;
759 easeInCubic: IChartistEasingDefinition;
760 easeOutCubic: IChartistEasingDefinition;
761 easeInOutCubic: IChartistEasingDefinition;
762 easeInQuart: IChartistEasingDefinition;
763 easeOutQuart: IChartistEasingDefinition;
764 easeInOutQuart: IChartistEasingDefinition;
765 easeInQuint: IChartistEasingDefinition;
766 easeOutQuint: IChartistEasingDefinition;
767 easeInOutQuint: IChartistEasingDefinition;
768 easeInExpo: IChartistEasingDefinition;
769 easeOutExpo: IChartistEasingDefinition;
770 easeInOutExpo: IChartistEasingDefinition;
771 easeInCirc: IChartistEasingDefinition;
772 easeOutCirc: IChartistEasingDefinition;
773 easeInOutCirc: IChartistEasingDefinition;
774 easeInBack: IChartistEasingDefinition;
775 easeOutBack: IChartistEasingDefinition;
776 easeInOutBack: IChartistEasingDefinition;
777 }
778
779 interface ChartistInterpolationStatic {
780
781 /**
782 * This interpolation function does not smooth the path and the result is only containing lines and no curves.
783 */
784 none(options?: IChartistInterpolationOptions): Function;
785
786 /**
787 * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.
788 */
789 simple(options?: IChartistSimpleInterpolationOptions): Function;
790
791 /**
792 * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.
793 */
794 cardinal(options?: IChartistCardinalInterpolationOptions): Function;
795
796 /**
797 * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled.
798 */
799 step(options?: IChartistStepInterpolationOptions): Function;
800 }
801
802 interface IChartistInterpolationOptions {
803 fillHoles?: boolean;
804 }
805
806 interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions {
807 divisor?: number;
808 }
809
810 interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions {
811 tension?: number;
812 }
813
814 interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions {
815 postpone?: boolean;
816 }
817}
818
819declare var Chartist: Chartist.ChartistStatic;
820
821export = Chartist;
822export as namespace Chartist;