@gravity-ui/chartkit 4.0.0-beta.3 → 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.
- package/build/plugins/d3/index.d.ts +1 -0
- package/build/plugins/d3/index.js +1 -0
- package/build/plugins/d3/renderer/D3Widget.d.ts +1 -1
- package/build/plugins/highcharts/index.d.ts +1 -0
- package/build/plugins/highcharts/index.js +1 -0
- package/build/plugins/highcharts/renderer/HighchartsWidget.d.ts +2 -2
- package/build/plugins/highcharts/renderer/components/HighchartsComponent.js +0 -2
- package/build/plugins/highcharts/renderer/components/HighchartsReact.js +1 -0
- package/build/plugins/indicator/index.d.ts +1 -0
- package/build/plugins/indicator/index.js +1 -0
- package/build/plugins/indicator/renderer/IndicatorWidget.d.ts +1 -1
- package/build/plugins/yagr/index.d.ts +1 -0
- package/build/plugins/yagr/index.js +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.js +1 -1
- package/package.json +30 -4
- package/build/plugins/highcharts/mocks/area-range.d.ts +0 -2
- package/build/plugins/highcharts/mocks/area-range.js +0 -61
- package/build/plugins/highcharts/mocks/area-stacked.d.ts +0 -2
- package/build/plugins/highcharts/mocks/area-stacked.js +0 -256
- package/build/plugins/highcharts/mocks/column-hor-stacked.d.ts +0 -2
- package/build/plugins/highcharts/mocks/column-hor-stacked.js +0 -199
- package/build/plugins/highcharts/mocks/column-ver-stacked.d.ts +0 -2
- package/build/plugins/highcharts/mocks/column-ver-stacked.js +0 -197
- package/build/plugins/highcharts/mocks/column-ver.d.ts +0 -2
- package/build/plugins/highcharts/mocks/column-ver.js +0 -73
- package/build/plugins/highcharts/mocks/combo-chart-with-same-legend-titles.d.ts +0 -2
- package/build/plugins/highcharts/mocks/combo-chart-with-same-legend-titles.js +0 -444
- package/build/plugins/highcharts/mocks/complex.d.ts +0 -2
- package/build/plugins/highcharts/mocks/complex.js +0 -323
- package/build/plugins/highcharts/mocks/custom-error-render.d.ts +0 -3
- package/build/plugins/highcharts/mocks/custom-error-render.js +0 -69
- package/build/plugins/highcharts/mocks/holidays.d.ts +0 -7070
- package/build/plugins/highcharts/mocks/holidays.js +0 -7065
- package/build/plugins/highcharts/mocks/line.d.ts +0 -2
- package/build/plugins/highcharts/mocks/line.js +0 -134
- package/build/plugins/highcharts/mocks/no-data.d.ts +0 -3
- package/build/plugins/highcharts/mocks/no-data.js +0 -69
- package/build/plugins/highcharts/mocks/pie-with-totals.d.ts +0 -2
- package/build/plugins/highcharts/mocks/pie-with-totals.js +0 -43
- package/build/plugins/highcharts/mocks/pie.d.ts +0 -2
- package/build/plugins/highcharts/mocks/pie.js +0 -37
- package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.d.ts +0 -1
- package/build/plugins/highcharts/renderer/helpers/init-highcharts-modules.js +0 -49
- package/build/plugins/index.d.ts +0 -7
- package/build/plugins/index.js +0 -6
|
@@ -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
|
|
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;
|
|
@@ -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("
|
|
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("
|
|
21
|
+
params: import("..").StringParams;
|
|
22
22
|
};
|
|
23
23
|
}, state: {
|
|
24
24
|
forceUpdate: boolean;
|
|
@@ -6,7 +6,6 @@ import { settings } from '../../../../libs';
|
|
|
6
6
|
import { settingsEventEmitter } from '../../../../libs/settings/settings';
|
|
7
7
|
import { markChartPerformance, getChartPerformanceDuration, getRandomCKId } from '../../../../utils';
|
|
8
8
|
import { getGraph } from '../helpers/graph';
|
|
9
|
-
import { initHighchartsModules } from '../helpers/init-highcharts-modules';
|
|
10
9
|
import { initHighchartsLangOptions } from '../helpers/highcharts/highcharts';
|
|
11
10
|
import { withSplitPane } from './withSplitPane/withSplitPane';
|
|
12
11
|
import './HighchartsComponent.css';
|
|
@@ -15,7 +14,6 @@ settingsEventEmitter.on('change-lang', {
|
|
|
15
14
|
id: 'hc-lang-handler',
|
|
16
15
|
action: initHighchartsLangOptions,
|
|
17
16
|
});
|
|
18
|
-
initHighchartsModules();
|
|
19
17
|
export class HighchartsComponent extends React.PureComponent {
|
|
20
18
|
constructor() {
|
|
21
19
|
super(...arguments);
|
|
@@ -16,6 +16,7 @@ export const HighchartsReact = React.memo(React.forwardRef(function HighchartsRe
|
|
|
16
16
|
'required module is not imported.');
|
|
17
17
|
}
|
|
18
18
|
else if (props.options) {
|
|
19
|
+
// @ts-expect-error
|
|
19
20
|
chartRef.current = HighchartsComponent[constructorType](containerRef.current, props.options, props.callback);
|
|
20
21
|
}
|
|
21
22
|
else {
|
|
@@ -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("
|
|
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;
|
package/build/types/index.d.ts
CHANGED
|
@@ -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 = {
|
package/build/types/index.js
CHANGED
|
@@ -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.
|
|
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
|
-
"
|
|
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"
|
|
@@ -75,7 +102,6 @@
|
|
|
75
102
|
},
|
|
76
103
|
"peerDependencies": {
|
|
77
104
|
"@gravity-ui/uikit": "^5.0.0",
|
|
78
|
-
"highcharts": "^8.2.2",
|
|
79
105
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
80
106
|
},
|
|
81
107
|
"scripts": {
|
|
@@ -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,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
|
-
};
|