@gravity-ui/chartkit 0.9.1 → 0.10.0

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 (189) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/build/components/ChartKit.css +23 -0
  3. package/build/components/ChartKit.d.ts +0 -1
  4. package/build/components/ChartKit.js +4 -5
  5. package/build/i18n/keysets/en.json +60 -0
  6. package/build/i18n/keysets/ru.json +62 -0
  7. package/build/libs/chartkit-error/chartkit-error.d.ts +1 -0
  8. package/build/libs/chartkit-error/chartkit-error.js +1 -0
  9. package/build/libs/settings/__tests__/settings.test.js +1 -1
  10. package/build/libs/settings/settings.d.ts +6 -3
  11. package/build/libs/settings/settings.js +4 -2
  12. package/build/plugins/highcharts/__stories__/AreaRange.stories.d.ts +4 -0
  13. package/build/plugins/highcharts/__stories__/AreaRange.stories.js +22 -0
  14. package/build/plugins/highcharts/__stories__/Line.stories.d.ts +4 -0
  15. package/build/plugins/highcharts/__stories__/Line.stories.js +21 -0
  16. package/build/plugins/highcharts/__stories__/mocks/area-range.d.ts +2 -0
  17. package/build/plugins/highcharts/__stories__/mocks/area-range.js +61 -0
  18. package/build/plugins/highcharts/__stories__/mocks/holidays.d.ts +7070 -0
  19. package/build/plugins/highcharts/__stories__/mocks/holidays.js +7065 -0
  20. package/build/plugins/highcharts/__stories__/mocks/line.d.ts +2 -0
  21. package/build/plugins/highcharts/__stories__/mocks/line.js +129 -0
  22. package/build/plugins/highcharts/index.d.ts +2 -0
  23. package/build/plugins/highcharts/index.js +5 -0
  24. package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +23 -0
  25. package/build/plugins/highcharts/renderer/HighchartsWidget.js +6 -0
  26. package/build/plugins/highcharts/renderer/components/HighchartsComponent.css +4 -0
  27. package/build/plugins/highcharts/renderer/components/HighchartsComponent.d.ts +575 -0
  28. package/build/plugins/highcharts/renderer/components/HighchartsComponent.js +115 -0
  29. package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.css +50 -0
  30. package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.d.ts +10 -0
  31. package/build/plugins/highcharts/renderer/components/StyledSplitPane/StyledSplitPane.js +32 -0
  32. package/build/plugins/highcharts/renderer/components/withSplitPane/WithSplitPane.css +4 -0
  33. package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.d.ts +10 -0
  34. package/build/plugins/highcharts/renderer/components/withSplitPane/withSplitPane.js +207 -0
  35. package/build/plugins/highcharts/renderer/helpers/add-holidays.d.ts +1 -0
  36. package/build/plugins/highcharts/renderer/helpers/add-holidays.js +43 -0
  37. package/build/plugins/highcharts/renderer/helpers/comments/drawing.d.ts +11 -0
  38. package/build/plugins/highcharts/renderer/helpers/comments/drawing.js +571 -0
  39. package/build/plugins/highcharts/renderer/helpers/config/config.d.ts +575 -0
  40. package/build/plugins/highcharts/renderer/helpers/config/config.js +1483 -0
  41. package/build/plugins/highcharts/renderer/helpers/config/handleLegendItemClick.d.ts +1 -0
  42. package/build/plugins/highcharts/renderer/helpers/config/handleLegendItemClick.js +57 -0
  43. package/build/plugins/highcharts/renderer/helpers/config/options.d.ts +465 -0
  44. package/build/plugins/highcharts/renderer/helpers/config/options.js +350 -0
  45. package/build/plugins/highcharts/renderer/helpers/config/types.d.ts +6 -0
  46. package/build/plugins/highcharts/renderer/helpers/config/types.js +1 -0
  47. package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.d.ts +10 -0
  48. package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.js +42 -0
  49. package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.test.d.ts +1 -0
  50. package/build/plugins/highcharts/renderer/helpers/config/utils/addShowInNavigatorToSeries.test.js +99 -0
  51. package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.d.ts +1 -0
  52. package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.js +17 -0
  53. package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.test.d.ts +1 -0
  54. package/build/plugins/highcharts/renderer/helpers/config/utils/buildNavigatorFallback.test.js +28 -0
  55. package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.d.ts +5 -0
  56. package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.js +20 -0
  57. package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.test.d.ts +1 -0
  58. package/build/plugins/highcharts/renderer/helpers/config/utils/calculatePrecision.test.js +27 -0
  59. package/build/plugins/highcharts/renderer/helpers/config/utils/concatStrings.d.ts +1 -0
  60. package/build/plugins/highcharts/renderer/helpers/config/utils/concatStrings.js +1 -0
  61. package/build/plugins/highcharts/renderer/helpers/config/utils/getChartKitFormattedValue.d.ts +2 -0
  62. package/build/plugins/highcharts/renderer/helpers/config/utils/getChartKitFormattedValue.js +15 -0
  63. package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.d.ts +3 -0
  64. package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.js +15 -0
  65. package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.test.d.ts +1 -0
  66. package/build/plugins/highcharts/renderer/helpers/config/utils/getFormatOptionsFromLine.test.js +11 -0
  67. package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.d.ts +1 -0
  68. package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.js +9 -0
  69. package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.test.d.ts +1 -0
  70. package/build/plugins/highcharts/renderer/helpers/config/utils/getXAxisThresholdValue.test.js +20 -0
  71. package/build/plugins/highcharts/renderer/helpers/config/utils/index.d.ts +13 -0
  72. package/build/plugins/highcharts/renderer/helpers/config/utils/index.js +13 -0
  73. package/build/plugins/highcharts/renderer/helpers/config/utils/isNavigatorSeries.d.ts +2 -0
  74. package/build/plugins/highcharts/renderer/helpers/config/utils/isNavigatorSeries.js +3 -0
  75. package/build/plugins/highcharts/renderer/helpers/config/utils/isSafari.d.ts +1 -0
  76. package/build/plugins/highcharts/renderer/helpers/config/utils/isSafari.js +12 -0
  77. package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.d.ts +1 -0
  78. package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.js +8 -0
  79. package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.test.d.ts +1 -0
  80. package/build/plugins/highcharts/renderer/helpers/config/utils/isTooltipShared.test.js +31 -0
  81. package/build/plugins/highcharts/renderer/helpers/config/utils/localStorage.d.ts +5 -0
  82. package/build/plugins/highcharts/renderer/helpers/config/utils/localStorage.js +23 -0
  83. package/build/plugins/highcharts/renderer/helpers/config/utils/mergeArrayWithObject.d.ts +1 -0
  84. package/build/plugins/highcharts/renderer/helpers/config/utils/mergeArrayWithObject.js +10 -0
  85. package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.d.ts +2 -0
  86. package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.js +19 -0
  87. package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.test.d.ts +1 -0
  88. package/build/plugins/highcharts/renderer/helpers/config/utils/numberFormat.test.js +20 -0
  89. package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.d.ts +13 -0
  90. package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.js +27 -0
  91. package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.test.d.ts +1 -0
  92. package/build/plugins/highcharts/renderer/helpers/config/utils/setNavigatorDefaultPeriod.test.js +45 -0
  93. package/build/plugins/highcharts/renderer/helpers/constants.d.ts +28 -0
  94. package/build/plugins/highcharts/renderer/helpers/constants.js +30 -0
  95. package/build/plugins/highcharts/renderer/helpers/graph.css +89 -0
  96. package/build/plugins/highcharts/renderer/helpers/graph.d.ts +552 -0
  97. package/build/plugins/highcharts/renderer/helpers/graph.js +85 -0
  98. package/build/plugins/highcharts/renderer/helpers/highcharts/colors.d.ts +2 -0
  99. package/build/plugins/highcharts/renderer/helpers/highcharts/colors.js +17 -0
  100. package/build/plugins/highcharts/renderer/helpers/highcharts/highcharts.d.ts +4 -0
  101. package/build/plugins/highcharts/renderer/helpers/highcharts/highcharts.js +346 -0
  102. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calcucalteClosestPointManually.d.ts +1 -0
  103. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calcucalteClosestPointManually.js +19 -0
  104. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calculateClosestPointManually.test.d.ts +1 -0
  105. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/calculateClosestPointManually.test.js +42 -0
  106. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/index.d.ts +1 -0
  107. package/build/plugins/highcharts/renderer/helpers/highcharts/utils/index.js +1 -0
  108. package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.d.ts +1 -0
  109. package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.js +49 -0
  110. package/build/plugins/highcharts/renderer/helpers/prepare-data.d.ts +1 -0
  111. package/build/plugins/highcharts/renderer/helpers/prepare-data.js +175 -0
  112. package/build/plugins/highcharts/renderer/helpers/tooltip/constants.d.ts +13 -0
  113. package/build/plugins/highcharts/renderer/helpers/tooltip/constants.js +14 -0
  114. package/build/plugins/highcharts/renderer/helpers/tooltip/helpers.d.ts +1 -0
  115. package/build/plugins/highcharts/renderer/helpers/tooltip/helpers.js +5 -0
  116. package/build/plugins/highcharts/renderer/helpers/tooltip/index.d.ts +13 -0
  117. package/build/plugins/highcharts/renderer/helpers/tooltip/index.js +253 -0
  118. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/index.d.ts +6 -0
  119. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/index.js +22 -0
  120. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashDotLineIcon.d.ts +2 -0
  121. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashDotLineIcon.js +20 -0
  122. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashLineIcon.d.ts +2 -0
  123. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DashLineIcon.js +25 -0
  124. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DotLineIcon.d.ts +2 -0
  125. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/DotLineIcon.js +20 -0
  126. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotDotLineIcon.d.ts +2 -0
  127. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotDotLineIcon.js +18 -0
  128. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotLineIcon.d.ts +2 -0
  129. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashDotLineIcon.js +18 -0
  130. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashLineIcon.d.ts +2 -0
  131. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/LongDashLineIcon.js +15 -0
  132. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotDotLineIcon.d.ts +2 -0
  133. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotDotLineIcon.js +18 -0
  134. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotLineIcon.d.ts +2 -0
  135. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashDotLineIcon.js +18 -0
  136. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashLineIcon.d.ts +2 -0
  137. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDashLineIcon.js +18 -0
  138. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDotLineIcon.d.ts +2 -0
  139. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/ShortDotLineIcon.js +20 -0
  140. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/SolidLineIcon.d.ts +2 -0
  141. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/SolidLineIcon.js +13 -0
  142. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/index.d.ts +11 -0
  143. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/template-icons/index.js +11 -0
  144. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/types.d.ts +4 -0
  145. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/types.js +1 -0
  146. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/utils.d.ts +7 -0
  147. package/build/plugins/highcharts/renderer/helpers/tooltip/render-shape-icon/utils.js +5 -0
  148. package/build/plugins/highcharts/renderer/helpers/tooltip/tooltip.css +367 -0
  149. package/build/plugins/highcharts/renderer/helpers/tooltip/types.d.ts +85 -0
  150. package/build/plugins/highcharts/renderer/helpers/tooltip/types.js +1 -0
  151. package/build/plugins/highcharts/renderer/helpers/types.d.ts +22 -0
  152. package/build/plugins/highcharts/renderer/helpers/types.js +1 -0
  153. package/build/plugins/highcharts/types/comments.d.ts +51 -0
  154. package/build/plugins/highcharts/types/comments.js +1 -0
  155. package/build/plugins/highcharts/types/highcharts-extends.d.ts +38 -0
  156. package/build/plugins/highcharts/types/index.d.ts +4 -0
  157. package/build/plugins/highcharts/types/index.js +1 -0
  158. package/build/plugins/highcharts/types/lib.d.ts +1 -0
  159. package/build/plugins/highcharts/types/lib.js +1 -0
  160. package/build/plugins/highcharts/types/misc.d.ts +19 -0
  161. package/build/plugins/highcharts/types/misc.js +1 -0
  162. package/build/plugins/highcharts/types/widget.d.ts +47 -0
  163. package/build/plugins/highcharts/types/widget.js +1 -0
  164. package/build/plugins/index.d.ts +4 -2
  165. package/build/plugins/index.js +1 -0
  166. package/build/plugins/indicator/renderer/IndicatorItem.d.ts +3 -2
  167. package/build/plugins/indicator/renderer/IndicatorWidget.d.ts +10 -2
  168. package/build/plugins/indicator/renderer/IndicatorWidget.js +1 -1
  169. package/build/plugins/indicator/types.d.ts +0 -6
  170. package/build/plugins/shared/format-number/format-number.d.ts +4 -0
  171. package/build/plugins/shared/format-number/format-number.js +88 -0
  172. package/build/plugins/shared/format-number/format-number.test.d.ts +1 -0
  173. package/build/plugins/shared/format-number/format-number.test.js +14 -0
  174. package/build/plugins/shared/format-number/i18n/en.json +17 -0
  175. package/build/plugins/shared/format-number/i18n/i18n.d.ts +5 -0
  176. package/build/plugins/shared/format-number/i18n/i18n.js +8 -0
  177. package/build/plugins/shared/format-number/i18n/ru.json +17 -0
  178. package/build/plugins/shared/format-number/types.d.ts +14 -0
  179. package/build/plugins/shared/format-number/types.js +1 -0
  180. package/build/plugins/shared/index.d.ts +2 -0
  181. package/build/plugins/shared/index.js +1 -0
  182. package/build/plugins/yagr/renderer/YagrWidget.d.ts +11 -3
  183. package/build/plugins/yagr/renderer/YagrWidget.js +2 -1
  184. package/build/plugins/yagr/types.d.ts +0 -7
  185. package/build/types/index.d.ts +1 -2
  186. package/build/types/misc.d.ts +4 -0
  187. package/build/types/misc.js +1 -0
  188. package/build/types/widget.d.ts +17 -0
  189. package/package.json +4 -1
