@gravity-ui/chartkit 4.0.0-beta.4 → 4.0.0-beta.5

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 (42) hide show
  1. package/build/plugins/d3/index.d.ts +1 -0
  2. package/build/plugins/d3/index.js +1 -0
  3. package/build/plugins/d3/renderer/D3Widget.d.ts +1 -1
  4. package/build/plugins/highcharts/index.d.ts +1 -0
  5. package/build/plugins/highcharts/index.js +1 -0
  6. package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +2 -2
  7. package/build/plugins/indicator/index.d.ts +1 -0
  8. package/build/plugins/indicator/index.js +1 -0
  9. package/build/plugins/indicator/renderer/IndicatorWidget.d.ts +1 -1
  10. package/build/plugins/yagr/index.d.ts +1 -0
  11. package/build/plugins/yagr/index.js +1 -0
  12. package/build/types/index.d.ts +1 -0
  13. package/build/types/index.js +1 -1
  14. package/package.json +30 -3
  15. package/build/plugins/highcharts/mocks/area-range.d.ts +0 -2
  16. package/build/plugins/highcharts/mocks/area-range.js +0 -61
  17. package/build/plugins/highcharts/mocks/area-stacked.d.ts +0 -2
  18. package/build/plugins/highcharts/mocks/area-stacked.js +0 -256
  19. package/build/plugins/highcharts/mocks/column-hor-stacked.d.ts +0 -2
  20. package/build/plugins/highcharts/mocks/column-hor-stacked.js +0 -199
  21. package/build/plugins/highcharts/mocks/column-ver-stacked.d.ts +0 -2
  22. package/build/plugins/highcharts/mocks/column-ver-stacked.js +0 -197
  23. package/build/plugins/highcharts/mocks/column-ver.d.ts +0 -2
  24. package/build/plugins/highcharts/mocks/column-ver.js +0 -73
  25. package/build/plugins/highcharts/mocks/combo-chart-with-same-legend-titles.d.ts +0 -2
  26. package/build/plugins/highcharts/mocks/combo-chart-with-same-legend-titles.js +0 -444
  27. package/build/plugins/highcharts/mocks/complex.d.ts +0 -2
  28. package/build/plugins/highcharts/mocks/complex.js +0 -323
  29. package/build/plugins/highcharts/mocks/custom-error-render.d.ts +0 -3
  30. package/build/plugins/highcharts/mocks/custom-error-render.js +0 -69
  31. package/build/plugins/highcharts/mocks/holidays.d.ts +0 -7070
  32. package/build/plugins/highcharts/mocks/holidays.js +0 -7065
  33. package/build/plugins/highcharts/mocks/line.d.ts +0 -2
  34. package/build/plugins/highcharts/mocks/line.js +0 -134
  35. package/build/plugins/highcharts/mocks/no-data.d.ts +0 -3
  36. package/build/plugins/highcharts/mocks/no-data.js +0 -69
  37. package/build/plugins/highcharts/mocks/pie-with-totals.d.ts +0 -2
  38. package/build/plugins/highcharts/mocks/pie-with-totals.js +0 -43
  39. package/build/plugins/highcharts/mocks/pie.d.ts +0 -2
  40. package/build/plugins/highcharts/mocks/pie.js +0 -37
  41. package/build/plugins/index.d.ts +0 -7
  42. package/build/plugins/index.js +0 -6
@@ -1,4 +1,5 @@
1
1
  import { ChartKitPlugin } from '../../types';
