chartist 1.5.0 → 2.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +45 -101
  2. package/dist/_settings.scss +1 -89
  3. package/dist/chartist.min.css +2 -0
  4. package/dist/chartist.min.js +2 -0
  5. package/dist/compat.cjs +624 -0
  6. package/dist/compat.cjs.map +1 -0
  7. package/dist/compat.d.cts +202 -0
  8. package/dist/compat.d.ts +201 -0
  9. package/dist/compat.js +603 -0
  10. package/dist/compat.js.map +1 -0
  11. package/dist/compat.min.js +2 -0
  12. package/dist/compat.min.js.map +1 -0
  13. package/dist/compat.umd.js +2 -0
  14. package/dist/compat.umd.js.map +1 -0
  15. package/dist/index.cjs +5970 -3489
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +903 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +5167 -0
  20. package/dist/index.d.ts +5166 -8
  21. package/dist/index.js +5935 -3484
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.css +2 -0
  24. package/dist/index.min.css.map +1 -0
  25. package/dist/index.min.js +2 -0
  26. package/dist/index.min.js.map +1 -0
  27. package/dist/index.scss +1 -204
  28. package/dist/index.umd.js +2 -2
  29. package/dist/index.umd.js.map +1 -1
  30. package/dist/scss/_settings.scss +155 -0
  31. package/dist/scss/index.scss +262 -0
  32. package/dist/scss/themes/accessible.scss +53 -0
  33. package/dist/themes/accessible.css +34 -0
  34. package/dist/themes/accessible.min.css +1 -0
  35. package/package.json +238 -12
  36. package/dist/axes/AutoScaleAxis.d.ts +0 -12
  37. package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
  38. package/dist/axes/Axis.d.ts +0 -40
  39. package/dist/axes/Axis.d.ts.map +0 -1
  40. package/dist/axes/FixedScaleAxis.d.ts +0 -11
  41. package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
  42. package/dist/axes/StepAxis.d.ts +0 -9
  43. package/dist/axes/StepAxis.d.ts.map +0 -1
  44. package/dist/axes/index.d.ts +0 -6
  45. package/dist/axes/index.d.ts.map +0 -1
  46. package/dist/axes/types.d.ts +0 -5
  47. package/dist/axes/types.d.ts.map +0 -1
  48. package/dist/charts/BarChart/BarChart.d.ts +0 -50
  49. package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
  50. package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
  51. package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
  52. package/dist/charts/BarChart/index.d.ts +0 -3
  53. package/dist/charts/BarChart/index.d.ts.map +0 -1
  54. package/dist/charts/BaseChart.d.ts +0 -47
  55. package/dist/charts/BaseChart.d.ts.map +0 -1
  56. package/dist/charts/LineChart/LineChart.d.ts +0 -97
  57. package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
  58. package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
  59. package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
  60. package/dist/charts/LineChart/index.d.ts +0 -3
  61. package/dist/charts/LineChart/index.d.ts.map +0 -1
  62. package/dist/charts/PieChart/PieChart.d.ts +0 -101
  63. package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
  64. package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
  65. package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
  66. package/dist/charts/PieChart/index.d.ts +0 -3
  67. package/dist/charts/PieChart/index.d.ts.map +0 -1
  68. package/dist/charts/index.d.ts +0 -6
  69. package/dist/charts/index.d.ts.map +0 -1
  70. package/dist/charts/types.d.ts +0 -11
  71. package/dist/charts/types.d.ts.map +0 -1
  72. package/dist/core/constants.d.ts +0 -13
  73. package/dist/core/constants.d.ts.map +0 -1
  74. package/dist/core/creation.d.ts +0 -61
  75. package/dist/core/creation.d.ts.map +0 -1
  76. package/dist/core/data/bounds.d.ts +0 -14
  77. package/dist/core/data/bounds.d.ts.map +0 -1
  78. package/dist/core/data/data.d.ts +0 -23
  79. package/dist/core/data/data.d.ts.map +0 -1
  80. package/dist/core/data/highLow.d.ts +0 -13
  81. package/dist/core/data/highLow.d.ts.map +0 -1
  82. package/dist/core/data/index.d.ts +0 -7
  83. package/dist/core/data/index.d.ts.map +0 -1
  84. package/dist/core/data/normalize.d.ts +0 -11
  85. package/dist/core/data/normalize.d.ts.map +0 -1
  86. package/dist/core/data/segments.d.ts +0 -29
  87. package/dist/core/data/segments.d.ts.map +0 -1
  88. package/dist/core/data/serialize.d.ts +0 -12
  89. package/dist/core/data/serialize.d.ts.map +0 -1
  90. package/dist/core/index.d.ts +0 -8
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/lang.d.ts +0 -23
  93. package/dist/core/lang.d.ts.map +0 -1
  94. package/dist/core/math.d.ts +0 -42
  95. package/dist/core/math.d.ts.map +0 -1
  96. package/dist/core/optionsProvider.d.ts +0 -15
  97. package/dist/core/optionsProvider.d.ts.map +0 -1
  98. package/dist/core/types.d.ts +0 -274
  99. package/dist/core/types.d.ts.map +0 -1
  100. package/dist/event/EventEmitter.d.ts +0 -27
  101. package/dist/event/EventEmitter.d.ts.map +0 -1
  102. package/dist/event/index.d.ts +0 -2
  103. package/dist/event/index.d.ts.map +0 -1
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/interpolation/cardinal.d.ts +0 -30
  106. package/dist/interpolation/cardinal.d.ts.map +0 -1
  107. package/dist/interpolation/index.d.ts +0 -6
  108. package/dist/interpolation/index.d.ts.map +0 -1
  109. package/dist/interpolation/monotoneCubic.d.ts +0 -30
  110. package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
  111. package/dist/interpolation/none.d.ts +0 -22
  112. package/dist/interpolation/none.d.ts.map +0 -1
  113. package/dist/interpolation/simple.d.ts +0 -30
  114. package/dist/interpolation/simple.d.ts.map +0 -1
  115. package/dist/interpolation/step.d.ts +0 -26
  116. package/dist/interpolation/step.d.ts.map +0 -1
  117. package/dist/svg/Svg.d.ts +0 -201
  118. package/dist/svg/Svg.d.ts.map +0 -1
  119. package/dist/svg/SvgList.d.ts +0 -31
  120. package/dist/svg/SvgList.d.ts.map +0 -1
  121. package/dist/svg/SvgPath.d.ts +0 -125
  122. package/dist/svg/SvgPath.d.ts.map +0 -1
  123. package/dist/svg/animation.d.ts +0 -37
  124. package/dist/svg/animation.d.ts.map +0 -1
  125. package/dist/svg/index.d.ts +0 -6
  126. package/dist/svg/index.d.ts.map +0 -1
  127. package/dist/svg/types.d.ts +0 -55
  128. package/dist/svg/types.d.ts.map +0 -1
  129. package/dist/utils/extend.d.ts +0 -10
  130. package/dist/utils/extend.d.ts.map +0 -1
  131. package/dist/utils/functional.d.ts +0 -31
  132. package/dist/utils/functional.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -5
  134. package/dist/utils/index.d.ts.map +0 -1
  135. package/dist/utils/types.d.ts +0 -7
  136. package/dist/utils/types.d.ts.map +0 -1
  137. package/dist/utils/utils.d.ts +0 -31
  138. package/dist/utils/utils.d.ts.map +0 -1
