@progress/kendo-charts 2.5.1 → 2.5.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.
- package/dist/cdn/js/kendo-charts.js +1 -1
- package/dist/cdn/main.js +1 -1
- package/dist/es/chart-wizard/state.js +11 -10
- package/dist/es2015/chart-wizard/state.js +11 -10
- package/dist/npm/chart-wizard.d.ts +167 -10
- package/dist/npm/main.js +12 -11
- package/dist/systemjs/kendo-charts.js +1 -1
- package/package.json +1 -1
|
@@ -418,22 +418,23 @@ function createState(data, seriesType) {
|
|
|
418
418
|
);
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
function mergeStates(
|
|
422
|
-
newState
|
|
423
|
-
newState.
|
|
424
|
-
newState.
|
|
425
|
-
newState.
|
|
426
|
-
|
|
421
|
+
function mergeStates(source, target) {
|
|
422
|
+
var newState = structuredClone(target);
|
|
423
|
+
newState.legend = source.legend;
|
|
424
|
+
newState.area = source.area;
|
|
425
|
+
newState.title = source.title;
|
|
426
|
+
newState.subtitle = source.subtitle;
|
|
427
|
+
if (newState.series.length === source.series.length) {
|
|
427
428
|
for (var i = 0; i < newState.series.length; i++) {
|
|
428
|
-
newState.series[i].color =
|
|
429
|
-
newState.series[i].labels =
|
|
429
|
+
newState.series[i].color = source.series[i].color;
|
|
430
|
+
newState.series[i].labels = source.series[i].labels;
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
433
|
|
|
433
434
|
if (
|
|
434
|
-
|
|
435
|
+
source.series.every(function (s) { return s.labels && s.labels.visible; }) &&
|
|
435
436
|
isCategorical(newState.seriesType) &&
|
|
436
|
-
isCategorical(
|
|
437
|
+
isCategorical(source.seriesType)
|
|
437
438
|
) {
|
|
438
439
|
newState.series.forEach(function (s) {
|
|
439
440
|
s.labels = s.labels || {};
|
|
@@ -426,22 +426,23 @@ function createState(data, seriesType) {
|
|
|
426
426
|
);
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
function mergeStates(
|
|
430
|
-
newState
|
|
431
|
-
newState.
|
|
432
|
-
newState.
|
|
433
|
-
newState.
|
|
434
|
-
|
|
429
|
+
function mergeStates(source, target) {
|
|
430
|
+
const newState = structuredClone(target);
|
|
431
|
+
newState.legend = source.legend;
|
|
432
|
+
newState.area = source.area;
|
|
433
|
+
newState.title = source.title;
|
|
434
|
+
newState.subtitle = source.subtitle;
|
|
435
|
+
if (newState.series.length === source.series.length) {
|
|
435
436
|
for (let i = 0; i < newState.series.length; i++) {
|
|
436
|
-
newState.series[i].color =
|
|
437
|
-
newState.series[i].labels =
|
|
437
|
+
newState.series[i].color = source.series[i].color;
|
|
438
|
+
newState.series[i].labels = source.series[i].labels;
|
|
438
439
|
}
|
|
439
440
|
}
|
|
440
441
|
|
|
441
442
|
if (
|
|
442
|
-
|
|
443
|
+
source.series.every((s) => s.labels && s.labels.visible) &&
|
|
443
444
|
isCategorical(newState.seriesType) &&
|
|
444
|
-
isCategorical(
|
|
445
|
+
isCategorical(source.seriesType)
|
|
445
446
|
) {
|
|
446
447
|
newState.series.forEach((s) => {
|
|
447
448
|
s.labels = s.labels || {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Margin } from './field-types/margin.interface';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Describes a single data cell for the
|
|
4
|
+
* Describes a single data cell for the ChartWizard.
|
|
5
5
|
*/
|
|
6
6
|
export interface ChartWizardDataCell {
|
|
7
7
|
/**
|
|
@@ -16,7 +16,7 @@ export interface ChartWizardDataCell {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Describes a data row for the
|
|
19
|
+
* Describes a data row for the ChartWizard.
|
|
20
20
|
*/
|
|
21
21
|
export type ChartWizardDataRow = ChartWizardDataCell[];
|
|
22
22
|
|
|
@@ -24,7 +24,14 @@ export type ChartWizardDataRow = ChartWizardDataCell[];
|
|
|
24
24
|
* Represents a data column from a grid component or similar.
|
|
25
25
|
*/
|
|
26
26
|
export interface DataColumn {
|
|
27
|
+
/**
|
|
28
|
+
* The field name of the column.
|
|
29
|
+
*/
|
|
27
30
|
field: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The title of the column.
|
|
34
|
+
*/
|
|
28
35
|
title: string;
|
|
29
36
|
}
|
|
30
37
|
|
|
@@ -32,84 +39,228 @@ export interface DataColumn {
|
|
|
32
39
|
* Represents a data row from a grid component or similar.
|
|
33
40
|
*/
|
|
34
41
|
export interface DataRow {
|
|
42
|
+
/**
|
|
43
|
+
* The data item of the row.
|
|
44
|
+
*/
|
|
35
45
|
dataItem: any;
|
|
46
|
+
/**
|
|
47
|
+
* The data cells of the row.
|
|
48
|
+
*/
|
|
36
49
|
dataColumns: DataColumn[];
|
|
37
50
|
}
|
|
38
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Represents the series type of the ChartWizard component.
|
|
54
|
+
*/
|
|
39
55
|
export type ChartWizardSeriesType = 'bar' | 'column' | 'line' | 'pie' | 'scatter';
|
|
40
56
|
|
|
41
57
|
interface FontInterface {
|
|
58
|
+
/**
|
|
59
|
+
* The font configuration.
|
|
60
|
+
*/
|
|
42
61
|
font?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The font color.
|
|
64
|
+
*/
|
|
43
65
|
color?: string;
|
|
44
66
|
}
|
|
45
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Represents the configuration of the ChartWizard title.
|
|
70
|
+
*/
|
|
46
71
|
export interface ChartWizardTitle extends FontInterface {
|
|
72
|
+
/**
|
|
73
|
+
* The text of the title.
|
|
74
|
+
*/
|
|
47
75
|
text?: string;
|
|
48
76
|
}
|
|
49
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Represents the configuration of the ChartWizard series stack.
|
|
80
|
+
*/
|
|
50
81
|
export interface ChartWizardSeriesStack {
|
|
82
|
+
/**
|
|
83
|
+
* The type of the series stack.
|
|
84
|
+
*/
|
|
51
85
|
type?: 'normal' | '100%';
|
|
52
86
|
}
|
|
53
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Represents the configuration of the ChartWizard area.
|
|
90
|
+
*/
|
|
54
91
|
export interface ChartWizardArea {
|
|
92
|
+
/**
|
|
93
|
+
* The background color of the area.
|
|
94
|
+
*/
|
|
55
95
|
background?: string;
|
|
96
|
+
/**
|
|
97
|
+
* The margin of the area.
|
|
98
|
+
*/
|
|
56
99
|
margin?: Margin;
|
|
57
100
|
}
|
|
58
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Represents the configuration of the ChartWizard axis label.
|
|
104
|
+
*/
|
|
59
105
|
export interface ChartWizardAxisLabel extends FontInterface {
|
|
106
|
+
/**
|
|
107
|
+
* The rotation of the labels.
|
|
108
|
+
*/
|
|
60
109
|
rotation?: number | 'auto';
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The format of the labels.
|
|
113
|
+
*/
|
|
61
114
|
format?: string;
|
|
62
115
|
}
|
|
63
116
|
|
|
64
117
|
interface ChartAxisItem {
|
|
118
|
+
/**
|
|
119
|
+
* The title of the axis.
|
|
120
|
+
*/
|
|
65
121
|
title?: ChartWizardTitle;
|
|
122
|
+
/**
|
|
123
|
+
* The labels of the axis.
|
|
124
|
+
*/
|
|
66
125
|
labels?: ChartWizardAxisLabel;
|
|
126
|
+
/**
|
|
127
|
+
* The reverse option of the axis.
|
|
128
|
+
*/
|
|
67
129
|
reverse?: boolean;
|
|
68
130
|
}
|
|
69
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Represents the configuration of the ChartWizard category axis item.
|
|
134
|
+
*/
|
|
70
135
|
export interface ChartWizardCategoryAxisItem extends ChartAxisItem {
|
|
136
|
+
/**
|
|
137
|
+
* The categories of the axis.
|
|
138
|
+
*/
|
|
71
139
|
categories?: any[];
|
|
72
140
|
}
|
|
73
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Represents the configuration of the ChartWizard value axis item.
|
|
144
|
+
*/
|
|
74
145
|
export interface ChartWizardValueAxisItem extends ChartAxisItem { }
|
|
75
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Represents the configuration of the ChartWizard legend.
|
|
149
|
+
*/
|
|
76
150
|
export interface ChartWizardLegend {
|
|
151
|
+
/**
|
|
152
|
+
* The visibility of the legend.
|
|
153
|
+
*/
|
|
77
154
|
visible?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* The position of the legend.
|
|
157
|
+
*/
|
|
78
158
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
159
|
+
/**
|
|
160
|
+
* The labels of the legend.
|
|
161
|
+
*/
|
|
79
162
|
labels?: FontInterface;
|
|
80
163
|
}
|
|
81
164
|
|
|
82
165
|
/**
|
|
83
|
-
*
|
|
166
|
+
* Represents the configuration of the ChartWizard series item label.
|
|
167
|
+
*/
|
|
168
|
+
export interface ChartWizardSeriesItemLabel {
|
|
169
|
+
/**
|
|
170
|
+
* The visibility of the labels.
|
|
171
|
+
*/
|
|
172
|
+
visible?: boolean;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Represents the configuration of the ChartWizard series item.
|
|
84
177
|
*/
|
|
85
178
|
export interface ChartWizardSeriesItem {
|
|
179
|
+
/**
|
|
180
|
+
* The id of the series item.
|
|
181
|
+
*/
|
|
86
182
|
id: number;
|
|
183
|
+
/**
|
|
184
|
+
* The name of the series item.
|
|
185
|
+
*/
|
|
87
186
|
name?: string;
|
|
187
|
+
/**
|
|
188
|
+
* The color of the series item.
|
|
189
|
+
*/
|
|
88
190
|
color?: string;
|
|
191
|
+
/**
|
|
192
|
+
* The type of the series item.
|
|
193
|
+
*/
|
|
89
194
|
type?: ChartWizardSeriesType;
|
|
195
|
+
/**
|
|
196
|
+
* The data of the series item.
|
|
197
|
+
*/
|
|
90
198
|
data?: any[];
|
|
199
|
+
/**
|
|
200
|
+
* The stack of the series item.
|
|
201
|
+
*/
|
|
91
202
|
stack?: ChartWizardSeriesStack | false;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
203
|
+
/**
|
|
204
|
+
* The labels of the series item.
|
|
205
|
+
*/
|
|
206
|
+
labels?: ChartWizardSeriesItemLabel;
|
|
207
|
+
/**
|
|
208
|
+
* The categoryField of the series item.
|
|
209
|
+
*/
|
|
95
210
|
categoryField?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The field of the series item.
|
|
213
|
+
*/
|
|
96
214
|
field?: string;
|
|
215
|
+
/**
|
|
216
|
+
* The width of the series item.
|
|
217
|
+
*/
|
|
97
218
|
width?: number;
|
|
98
219
|
}
|
|
99
220
|
|
|
100
221
|
/**
|
|
101
|
-
*
|
|
222
|
+
* Represents the state of the ChartWizard component.
|
|
102
223
|
*/
|
|
103
224
|
export interface ChartWizardState {
|
|
225
|
+
/**
|
|
226
|
+
* The title configuration of the chart.
|
|
227
|
+
*/
|
|
104
228
|
title?: ChartWizardTitle;
|
|
229
|
+
/**
|
|
230
|
+
* The subtitle configuration of the chart.
|
|
231
|
+
*/
|
|
105
232
|
subtitle?: ChartWizardTitle;
|
|
233
|
+
/**
|
|
234
|
+
* The area configuration of the chart.
|
|
235
|
+
*/
|
|
106
236
|
area: ChartWizardArea;
|
|
237
|
+
/**
|
|
238
|
+
* The category axis configuration of the chart.
|
|
239
|
+
*/
|
|
107
240
|
categoryAxis: ChartWizardCategoryAxisItem[];
|
|
241
|
+
/**
|
|
242
|
+
* The value axis configuration of the chart.
|
|
243
|
+
*/
|
|
108
244
|
valueAxis: ChartWizardValueAxisItem[];
|
|
245
|
+
/**
|
|
246
|
+
* The series configuration of the chart.
|
|
247
|
+
*/
|
|
109
248
|
series: ChartWizardSeriesItem[];
|
|
249
|
+
/**
|
|
250
|
+
* The initial series configuration of the chart.
|
|
251
|
+
*/
|
|
110
252
|
initialSeries: ChartWizardSeriesItem[];
|
|
253
|
+
/**
|
|
254
|
+
* The legend configuration of the chart.
|
|
255
|
+
*/
|
|
111
256
|
legend?: ChartWizardLegend;
|
|
257
|
+
/**
|
|
258
|
+
* The columns of the chart.
|
|
259
|
+
*/
|
|
112
260
|
columns: string[];
|
|
261
|
+
/**
|
|
262
|
+
* The data of the chart.
|
|
263
|
+
*/
|
|
113
264
|
data: ChartWizardDataRow[];
|
|
114
265
|
/**
|
|
115
266
|
* The series type of the chart.
|
|
@@ -122,7 +273,13 @@ export interface ChartWizardState {
|
|
|
122
273
|
* - `'scatter'`
|
|
123
274
|
*/
|
|
124
275
|
seriesType?: ChartWizardSeriesType;
|
|
276
|
+
/**
|
|
277
|
+
* The categoryField configuration of the series.
|
|
278
|
+
*/
|
|
125
279
|
categoryField?: string;
|
|
280
|
+
/**
|
|
281
|
+
* The valueField configuration of the series.
|
|
282
|
+
*/
|
|
126
283
|
valueField?: string;
|
|
127
284
|
/**
|
|
128
285
|
* The stack configuration of the series.
|
|
@@ -301,13 +458,13 @@ export const ChartWizardCommon: Readonly<{
|
|
|
301
458
|
parseFont(font?: string): { name: string; size: string };
|
|
302
459
|
createInitialState(data: ChartWizardDataRow[], seriesType: ChartWizardSeriesType, defaultState?: ChartWizardDefaultState): ChartWizardState;
|
|
303
460
|
createState(data: ChartWizardDataRow[], seriesType: ChartWizardSeriesType): ChartWizardState;
|
|
304
|
-
mergeStates(
|
|
461
|
+
mergeStates(sourceState: ChartWizardState, targetState: ChartWizardState): ChartWizardState;
|
|
305
462
|
updateState(currentState: ChartWizardState, action: ActionTypes, value: any): ChartWizardState;
|
|
306
463
|
|
|
307
464
|
/**
|
|
308
|
-
* Maps data rows to the
|
|
465
|
+
* Maps data rows to the ChartWizard data format.
|
|
309
466
|
*
|
|
310
|
-
* @returns collection that can be used as
|
|
467
|
+
* @returns collection that can be used as ChartWizard.
|
|
311
468
|
*/
|
|
312
469
|
getWizardDataFromDataRows(dataRows: DataRow[]): ChartWizardDataRow[];
|
|
313
470
|
}>;
|