2
+ export * from './types';
2
3
  /**
3
4
  * It is an experemental plugin
4
5
  *
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export * from './types';
2
3
  /**
3
4
  * It is an experemental plugin
4
5
  *
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { ChartKitWidgetRef } from '../../../types';
3
3
  declare const D3Widget: React.ForwardRefExoticComponent<{
4
4
  type: "d3";
5
- data: import("../../../types/widget-data").ChartKitWidgetData<any>;
5
+ data: import("../../../types").ChartKitWidgetData<any>;
6
6
  id?: string | undefined;
7
7
  isMobile?: boolean | undefined;
8
8
  onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"d3"> | undefined) => void) | undefined;
@@ -1,2 +1,3 @@
1
1
  import type { ChartKitPlugin } from '../../types';
2
+ export * from './types';
2
3
  export declare const HighchartsPlugin: ChartKitPlugin;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export * from './types';
2
3
  export const HighchartsPlugin = {
3
4
  type: 'highcharts',
4
5
  renderer: React.lazy(() => import('./renderer/HighchartsWidget')),
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { ChartKitWidgetRef } from '../../../types';
3
3
  declare const HighchartsWidget: React.ForwardRefExoticComponent<{
4
4
  type: "highcharts";
5
- data: import("../types").HighchartsWidgetData;
5
+ data: import("..").HighchartsWidgetData;
6
6
  id?: string | undefined;
7
7
  isMobile?: boolean | undefined;
8
8
  onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"highcharts"> | undefined) => void) | undefined;
@@ -18,7 +18,7 @@ declare const HighchartsWidget: React.ForwardRefExoticComponent<{
18
18
  onChange?: ((data: {
19
19
  type: "PARAMS_CHANGED";
20
20
  data: {
21
- params: import("../types").StringParams;
21
+ params: import("..").StringParams;
22
22
  };
23
23
  }, state: {
24
24
  forceUpdate: boolean;
@@ -1,2 +1,3 @@
1
1
  import { ChartKitPlugin } from '../../types';
2
+ export * from './types';
2
3
  export declare const IndicatorPlugin: ChartKitPlugin;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export * from './types';
2
3
  export const IndicatorPlugin = {
3
4
  type: 'indicator',
4
5
  renderer: React.lazy(() => import('./renderer/IndicatorWidget')),
@@ -3,7 +3,7 @@ import type { ChartKitWidgetRef } from '../../../types';
3
3
  import './IndicatorWidget.css';
4
4
  declare const IndicatorWidget: React.ForwardRefExoticComponent<{
5
5
  type: "indicator";
6
- data: import("../types").IndicatorWidgetData;
6
+ data: import("..").IndicatorWidgetData;
7
7
  id?: string | undefined;
8
8
  isMobile?: boolean | undefined;
9
9
  onLoad?: ((data?: import("../../../types").ChartKitOnLoadData<"indicator"> | undefined) => void) | undefined;
@@ -1,2 +1,3 @@
1
1
  import { ChartKitPlugin } from '../../types';
2
+ export * from './types';
2
3
  export declare const YagrPlugin: ChartKitPlugin;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ export * from './types';
2
3
  export const YagrPlugin = {
3
4
  type: 'yagr',
4
5
  renderer: React.lazy(() => import('./renderer/YagrWidget')),
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type { ChartKitWidget } from './widget';
3
3
  import { ChartKitError } from '../libs';
4
4
  export type { ChartKitHolidays } from './misc';
5
+ export * from './widget-data';
5
6
  export type ChartKitLang = 'ru' | 'en';
6
7
  export type ChartKitType = keyof ChartKitWidget;
7
8
  export type ChartKitRef = {
@@ -1 +1 @@
1
- export {};
1
+ export * from './widget-data';
package/package.json CHANGED
@@ -1,15 +1,42 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.5",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",
7
7
  "main": "build/index.js",
8
- "typings": "build/index.d.ts",
8
+ "types": "build/index.d.ts",
9
+ "exports": {
10
+ ".": "./build/index.js",
11
+ "./d3": "./build/plugins/d3/index.js",
12
+ "./highcharts": "./build/plugins/highcharts/index.js",
13
+ "./indicator": "./build/plugins/indicator/index.js",
14
+ "./yagr": "./build/plugins/yagr/index.js"
15
+ },
16
+ "typesVersions": {
17
+ "*": {
18
+ "index.d.ts": [
19
+ "./build/index.d.ts"
20
+ ],
21
+ "d3": [
22
+ "./build/plugins/d3/index.d.ts"
23
+ ],
24
+ "highcharts": [
25
+ "./build/plugins/highcharts/index.d.ts"
26
+ ],
27
+ "indicator": [
28
+ "./build/plugins/indicator/index.d.ts"
29
+ ],
30
+ "yagr": [
31
+ "./build/plugins/yagr/index.d.ts"
32
+ ]
33
+ }
34
+ },
9
35
  "files": [
10
36
  "build",
11
37
  "!**/__tests__/**",
12
- "!**/__stories__/**"
38
+ "!**/__stories__/**",
39
+ "!**/mocks/**"
13
40
  ],
14
41
  "publishConfig": {
15
42
  "access": "public"
@@ -1,2 +0,0 @@
1
- import type { HighchartsWidgetData } from '../types';
2
- export declare const data: HighchartsWidgetData;
@@ -1,61 +0,0 @@
1
- export const data = {
2
- data: {
3
- graphs: [
4
- {
5
- name: 'Temperatures',
6
- data: [
7
- [1246406400000, 10.4, 17],
8
- [1246492800000, 10.3, 28.6],
9
- [1246579200000, 14.8, 18.4],
10
- [1246665600000, 11.5, 25.8],
11
- [1246752000000, 11.1, 24.4],
12
- [1246838400000, 17.7, 19.6],
13
- [1246924800000, 15.1, 18.1],
14
- [1247011200000, 15.1, 27.2],
15
- [1247097600000, 17, 17.5],
16
- [1247184000000, 12.6, 18.5],
17
- [1247270400000, 12.2, 26],
18
- [1247356800000, 15.9, 22.9],
19
- [1247443200000, 17.1, 18.1],
20
- [1247529600000, 13.3, 24.2],
21
- [1247616000000, 17, 28.1],
22
- [1247702400000, 16.2, 22.6],
23
- [1247788800000, 10.6, 19],
24
- [1247875200000, 11.3, 19.7],
25
- [1247961600000, 14.1, 24.6],
26
- [1248048000000, 14.2, 22.5],
27
- [1248134400000, 14.1, 28.5],
28
- [1248220800000, 14, 27],
29
- [1248307200000, 10.2, 20.6],
30
- [1248393600000, 13.1, 29.9],
31
- [1248480000000, 13.7, 21.1],
32
- [1248566400000, 15, 28.6],
33
- [1248652800000, 12, 17.5],
34
- [1248739200000, 17.8, 24.4],
35
- [1248825600000, 11.7, 25.9],
36
- [1248912000000, 13.6, 25.6],
37
- [1248998400000, 17.3, 22.2],
38
- ],
39
- },
40
- ],
41
- },
42
- config: {
43
- hideHolidays: false,
44
- normalizeDiv: false,
45
- normalizeSub: false,
46
- },
47
- libraryConfig: {
48
- chart: {
49
- type: 'arearange',
50
- },
51
- title: {
52
- text: 'Temperature variation by day',
53
- },
54
- xAxis: {
55
- type: 'datetime',
56
- },
57
- tooltip: {
58
- valueSuffix: '°C',
59
- },
60
- },
61
- };
@@ -1,2 +0,0 @@
1
- import { HighchartsWidgetData } from '../types';
2
- export declare const data: HighchartsWidgetData;
@@ -1,256 +0,0 @@
1
- export const data = {
2
- data: {
3
- graphs: [
4
- {
5
- title: 'Sales',
6
- tooltip: {
7
- chartKitFormatting: true,
8
- chartKitPrecision: 2,
9
- },
10
- data: [
11
- {
12
- y: 167387.5003761053,
13
- },
14
- {
15
- y: 107532.49998930097,
16
- },
17
- {
18
- y: 27119.399931907654,
19
- },
20
- {
21
- y: 203415.90024918318,
22
- },
23
- {
24
- y: 114882.00052642822,
25
- },
26
- {
27
- y: 328452.60130500793,
28
- },
29
- {
30
- y: 149529.49963378906,
31
- },
32
- {
33
- y: 16477.799976468086,
34
- },
35
- {
36
- y: 3024.2000015974045,
37
- },
38
- {
39
- y: 91708.29990947247,
40
- },
41
- {
42
- y: 12485.399973154068,
43
- },
44
- {
45
- y: 189239.5000743866,
46
- },
47
- {
48
- y: 78483.89996623993,
49
- },
50
- {
51
- y: 330018.3997364044,
52
- },
53
- {
54
- y: 223844.49978113174,
55
- },
56
- {
57
- y: 46673.600484371185,
58
- },
59
- {
60
- y: 206966.50039672852,
61
- },
62
- ],
63
- legendTitle: 'Sales',
64
- connectNulls: false,
65
- yAxis: 0,
66
- color: '#8AD554',
67
- },
68
- {
69
- title: 'Profit',
70
- tooltip: {
71
- chartKitFormatting: true,
72
- chartKitPrecision: 0,
73
- },
74
- data: [
75
- {
76
- y: 41615,
77
- },
78
- {
79
- y: 17927,
80
- },
81
- {
82
- y: 6156,
83
- },
84
- {
85
- y: 29550,
86
- },
87
- {
88
- y: -3568,
89
- },
90
- {
91
- y: 26316,
92
- },
93
- {
94
- y: 55618,
95
- },
96
- {
97
- y: 6849,
98
- },
99
- {
100
- y: 850,
101
- },
102
- {
103
- y: 12649,
104
- },
105
- {
106
- y: 5367,
107
- },
108
- {
109
- y: 3353,
110
- },
111
- {
112
- y: 33437,
113
- },
114
- {
115
- y: 44171,
116
- },
117
- {
118
- y: 20907,
119
- },
120
- {
121
- y: -1262,
122
- },
123
- {
124
- y: -17865,
125
- },
126
- ],
127
- legendTitle: 'Profit',
128
- connectNulls: false,
129
- yAxis: 0,
130
- color: '#FF3D64',
131
- },
132
- {
133
- title: 'Px2',
134
- tooltip: {
135
- chartKitFormatting: true,
136
- chartKitPrecision: 0,
137
- },
138
- data: [
139
- {
140
- y: 83230,
141
- },
142
- {
143
- y: 35854,
144
- },
145
- {
146
- y: 12312,
147
- },
148
- {
149
- y: 59100,
150
- },
151
- {
152
- y: -7136,
153
- },
154
- {
155
- y: 52632,
156
- },
157
- {
158
- y: 111236,
159
- },
160
- {
161
- y: 13698,
162
- },
163
- {
164
- y: 1700,
165
- },
166
- {
167
- y: 25298,
168
- },
169
- {
170
- y: 10734,
171
- },
172
- {
173
- y: 6706,
174
- },
175
- {
176
- y: 66874,
177
- },
178
- {
179
- y: 88342,
180
- },
181
- {
182
- y: 41814,
183
- },
184
- {
185
- y: -2524,
186
- },
187
- {
188
- y: -35730,
189
- },
190
- ],
191
- legendTitle: 'Px2',
192
- connectNulls: false,
193
- yAxis: 0,
194
- color: '#4DA2F1',
195
- },
196
- ],
197
- categories: [
198
- 'Accessories',
199
- 'Appliances',
200
- 'Art',
201
- 'Binders',
202
- 'Bookcases',
203
- 'Chairs',
204
- 'Copiers',
205
- 'Envelopes',
206
- 'Fasteners',
207
- 'Furnishings',
208
- 'Labels',
209
- 'Machines',
210
- 'Paper',
211
- 'Phones',
212
- 'Storage',
213
- 'Supplies',
214
- 'Tables',
215
- ],
216
- },
217
- config: {
218
- withoutLineLimit: true,
219
- hideHolidaysBands: true,
220
- enableSum: true,
221
- },
222
- libraryConfig: {
223
- chart: {
224
- type: 'area',
225
- zoomType: 'x',
226
- },
227
- xAxis: {
228
- endOnTick: false,
229
- type: 'linear',
230
- labels: {
231
- enabled: true,
232
- },
233
- },
234
- yAxis: {
235
- opposite: false,
236
- labels: {
237
- y: 3,
238
- enabled: true,
239
- },
240
- type: 'linear',
241
- },
242
- plotOptions: {
243
- area: {
244
- stacking: 'normal',
245
- },
246
- series: {
247
- dataGrouping: {
248
- enabled: false,
249
- },
250
- dataLabels: {
251
- allowOverlap: false,
252
- },
253
- },
254
- },
255
- },
256
- };
@@ -1,2 +0,0 @@
1
- import { HighchartsWidgetData } from '../types';
2
- export declare const data: HighchartsWidgetData;
@@ -1,199 +0,0 @@
1
- export const data = {
2
- data: {
3
- graphs: [
4
- {
5
- title: 'Central',
6
- tooltip: {
7
- chartKitFormatting: true,
8
- chartKitPrecision: 0,
9
- },
10
- data: [
11
- {
12
- y: 163798.70024430752,
13
- dataLabels: {
14
- enabled: false,
15
- },
16
- },
17
- {
18
- y: 167028.80030867457,
19
- dataLabels: {
20
- enabled: false,
21
- },
22
- },
23
- {
24
- y: 170420.6004266739,
25
- dataLabels: {
26
- enabled: false,
27
- },
28
- },
29
- ],
30
- legendTitle: 'Central',
31
- drillDownFilterValue: 'Central',
32
- connectNulls: false,
33
- yAxis: 0,
34
- colorValue: 'Central',
35
- shapeValue: 'Profit',
36
- custom: {},
37
- color: '#4DA2F1',
38
- },
39
- {
40
- title: 'East',
41
- tooltip: {
42
- chartKitFormatting: true,
43
- chartKitPrecision: 0,
44
- },
45
- data: [
46
- {
47
- y: 208293.70054268837,
48
- dataLabels: {
49
- enabled: false,
50
- },
51
- },
52
- {
53
- y: 205518.80070078373,
54
- dataLabels: {
55
- enabled: false,
56
- },
57
- },
58
- {
59
- y: 264979.80019688606,
60
- dataLabels: {
61
- enabled: false,
62
- },
63
- },
64
- ],
65
- legendTitle: 'East',
66
- drillDownFilterValue: 'East',
67
- connectNulls: false,
68
- yAxis: 0,
69
- colorValue: 'East',
70
- shapeValue: 'Profit',
71
- custom: {},
72
- color: '#FF3D64',
73
- },
74
- {
75
- title: 'South',
76
- tooltip: {
77
- chartKitFormatting: true,
78
- chartKitPrecision: 0,
79
- },
80
- data: [
81
- {
82
- y: 117300.00069212914,
83
- dataLabels: {
84
- enabled: false,
85
- },
86
- },
87
- {
88
- y: 125653.1994549036,
89
- dataLabels: {
90
- enabled: false,
91
- },
92
- },
93
- {
94
- y: 148775.5996557474,
95
- dataLabels: {
96
- enabled: false,
97
- },
98
- },
99
- ],
100
- legendTitle: 'South',
101
- drillDownFilterValue: 'South',
102
- connectNulls: false,
103
- yAxis: 0,
104
- colorValue: 'South',
105
- shapeValue: 'Profit',
106
- custom: {},
107
- color: '#8AD554',
108
- },
109
- {
110
- title: 'West',
111
- tooltip: {
112
- chartKitFormatting: true,
113
- chartKitPrecision: 0,
114
- },
115
- data: [
116
- {
117
- y: 252617.00065851212,
118
- dataLabels: {
119
- enabled: false,
120
- },
121
- },
122
- {
123
- y: 220856.3998889923,
124
- dataLabels: {
125
- enabled: false,
126
- },
127
- },
128
- {
129
- y: 251998.89954137802,
130
- dataLabels: {
131
- enabled: false,
132
- },
133
- },
134
- ],
135
- legendTitle: 'West',
136
- drillDownFilterValue: 'West',
137
- connectNulls: false,
138
- yAxis: 0,
139
- colorValue: 'West',
140
- shapeValue: 'Profit',
141
- custom: {},
142
- color: '#FFC636',
143
- },
144
- ],
145
- categories: ['Furniture', 'Office Supplies', 'Technology'],
146
- },
147
- config: {
148
- withoutLineLimit: true,
149
- hideHolidaysBands: true,
150
- enableSum: true,
151
- },
152
- libraryConfig: {
153
- chart: {
154
- type: 'bar',
155
- zoomType: 'xy',
156
- },
157
- xAxis: {
158
- endOnTick: false,
159
- title: {
160
- text: null,
161
- },
162
- type: 'linear',
163
- labels: {
164
- enabled: true,
165
- },
166
- },
167
- yAxis: {
168
- opposite: false,
169
- labels: {
170
- y: 3,
171
- enabled: true,
172
- },
173
- title: {
174
- text: null,
175
- },
176
- type: 'linear',
177
- },
178
- tooltip: {},
179
- plotOptions: {
180
- bar: {
181
- stacking: 'normal',
182
- },
183
- column: {
184
- dataGrouping: {
185
- enabled: false,
186
- },
187
- maxPointWidth: 50,
188
- },
189
- series: {
190
- dataGrouping: {
191
- enabled: false,
192
- },
193
- dataLabels: {
194
- allowOverlap: false,
195
- },
196
- },
197
- },
198
- },
199
- };
@@ -1,2 +0,0 @@
1
- import { HighchartsWidgetData } from '../types';
2
- export declare const data: HighchartsWidgetData;