@@ -0,0 +1,552 @@
1
+ import type { ChartKitHolidays } from '../../../../types';
2
+ import type { HighchartsWidgetData, ChartKitComment, ExtendedHChart } from '../../types';
3
+ import type { ConfigOptions } from './types';
4
+ import './graph.css';
5
+ declare type GetGraphArgs = {
6
+ options: ConfigOptions;
7
+ data: HighchartsWidgetData['data'];
8
+ comments?: ChartKitComment[];
9
+ holidays?: ChartKitHolidays;
10
+ isMobile?: boolean;
11
+ };
12
+ declare function getGraph({ options, data, comments, isMobile, holidays }: GetGraphArgs): {
13
+ config: {
14
+ chart: {
15
+ type: any;
16
+ } & {
17
+ zoomType: string;
18
+ backgroundColor: string;
19
+ className: string;
20
+ } & {
21
+ events: {
22
+ render?: (() => void) | undefined;
23
+ load: () => void;
24
+ selection: () => void;
25
+ drilldown: () => void;
26
+ drillup: () => void;
27
+ click: (event: any) => void;
28
+ redraw: () => void;
29
+ };
30
+ };
31
+ plotOptions: {
32
+ [x: number]: {
33
+ stacking: any;
34
+ };
35
+ } & {
36
+ series: {
37
+ borderColor: string;
38
+ label: {
39
+ enabled: boolean;
40
+ };
41
+ tooltip: {
42
+ headerFormat: string;
43
+ pointFormat: string;
44
+ };
45
+ dataLabels: {
46
+ style: {
47
+ textOutline: string;
48
+ color: string;
49
+ };
50
+ };
51
+ turboThreshold: number;
52
+ };
53
+ area: {
54
+ boostThreshold: number;
55
+ trackByArea: boolean;
56
+ stickyTracking: boolean;
57
+ } & {
58
+ states: {
59
+ hover: {
60
+ lineWidthPlus: number;
61
+ };
62
+ };
63
+ dataGrouping: {
64
+ approximation: string;
65
+ };
66
+ marker: {
67
+ enabled: boolean;
68
+ radius: number;
69
+ states: {
70
+ hover: {
71
+ radiusPlus: number;
72
+ };
73
+ };
74
+ };
75
+ } & {
76
+ dataLabels: {
77
+ formatter: () => any;
78
+ };
79
+ } & {
80
+ states: {
81
+ hover: {
82
+ animation: {
83
+ duration: number;
84
+ easing: string;
85
+ };
86
+ lineWidth: number;
87
+ opacity: number;
88
+ };
89
+ inactive: {
90
+ opacity: number;
91
+ };
92
+ };
93
+ };
94
+ areaspline: {
95
+ states: {
96
+ hover: {
97
+ lineWidthPlus: number;
98
+ };
99
+ };
100
+ dataGrouping: {
101
+ approximation: string;
102
+ };
103
+ marker: {
104
+ enabled: boolean;
105
+ radius: number;
106
+ states: {
107
+ hover: {
108
+ radiusPlus: number;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ bar: {
114
+ borderWidth: number;
115
+ pointWidth: number;
116
+ } & {
117
+ states: {
118
+ hover: {
119
+ lineWidthPlus: number;
120
+ };
121
+ };
122
+ dataGrouping: {
123
+ approximation: string;
124
+ };
125
+ marker: {
126
+ enabled: boolean;
127
+ radius: number;
128
+ states: {
129
+ hover: {
130
+ radiusPlus: number;
131
+ };
132
+ };
133
+ };
134
+ } & {
135
+ dataLabels: {
136
+ formatter: () => any;
137
+ };
138
+ } & {
139
+ states: {
140
+ inactive: {
141
+ enabled: boolean;
142
+ };
143
+ };
144
+ };
145
+ column: {
146
+ states: {
147
+ hover: {
148
+ lineWidthPlus: number;
149
+ };
150
+ };
151
+ dataGrouping: {
152
+ approximation: string;
153
+ };
154
+ marker: {
155
+ enabled: boolean;
156
+ radius: number;
157
+ states: {
158
+ hover: {
159
+ radiusPlus: number;
160
+ };
161
+ };
162
+ };
163
+ } & {
164
+ dataLabels: {
165
+ formatter: () => any;
166
+ };
167
+ } & {
168
+ states: {
169
+ inactive: {
170
+ enabled: boolean;
171
+ };
172
+ };
173
+ };
174
+ line: {
175
+ states: {
176
+ hover: {
177
+ lineWidthPlus: number;
178
+ };
179
+ };
180
+ dataGrouping: {
181
+ approximation: string;
182
+ };
183
+ marker: {
184
+ enabled: boolean;
185
+ radius: number;
186
+ states: {
187
+ hover: {
188
+ radiusPlus: number;
189
+ };
190
+ };
191
+ };
192
+ } & {
193
+ dataLabels: {
194
+ formatter: () => any;
195
+ };
196
+ } & {
197
+ states: {
198
+ hover: {
199
+ animation: {
200
+ duration: number;
201
+ easing: string;
202
+ };
203
+ lineWidth: number;
204
+ opacity: number;
205
+ };
206
+ inactive: {
207
+ opacity: number;
208
+ };
209
+ };
210
+ };
211
+ spline: {
212
+ states: {
213
+ hover: {
214
+ lineWidthPlus: number;
215
+ };
216
+ };
217
+ dataGrouping: {
218
+ approximation: string;
219
+ };
220
+ marker: {
221
+ enabled: boolean;
222
+ radius: number;
223
+ states: {
224
+ hover: {
225
+ radiusPlus: number;
226
+ };
227
+ };
228
+ };
229
+ };
230
+ arearange: {
231
+ tooltip: {
232
+ pointFormat: string;
233
+ };
234
+ } & {
235
+ states: {
236
+ hover: {
237
+ lineWidthPlus: number;
238
+ };
239
+ };
240
+ dataGrouping: {
241
+ approximation: string;
242
+ };
243
+ marker: {
244
+ enabled: boolean;
245
+ radius: number;
246
+ states: {
247
+ hover: {
248
+ radiusPlus: number;
249
+ };
250
+ };
251
+ };
252
+ };
253
+ scatter: {
254
+ tooltip: {
255
+ headerFormat: string;
256
+ pointFormat: string;
257
+ };
258
+ };
259
+ bubble: {
260
+ tooltip: {
261
+ headerFormat: string;
262
+ pointFormat: string;
263
+ };
264
+ };
265
+ sankey: {
266
+ tooltip: {
267
+ headerFormat: string;
268
+ pointFormat: string;
269
+ };
270
+ };
271
+ heatmap: {
272
+ tooltip: {
273
+ headerFormat: string;
274
+ pointFormat: string;
275
+ };
276
+ };
277
+ treemap: {
278
+ tooltip: {
279
+ headerFormat: null;
280
+ pointFormat: string;
281
+ };
282
+ };
283
+ timeline: {
284
+ tooltip: {
285
+ headerFormat: string;
286
+ pointFormat: string;
287
+ };
288
+ };
289
+ variwide: {};
290
+ waterfall: {};
291
+ pie: {
292
+ tooltip: {
293
+ headerFormat: null;
294
+ pointFormat: string;
295
+ };
296
+ dataLabels: {
297
+ formatter: () => any;
298
+ };
299
+ } & {
300
+ allowPointSelect: boolean;
301
+ slicedOffset: number;
302
+ cursor: string;
303
+ showInLegend: boolean;
304
+ } & {
305
+ states: {
306
+ inactive: {
307
+ enabled: boolean;
308
+ };
309
+ };
310
+ };
311
+ histogram: {
312
+ tooltip: {
313
+ headerFormat: null;
314
+ pointFormat: string;
315
+ };
316
+ };
317
+ bellcurve: {};
318
+ streamgraph: {};
319
+ ohlc: {
320
+ tooltip: {
321
+ pointFormat: string;
322
+ };
323
+ };
324
+ ema: {};
325
+ sma: {};
326
+ wordcloud: {
327
+ tooltip: {
328
+ pointFormat: string;
329
+ };
330
+ };
331
+ xrange: {
332
+ tooltip: {
333
+ headerFormat: string;
334
+ pointFormat: string;
335
+ };
336
+ };
337
+ solidgauge: {
338
+ allowPointSelect: boolean;
339
+ slicedOffset: number;
340
+ cursor: string;
341
+ showInLegend: boolean;
342
+ };
343
+ funnel: {
344
+ allowPointSelect: boolean;
345
+ slicedOffset: number;
346
+ cursor: string;
347
+ showInLegend: boolean;
348
+ };
349
+ boxplot: {
350
+ tooltip: {
351
+ pointFormat: string;
352
+ };
353
+ };
354
+ } & {
355
+ xrange: {
356
+ stickyTracking: boolean;
357
+ };
358
+ series: {
359
+ events: {
360
+ legendItemClick: (event: any) => void;
361
+ mouseOver: () => void;
362
+ mouseOut: () => void;
363
+ click: (event: any) => void;
364
+ };
365
+ point: {
366
+ events: {
367
+ click: (event: any) => boolean;
368
+ };
369
+ };
370
+ marker: {
371
+ states: {
372
+ hover: {
373
+ enabled: boolean;
374
+ };
375
+ select: {
376
+ enabled: boolean;
377
+ };
378
+ };
379
+ } | {
380
+ states?: undefined;
381
+ };
382
+ };
383
+ pie: {
384
+ point: {
385
+ events: {
386
+ legendItemClick: (event: any) => void;
387
+ };
388
+ };
389
+ };
390
+ area: {
391
+ trackByArea: boolean;
392
+ stickyTracking: boolean;
393
+ } | {
394
+ trackByArea?: undefined;
395
+ stickyTracking?: undefined;
396
+ };
397
+ };
398
+ title: {
399
+ style: {
400
+ color: string;
401
+ };
402
+ } & {
403
+ text: any;
404
+ floating: any;
405
+ };
406
+ tooltip: {
407
+ split: boolean;
408
+ shared: boolean;
409
+ outside: boolean;
410
+ followPointer: boolean;
411
+ dateTimeLabelFormats: {
412
+ millisecond: string;
413
+ second: string;
414
+ minute: string;
415
+ hour: string;
416
+ day: string;
417
+ week: string;
418
+ quarter: string;
419
+ };
420
+ } & {
421
+ replaceCellAt?: any;
422
+ insertCellAt?: any;
423
+ positioner?: typeof import("./config/config").portraitOrientationTooltipPositioner | undefined;
424
+ shared: boolean;
425
+ splitTooltip: any;
426
+ distance: number;
427
+ style: {
428
+ width: string;
429
+ };
430
+ className: string;
431
+ outside: boolean;
432
+ };
433
+ legend: {
434
+ itemStyle: {
435
+ color: string;
436
+ };
437
+ itemHoverStyle: {
438
+ color: string;
439
+ };
440
+ itemHiddenStyle: {
441
+ color: string;
442
+ };
443
+ } & ({
444
+ alignColumns: boolean;
445
+ labelFormatter: () => any;
446
+ navigation: {
447
+ activeColor: string;
448
+ inactiveColor: string;
449
+ style: {
450
+ color: string;
451
+ };
452
+ };
453
+ } | {
454
+ enabled: boolean;
455
+ });
456
+ xAxis: {
457
+ crosshair: boolean;
458
+ gridLineColor: string;
459
+ lineColor: string;
460
+ labels: {
461
+ style: {
462
+ color: string;
463
+ };
464
+ };
465
+ tickPixelInterval: number;
466
+ tickColor: string;
467
+ tickmarkPlacement: string;
468
+ dateTimeLabelFormats: {
469
+ day: string;
470
+ week: string;
471
+ quarter: string;
472
+ };
473
+ } & {
474
+ crosshair: boolean | {
475
+ width: number;
476
+ color: string;
477
+ zIndex: number;
478
+ };
479
+ labels: {
480
+ formatter: () => any;
481
+ };
482
+ };
483
+ yAxis: {
484
+ gridLineColor: string;
485
+ lineColor: string;
486
+ labels: {
487
+ style: {
488
+ color: string;
489
+ };
490
+ };
491
+ tickColor: string;
492
+ stackLabels: {
493
+ style: {
494
+ textOutline: string;
495
+ color: string;
496
+ };
497
+ };
498
+ } & {
499
+ crosshair: boolean | {
500
+ width: number;
501
+ color: string;
502
+ zIndex: number;
503
+ };
504
+ labels: {
505
+ formatter: () => any;
506
+ };
507
+ };
508
+ exporting: {
509
+ buttons: {
510
+ contextButton: {
511
+ enabled: boolean;
512
+ };
513
+ };
514
+ };
515
+ rangeSelector: {
516
+ enabled: boolean;
517
+ inputEnabled: boolean;
518
+ };
519
+ scrollbar: {
520
+ enabled: boolean;
521
+ barBackgroundColor: string;
522
+ barBorderColor: string;
523
+ buttonArrowColor: string;
524
+ buttonBorderColor: string;
525
+ buttonBackgroundColor: string;
526
+ trackBackgroundColor: string;
527
+ trackBorderColor: string;
528
+ };
529
+ navigator: {
530
+ height: number;
531
+ outlineColor: string;
532
+ xAxis: {
533
+ gridLineColor: string;
534
+ };
535
+ handles: {
536
+ backgroundColor: string;
537
+ borderColor: string;
538
+ };
539
+ } & {
540
+ adaptToUpdatedData: boolean;
541
+ };
542
+ _config: any;
543
+ subtitle: {
544
+ text: any;
545
+ };
546
+ series: any;
547
+ _externalComments: ChartKitComment[];
548
+ _internalComments: ChartKitComment[];
549
+ };
550
+ callback: (chart: ExtendedHChart) => void;
551
+ };
552
+ export { getGraph };
@@ -0,0 +1,85 @@
1
+ import { drawComments } from './comments/drawing';
2
+ import { prepareData } from './prepare-data';
3
+ import { prepareConfig } from './config/config';
4
+ import { initHighcharts } from './highcharts/highcharts';
5
+ import { addHolidays } from './add-holidays';
6
+ import './graph.css';
7
+ let highchartsInitialized = false;
8
+ function getGraph({ options, data, comments, isMobile, holidays }) {
9
+ if (!highchartsInitialized) {
10
+ highchartsInitialized = true;
11
+ initHighcharts({ isMobile });
12
+ }
13
+ prepareData(data, options, holidays);
14
+ return {
15
+ config: Object.assign({ _externalComments: (!options.disableExternalComments && comments) || [], _internalComments: data.comments || [] }, prepareConfig(data, options, isMobile, holidays)),
16
+ callback: (chart) => {
17
+ var _a, _b, _c;
18
+ if (!chart) {
19
+ console.error('CHARTKIT_NO_CHART_CALLBACK');
20
+ return;
21
+ }
22
+ chart.userOptions._getComments = () => chart.userOptions._internalComments.concat(chart.userOptions._externalComments);
23
+ let needRedraw = false;
24
+ chart.series.forEach((serie) => {
25
+ if (serie.userOptions.noCheckNullValues) {
26
+ return;
27
+ }
28
+ if (['line', 'spline', 'area', 'stack'].includes(serie.type) &&
29
+ !serie.options.connectNulls) {
30
+ const { data } = serie;
31
+ data.forEach((point, index) => {
32
+ if (point.y !== null &&
33
+ (data[index - 1] === undefined ||
34
+ // eslint-disable-next-line eqeqeq, no-eq-null
35
+ data[index - 1].y == null) &&
36
+ // eslint-disable-next-line eqeqeq, no-eq-null
37
+ (index === data.length - 1 || data[index + 1].y == null)) {
38
+ point.update({ marker: { enabled: true } }, false, false);
39
+ needRedraw = true;
40
+ }
41
+ });
42
+ }
43
+ });
44
+ if (options.highstock) {
45
+ let extmin;
46
+ let extmax;
47
+ if (options.extremes && options.extremes.min && options.extremes.max) {
48
+ extmin = options.extremes.min;
49
+ extmax = options.extremes.max;
50
+ }
51
+ else if (options.highstock.range_min && options.highstock.range_max) {
52
+ extmin = parseInt((options.highstock.override_range_min ||
53
+ options.highstock.range_min), 10);
54
+ extmax = parseInt((options.highstock.override_range_max ||
55
+ options.highstock.range_max), 10);
56
+ }
57
+ if (extmin && extmax) {
58
+ // https://github.com/highcharts/highcharts/issues/9028
59
+ const xAxis = chart.xAxis.find((xAxis) => !chart.navigator ||
60
+ xAxis !== chart.navigator.xAxis) || ((_a = chart.navigator) === null || _a === void 0 ? void 0 : _a.xAxis);
61
+ extmin = Math.max((_b = chart.xAxis[0]) === null || _b === void 0 ? void 0 : _b.dataMin, extmin);
62
+ extmax = Math.min(chart.xAxis[0].dataMax, extmax);
63
+ (_c = xAxis) === null || _c === void 0 ? void 0 : _c.setExtremes(extmin, extmax, false, false);
64
+ needRedraw = true;
65
+ }
66
+ }
67
+ if (holidays && !options.hideHolidaysBands) {
68
+ if (needRedraw) {
69
+ addHolidays(chart, holidays);
70
+ }
71
+ else {
72
+ needRedraw = addHolidays(chart, holidays);
73
+ }
74
+ }
75
+ if (needRedraw) {
76
+ chart.redraw();
77
+ }
78
+ if (chart && chart.userOptions._getComments()) {
79
+ drawComments(chart, chart.userOptions._getComments(), chart.userOptions._config);
80
+ }
81
+ chart.userOptions.isCallbackCalled = true;
82
+ },
83
+ };
84
+ }
85
+ export { getGraph };
@@ -0,0 +1,2 @@
1
+ declare const _default: string[];
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ const colors = [
2
+ ['#4DA2F1', '#84D1EE', '#1F68A9', '#52A6C5'],
3
+ ['#FF3D64', '#FF91A1', '#ED65A9', '#BE2443'],
4
+ ['#8AD554', '#54A520', '#0FA08D', '#70C1AF'],
5
+ ['#FFC636', '#DB9100', '#FF7E00', '#FFB46C'],
6
+ ['#FFB9DD', '#BA74B3', '#E8B0A4', '#DCA3D7'],
7
+ ];
8
+ function mergeColors() {
9
+ const result = [];
10
+ for (let i = 0; i < colors[0].length; i++) {
11
+ for (let j = 0; j < colors.length; j++) {
12
+ result.push(colors[j][i]);
13
+ }
14
+ }
15
+ return result;
16
+ }
17
+ export default mergeColors().slice();
@@ -0,0 +1,4 @@
1
+ export function initHighcharts({ isMobile }: {
2
+ isMobile: any;
3
+ }): void;
4
+ export function initHighchartsMap(): void;