@@ -1,29 +0,0 @@
1
- import type { Segment, SegmentData } from '../types';
2
- /**
3
- * Splits a list of coordinates and associated values into segments. Each returned segment contains a pathCoordinates
4
- * valueData property describing the segment.
5
- *
6
- * With the default options, segments consist of contiguous sets of points that do not have an undefined value. Any
7
- * points with undefined values are discarded.
8
- *
9
- * **Options**
10
- * The following options are used to determine how segments are formed
11
- * ```javascript
12
- * var options = {
13
- * // If fillHoles is true, undefined values are simply discarded without creating a new segment. Assuming other options are default, this returns single segment.
14
- * fillHoles: false,
15
- * // If increasingX is true, the coordinates in all segments have strictly increasing x-values.
16
- * increasingX: false
17
- * };
18
- * ```
19
- *
20
- * @param pathCoordinates List of point coordinates to be split in the form [x1, y1, x2, y2 ... xn, yn]
21
- * @param valueData List of associated point values in the form [v1, v2 .. vn]
22
- * @param options Options set by user
23
- * @return List of segments, each containing a pathCoordinates and valueData property.
24
- */
25
- export declare function splitIntoSegments(pathCoordinates: number[], valueData: SegmentData[], options?: {
26
- increasingX?: boolean;
27
- fillHoles?: boolean;
28
- }): Segment[];
29
- //# sourceMappingURL=segments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/core/data/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAC/B,eAAe,EAAE,MAAM,EAAE,EACzB,SAAS,EAAE,WAAW,EAAE,EACxB,OAAO,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,aAgDF"}
@@ -1,12 +0,0 @@
1
- /**
2
- * This function serializes arbitrary data to a string. In case of data that can't be easily converted to a string, this function will create a wrapper object and serialize the data using JSON.stringify. The outcoming string will always be escaped using Chartist.escapingMap.
3
- * If called with null or undefined the function will return immediately with null or undefined.
4
- */
5
- export declare function serialize(data: number | string | object): string;
6
- export declare function serialize(data: number | string | object | null | undefined | unknown): string | null | undefined;
7
- /**
8
- * This function de-serializes a string previously serialized with Chartist.serialize. The string will always be unescaped using Chartist.escapingMap before it's returned. Based on the input value the return type can be Number, String or Object. JSON.parse is used with try / catch to see if the unescaped string can be parsed into an Object and this Object will be returned on success.
9
- */
10
- export declare function deserialize<T extends object | number | string = object>(data: string): T;
11
- export declare function deserialize<T extends object | number | string = object>(data: string | null | undefined): T | null | undefined;
12
- //# sourceMappingURL=serialize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../src/core/data/serialize.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAClE,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAC1D,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAsB7B;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EACrE,IAAI,EAAE,MAAM,GACX,CAAC,CAAC;AACL,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EACrE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC9B,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC"}
@@ -1,8 +0,0 @@
1
- export * from './constants';
2
- export * from './lang';
3
- export * from './math';
4
- export * from './data';
5
- export * from './creation';
6
- export * from './optionsProvider';
7
- export * from './types';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Converts a number to a string with a unit. If a string is passed then this will be returned unmodified.
3
- * @return Returns the passed number value with unit.
4
- */
5
- export declare function ensureUnit<T>(value: T, unit: string): string | T;
6
- /**
7
- * Converts a number or string to a quantity object.
8
- * @return Returns an object containing the value as number and the unit as string.
9
- */
10
- export declare function quantity<T>(input: T): {
11
- value: number;
12
- unit: string | undefined;
13
- } | {
14
- value: number;
15
- unit?: undefined;
16
- };
17
- /**
18
- * Generates a-z from a number 0 to 26
19
- * @param n A number from 0 to 26 that will result in a letter a-z
20
- * @return A character from a-z based on the input number n
21
- */
22
- export declare function alphaNumerate(n: number): string;
23
- //# sourceMappingURL=lang.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../src/core/lang.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,cAMnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;;;;;;EAYnC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,UAGtC"}
@@ -1,42 +0,0 @@
1
- import type { Bounds } from './types';
2
- export declare const EPSILON = 2.221e-16;
3
- /**
4
- * Calculate the order of magnitude for the chart scale
5
- * @param value The value Range of the chart
6
- * @return The order of magnitude
7
- */
8
- export declare function orderOfMagnitude(value: number): number;
9
- /**
10
- * Project a data length into screen coordinates (pixels)
11
- * @param axisLength The svg element for the chart
12
- * @param length Single data value from a series array
13
- * @param bounds All the values to set the bounds of the chart
14
- * @return The projected data length in pixels
15
- */
16
- export declare function projectLength(axisLength: number, length: number, bounds: Bounds): number;
17
- /**
18
- * This helper function can be used to round values with certain precision level after decimal. This is used to prevent rounding errors near float point precision limit.
19
- * @param value The value that should be rounded with precision
20
- * @param [digits] The number of digits after decimal used to do the rounding
21
- * @returns Rounded value
22
- */
23
- export declare function roundWithPrecision(value: number, digits?: number): number;
24
- /**
25
- * Pollard Rho Algorithm to find smallest factor of an integer value. There are more efficient algorithms for factorization, but this one is quite efficient and not so complex.
26
- * @param num An integer number where the smallest factor should be searched for
27
- * @returns The smallest integer factor of the parameter num.
28
- */
29
- export declare function rho(num: number): number;
30
- /**
31
- * Calculate cartesian coordinates of polar coordinates
32
- * @param centerX X-axis coordinates of center point of circle segment
33
- * @param centerY X-axis coordinates of center point of circle segment
34
- * @param radius Radius of circle segment
35
- * @param angleInDegrees Angle of circle segment in degrees
36
- * @return Coordinates of point on circumference
37
- */
38
- export declare function polarToCartesian(centerX: number, centerY: number, radius: number, angleInDegrees: number): {
39
- x: number;
40
- y: number;
41
- };
42
- //# sourceMappingURL=math.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/core/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,UAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,UAGf;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,UAGhE;AAED;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,UAgC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM;;;EAQvB"}
@@ -1,15 +0,0 @@
1
- import type { EventEmitter } from '../event';
2
- import type { ResponsiveOptions } from './types';
3
- export interface OptionsProvider<T = unknown> {
4
- removeMediaQueryListeners(): void;
5
- getCurrentOptions(): T;
6
- }
7
- /**
8
- * Provides options handling functionality with callback for options changes triggered by responsive options and media query matches
9
- * @param options Options set by user
10
- * @param responsiveOptions Optional functions to add responsive behavior to chart
11
- * @param eventEmitter The event emitter that will be used to emit the options changed events
12
- * @return The consolidated options object from the defaults, base and matching responsive options
13
- */
14
- export declare function optionsProvider<T = unknown>(options: T, responsiveOptions: ResponsiveOptions<T> | undefined, eventEmitter: EventEmitter): OptionsProvider<T>;
15
- //# sourceMappingURL=optionsProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optionsProvider.d.ts","sourceRoot":"","sources":["../../src/core/optionsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGtE,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,yBAAyB,IAAI,IAAI,CAAC;IAClC,iBAAiB,IAAI,CAAC,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EACzC,OAAO,EAAE,CAAC,EACV,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,EACnD,YAAY,EAAE,YAAY,GACzB,eAAe,CAAC,CAAC,CAAC,CAmDpB"}
@@ -1,274 +0,0 @@
1
- import type { RequiredKeys } from '../utils';
2
- import type { Axis, AxisType } from '../axes';
3
- import type { Svg } from '../svg';
4
- export interface ChartPadding {
5
- top: number;
6
- right: number;
7
- bottom: number;
8
- left: number;
9
- }
10
- export interface ChartRect {
11
- x1: number;
12
- x2: number;
13
- y1: number;
14
- y2: number;
15
- padding: ChartPadding;
16
- width(): number;
17
- height(): number;
18
- }
19
- export declare type Plugin = (chart: any, options?: any) => void;
20
- export declare type Meta = any;
21
- export interface ViewBox {
22
- width: number;
23
- height: number;
24
- }
25
- export interface Options<TXAxisOptions = AxisOptions, TYAxisOptions = TXAxisOptions> {
26
- /**
27
- * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
28
- */
29
- width?: number | string;
30
- /**
31
- * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
32
- */
33
- height?: number | string;
34
- /**
35
- * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
36
- */
37
- low?: number;
38
- /**
39
- * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
40
- */
41
- high?: number;
42
- /**
43
- * Unless low/high are explicitly set, bar chart will be centered at zero by default. Set referenceValue to null to auto scale.
44
- */
45
- referenceValue?: number;
46
- /**
47
- * Padding of the chart drawing area to the container element and labels as a number or padding object.
48
- */
49
- chartPadding?: number | Partial<ChartPadding>;
50
- /**
51
- * Options for X-Axis
52
- */
53
- axisX?: TXAxisOptions;
54
- /**
55
- * Options for Y-Axis
56
- */
57
- axisY?: TYAxisOptions;
58
- /**
59
- * Override the class names that get used to generate the SVG structure of the chart
60
- */
61
- classNames?: Record<string, string>;
62
- plugins?: (Plugin | [Plugin, any])[];
63
- /**
64
- * Define the ViewBox for an SVG, this is optional and only required if you need a scalable chart. This should be used together with responsive options to ensure a proper text size.
65
- */
66
- viewBox?: ViewBox;
67
- }
68
- export interface AxisOptions {
69
- type?: AxisType;
70
- /**
71
- * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
72
- */
73
- low?: number;
74
- /**
75
- * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
76
- */
77
- high?: number;
78
- /**
79
- * Unless low/high are explicitly set, bar chart will be centered at zero by default. Set referenceValue to null to auto scale.
80
- */
81
- referenceValue?: number;
82
- /**
83
- * The offset of the chart drawing area to the border of the container
84
- */
85
- offset?: number;
86
- /**
87
- * Position where labels are placed.
88
- * 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.
89
- */
90
- position?: 'start' | 'end';
91
- /**
92
- * Allows you to correct label positioning on this axis by positive or negative x and y offset.
93
- */
94
- labelOffset?: {
95
- x: number;
96
- y: number;
97
- };
98
- /**
99
- * If labels should be shown or not
100
- */
101
- showLabel?: boolean;
102
- /**
103
- * If the axis grid should be drawn or not
104
- */
105
- showGrid?: boolean;
106
- /**
107
- * Interpolation function that allows you to intercept the value from the axis label
108
- */
109
- labelInterpolationFnc?(value: Label, index: number): Label | null | undefined;
110
- /**
111
- * This value specifies the minimum width in pixel of the scale steps
112
- */
113
- scaleMinSpace?: number;
114
- /**
115
- * Use only integer values (whole numbers) for the scale steps
116
- */
117
- onlyInteger?: boolean;
118
- ticks?: Label[];
119
- stretch?: boolean;
120
- divisor?: number;
121
- highLow?: {
122
- high: number;
123
- low: number;
124
- };
125
- }
126
- export declare type OptionsWithDefaults = RequiredKeys<Options<RequiredKeys<AxisOptions, 'offset' | 'labelOffset' | 'labelInterpolationFnc'>, RequiredKeys<AxisOptions, 'offset' | 'labelOffset' | 'labelInterpolationFnc'>>, 'axisX' | 'axisY' | 'classNames'>;
127
- export declare type ResponsiveOptions<T = Options> = [string, T][];
128
- export interface Bounds {
129
- high: number;
130
- low: number;
131
- valueRange: number;
132
- oom: number;
133
- step: number;
134
- min: number;
135
- max: number;
136
- range: number;
137
- numberOfSteps: number;
138
- values: number[];
139
- }
140
- export interface Segment {
141
- pathCoordinates: number[];
142
- valueData: SegmentData[];
143
- }
144
- export interface SegmentData {
145
- value: NormalizedSeriesValue;
146
- valueIndex: number;
147
- meta?: Meta;
148
- }
149
- export declare type AxisName = 'x' | 'y';
150
- export declare type Multi = {
151
- x: number | string | Date | null;
152
- y: number | string | Date | null;
153
- } | {
154
- x: number | string | Date | null;
155
- } | {
156
- y: number | string | Date | null;
157
- };
158
- export declare type NormalizedMulti = {
159
- x: number;
160
- y: number;
161
- } | {
162
- x: number;
163
- } | {
164
- y: number;
165
- };
166
- /**
167
- * Data
168
- */
169
- export declare type Label = string | number | Date;
170
- export declare type AllSeriesTypes = FlatSeries | (Series | SeriesObject)[];
171
- export interface Data<T extends AllSeriesTypes = AllSeriesTypes> {
172
- labels?: Label[] | undefined;
173
- series: T;
174
- }
175
- /**
176
- * Series
177
- */
178
- export declare type Series<T = SeriesPrimitiveValue> = SeriesValue<T>[];
179
- export interface SeriesObject<T = SeriesPrimitiveValue> {
180
- name?: string;
181
- className?: string;
182
- meta?: Meta;
183
- data: SeriesValue<T>[];
184
- }
185
- export declare type SeriesValue<T = SeriesPrimitiveValue> = SeriesObjectValue<T> | T;
186
- export declare type SeriesPrimitiveValue = number | string | boolean | Date | Multi | null | undefined;
187
- export interface SeriesObjectValue<T = SeriesPrimitiveValue> {
188
- meta?: Meta;
189
- value: T;
190
- }
191
- /**
192
- * Flat Series
193
- */
194
- export declare type FlatSeries<T = FlatSeriesPrimitiveValue> = FlatSeriesValue<T>[];
195
- export declare type FlatSeriesValue<T = FlatSeriesPrimitiveValue> = SeriesValue<T> | FlatSeriesObjectValue<T>;
196
- export declare type FlatSeriesPrimitiveValue = number | string | null | undefined;
197
- export interface FlatSeriesObjectValue<T = FlatSeriesPrimitiveValue> {
198
- name?: string;
199
- className?: string;
200
- meta?: Meta;
201
- value: T;
202
- }
203
- /**
204
- * Normalized Data
205
- */
206
- export declare type AllNormalizedSeriesTypes = NormalizedFlatSeries | NormalizedSeries[];
207
- export interface NormalizedData<T extends AllNormalizedSeriesTypes = AllNormalizedSeriesTypes> extends Data {
208
- labels: Label[];
209
- series: T;
210
- }
211
- /**
212
- * Normalized Series
213
- */
214
- export declare type NormalizedSeries = NormalizedSeriesValue[];
215
- export declare type NormalizedSeriesValue = NormalizedSeriesPrimitiveValue;
216
- export declare type NormalizedSeriesPrimitiveValue = number | NormalizedMulti | undefined;
217
- /**
218
- * Normalized Flat Series
219
- */
220
- export declare type NormalizedFlatSeries = number[];
221
- /**
222
- * Events
223
- */
224
- export interface CreatedEvent<TOptions = Options> {
225
- chartRect: ChartRect;
226
- axisX: Axis;
227
- axisY: Axis;
228
- svg: Svg;
229
- options: TOptions;
230
- }
231
- export interface DrawEvent {
232
- type: string;
233
- element: Svg;
234
- group: Svg;
235
- chartRect: ChartRect;
236
- axisX: Axis;
237
- axisY: Axis;
238
- meta: Meta;
239
- index: number;
240
- series: FlatSeriesValue | Series | SeriesObject;
241
- seriesIndex: number;
242
- }
243
- export interface DataEvent {
244
- type: 'initial' | 'update';
245
- data: Data;
246
- }
247
- export interface OptionsChangedEvent<T = Options> {
248
- previousOptions: T;
249
- currentOptions: T;
250
- }
251
- export interface GridDrawEvent extends Omit<DrawEvent, 'chartRect' | 'axisX' | 'axisY' | 'meta' | 'series' | 'seriesIndex'> {
252
- type: 'grid';
253
- axis: Axis;
254
- x1: number;
255
- y1: number;
256
- x2: number;
257
- y2: number;
258
- }
259
- export interface GridBackgroundDrawEvent {
260
- type: 'gridBackground';
261
- group: Svg;
262
- element: Svg;
263
- }
264
- export interface LabelDrawEvent extends Omit<DrawEvent, 'chartRect' | 'axisX' | 'axisY' | 'meta' | 'series' | 'seriesIndex'> {
265
- type: 'label';
266
- axis: Axis;
267
- text: Label;
268
- x: number;
269
- y: number;
270
- width: number;
271
- height: number;
272
- }
273
- export declare type AxesDrawEvent = GridDrawEvent | GridBackgroundDrawEvent | LabelDrawEvent;
274
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,IAAI,MAAM,CAAC;IAChB,MAAM,IAAI,MAAM,CAAC;CAClB;AAGD,oBAAY,MAAM,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAGzD,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,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WAAW,uBAAuB;IACtC,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,SAAS,EACT,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CACpE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,aAAa,GACrB,aAAa,GACb,uBAAuB,GACvB,cAAc,CAAC"}
@@ -1,27 +0,0 @@
1
- export declare type EventListener<T = any> = (data: T) => void;
2
- export declare type AllEventsListener<T = any> = (event: string, data: T) => void;
3
- export declare class EventEmitter {
4
- private readonly listeners;
5
- private readonly allListeners;
6
- /**
7
- * Add an event handler for a specific event
8
- * @param event The event name
9
- * @param listener A event handler function
10
- */
11
- on(event: '*', listener: AllEventsListener): void;
12
- on(event: string, listener: EventListener): void;
13
- /**
14
- * Remove an event handler of a specific event name or remove all event handlers for a specific event.
15
- * @param event The event name where a specific or all handlers should be removed
16
- * @param [listener] An optional event handler function. If specified only this specific handler will be removed and otherwise all handlers are removed.
17
- */
18
- off(event: '*', listener?: AllEventsListener): void;
19
- off(event: string, listener?: EventListener): void;
20
- /**
21
- * Use this function to emit an event. All handlers that are listening for this event will be triggered with the data parameter.
22
- * @param event The event name that should be triggered
23
- * @param data Arbitrary data that will be passed to the event handler callback functions
24
- */
25
- emit<T = any>(event: string, data: T): void;
26
- }
27
- //# sourceMappingURL=EventEmitter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/event/EventEmitter.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAEvD,oBAAY,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAE1E,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyC;IACnE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgC;IAE7D;;;;OAIG;IACH,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IACjD,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;IAiBhD;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI;IACnD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI;IAyBlD;;;;OAIG;IACH,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CAarC"}
@@ -1,2 +0,0 @@
1
- export * from './EventEmitter';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/event/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
@@ -1,30 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import { SvgPath } from '../svg';
3
- export interface CardinalInterpolationOptions {
4
- tension?: number;
5
- fillHoles?: boolean;
6
- }
7
- /**
8
- * 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.
9
- *
10
- * Cardinal splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.
11
- *
12
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The cardinal interpolation function accepts one configuration parameter `tension`, between 0 and 1, which controls the smoothing intensity.
13
- *
14
- * @example
15
- * ```ts
16
- * const chart = new LineChart('.ct-chart', {
17
- * labels: [1, 2, 3, 4, 5],
18
- * series: [[1, 2, 8, 1, 7]]
19
- * }, {
20
- * lineSmooth: Interpolation.cardinal({
21
- * tension: 1,
22
- * fillHoles: false
23
- * })
24
- * });
25
- * ```
26
- *
27
- * @param options The options of the cardinal factory function.
28
- */
29
- export declare function cardinal(options?: CardinalInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
30
- //# sourceMappingURL=cardinal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cardinal.d.ts","sourceRoot":"","sources":["../../src/interpolation/cardinal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,4BAA4B,qBAW1C,MAAM,EAAE,aACd,WAAW,EAAE,KACvB,OAAO,CAsFX"}
@@ -1,6 +0,0 @@
1
- export * from './none';
2
- export * from './simple';
3
- export * from './step';
4
- export * from './cardinal';
5
- export * from './monotoneCubic';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interpolation/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -1,30 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import { SvgPath } from '../svg';
3
- export interface MonotoneCubicInterpolationOptions {
4
- fillHoles?: boolean;
5
- }
6
- /**
7
- * Monotone Cubic spline interpolation produces a smooth curve which preserves monotonicity. Unlike cardinal splines, the curve will not extend beyond the range of y-values of the original data points.
8
- *
9
- * Monotone Cubic splines can only be created if there are more than two data points. If this is not the case this smoothing will fallback to `Chartist.Smoothing.none`.
10
- *
11
- * The x-values of subsequent points must be increasing to fit a Monotone Cubic spline. If this condition is not met for a pair of adjacent points, then there will be a break in the curve between those data points.
12
- *
13
- * All smoothing functions within Chartist are factory functions that accept an options parameter.
14
- *
15
- * @example
16
- * ```ts
17
- * const chart = new LineChart('.ct-chart', {
18
- * labels: [1, 2, 3, 4, 5],
19
- * series: [[1, 2, 8, 1, 7]]
20
- * }, {
21
- * lineSmooth: Interpolation.monotoneCubic({
22
- * fillHoles: false
23
- * })
24
- * });
25
- * ```
26
- *
27
- * @param options The options of the monotoneCubic factory function.
28
- */
29
- export declare function monotoneCubic(options?: MonotoneCubicInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
30
- //# sourceMappingURL=monotoneCubic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monotoneCubic.d.ts","sourceRoot":"","sources":["../../src/interpolation/monotoneCubic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGjC,MAAM,WAAW,iCAAiC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iCAAiC,qBAOpD,MAAM,EAAE,aACd,WAAW,EAAE,KACvB,OAAO,CAgGX"}
@@ -1,22 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import { SvgPath } from '../svg';
3
- export interface NoneInterpolationOptions {
4
- fillHoles?: boolean;
5
- }
6
- /**
7
- * This interpolation function does not smooth the path and the result is only containing lines and no curves.
8
- *
9
- * @example
10
- * ```ts
11
- * const chart = new LineChart('.ct-chart', {
12
- * labels: [1, 2, 3, 4, 5],
13
- * series: [[1, 2, 8, 1, 7]]
14
- * }, {
15
- * lineSmooth: Interpolation.none({
16
- * fillHoles: false
17
- * })
18
- * });
19
- * ```
20
- */
21
- export declare function none(options?: NoneInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
22
- //# sourceMappingURL=none.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../src/interpolation/none.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAOlC,MAAM,EAAE,aACd,WAAW,EAAE,aAyB3B"}
@@ -1,30 +0,0 @@
1
- import type { SegmentData } from '../core/types';
2
- import { SvgPath } from '../svg';
3
- export interface SimpleInteractionOptions {
4
- divisor?: number;
5
- fillHoles?: boolean;
6
- }
7
- /**
8
- * 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.
9
- *
10
- * Simple smoothing can be used instead of `Chartist.Smoothing.cardinal` if you'd like to get rid of the artifacts it produces sometimes. Simple smoothing produces less flowing lines but is accurate by hitting the points and it also doesn't swing below or above the given data point.
11
- *
12
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The simple interpolation function accepts one configuration parameter `divisor`, between 1 and ∞, which controls the smoothing characteristics.
13
- *
14
- * @example
15
- * ```ts
16
- * const chart = new LineChart('.ct-chart', {
17
- * labels: [1, 2, 3, 4, 5],
18
- * series: [[1, 2, 8, 1, 7]]
19
- * }, {
20
- * lineSmooth: Interpolation.simple({
21
- * divisor: 2,
22
- * fillHoles: false
23
- * })
24
- * });
25
- * ```
26
- *
27
- * @param options The options of the simple interpolation factory function.
28
- */
29
- export declare function simple(options?: SimpleInteractionOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
30
- //# sourceMappingURL=simple.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../src/interpolation/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAUpC,MAAM,EAAE,aACd,WAAW,EAAE,aAwC3B"}