@progress/kendo-charts 2.4.2 → 2.5.0-dev.202409030746

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.
@@ -0,0 +1,19 @@
1
+ import { getWizardDataFromDataRows } from './chart-wizard/get-wizard-data-from-data-rows';
2
+ import { ActionTypes, createInitialState, createState, fontNames, fontSizes, isCategorical, mergeStates, parseFont, updateState } from './chart-wizard/state';
3
+ import {
4
+ messages
5
+ } from './chart-wizard/messages';
6
+
7
+ export const ChartWizardCommon = Object.freeze({
8
+ getWizardDataFromDataRows,
9
+ ActionTypes,
10
+ createInitialState,
11
+ createState,
12
+ fontNames,
13
+ fontSizes,
14
+ isCategorical,
15
+ mergeStates,
16
+ parseFont,
17
+ updateState,
18
+ messages
19
+ });
@@ -9,6 +9,7 @@ export * from './qrcode';
9
9
  export * from './map';
10
10
  export * from './sankey';
11
11
  export * from './common';
12
+ export * from './chart-wizard';
12
13
 
13
14
  export { baseTheme as chartBaseTheme } from './chart/base-theme';
14
15
 
@@ -0,0 +1,313 @@
1
+ import { Margin } from './field-types/margin.interface';
2
+
3
+ /**
4
+ * Describes a single data cell for the Chart Wizard.
5
+ */
6
+ export interface ChartWizardDataCell {
7
+ /**
8
+ * The field name of the data cell.
9
+ */
10
+ field: string;
11
+
12
+ /**
13
+ * The value of the data cell.
14
+ */
15
+ value: any;
16
+ }
17
+
18
+ /**
19
+ * Describes a data row for the Chart Wizard.
20
+ */
21
+ export type ChartWizardDataRow = ChartWizardDataCell[];
22
+
23
+ /**
24
+ * Represents a data column from a grid component or similar.
25
+ */
26
+ export interface DataColumn {
27
+ field: string;
28
+ title: string;
29
+ }
30
+
31
+ /**
32
+ * Represents a data row from a grid component or similar.
33
+ */
34
+ export interface DataRow {
35
+ dataItem: any;
36
+ dataColumns: DataColumn[];
37
+ }
38
+
39
+ export type ChartWizardSeriesType = 'bar' | 'column' | 'line' | 'pie' | 'scatter';
40
+
41
+ interface FontInterface {
42
+ font?: string;
43
+ color?: string;
44
+ }
45
+
46
+ export interface ChartWizardTitle extends FontInterface {
47
+ text?: string;
48
+ }
49
+
50
+ export interface ChartWizardSeriesStack {
51
+ type?: 'normal' | '100%';
52
+ }
53
+
54
+ export interface ChartWizardArea {
55
+ background?: string;
56
+ margin?: Margin;
57
+ }
58
+
59
+ export interface ChartWizardAxisLabel extends FontInterface {
60
+ rotation?: number | 'auto';
61
+ format?: string;
62
+ }
63
+
64
+ interface ChartAxisItem {
65
+ title?: ChartWizardTitle;
66
+ labels?: ChartWizardAxisLabel;
67
+ reverse?: boolean;
68
+ }
69
+
70
+ export interface ChartWizardCategoryAxisItem extends ChartAxisItem {
71
+ categories?: any[];
72
+ }
73
+
74
+ export interface ChartWizardValueAxisItem extends ChartAxisItem { }
75
+
76
+ export interface ChartWizardLegend {
77
+ visible?: boolean;
78
+ position?: 'top' | 'bottom' | 'left' | 'right';
79
+ labels?: FontInterface;
80
+ }
81
+
82
+ /**
83
+ * @hidden
84
+ */
85
+ export interface ChartWizardSeriesItem {
86
+ id: number;
87
+ name?: string;
88
+ color?: string;
89
+ type?: ChartWizardSeriesType;
90
+ data?: any[];
91
+ stack?: ChartWizardSeriesStack | false;
92
+ labels?: {
93
+ visible?: boolean;
94
+ };
95
+ categoryField?: string;
96
+ field?: string;
97
+ width?: number;
98
+ }
99
+
100
+ /**
101
+ * @hidden
102
+ */
103
+ export interface ChartWizardState {
104
+ title?: ChartWizardTitle;
105
+ subtitle?: ChartWizardTitle;
106
+ area: ChartWizardArea;
107
+ categoryAxis: ChartWizardCategoryAxisItem[];
108
+ valueAxis: ChartWizardValueAxisItem[];
109
+ series: ChartWizardSeriesItem[];
110
+ initialSeries: ChartWizardSeriesItem[];
111
+ legend?: ChartWizardLegend;
112
+ columns: string[];
113
+ data: ChartWizardDataRow[];
114
+ /**
115
+ * The series type of the chart.
116
+ *
117
+ * The supported series types are:
118
+ * - `'column'`
119
+ * - `'bar'`
120
+ * - `'line'`
121
+ * - `'pie'`
122
+ * - `'scatter'`
123
+ */
124
+ seriesType?: ChartWizardSeriesType;
125
+ categoryField?: string;
126
+ valueField?: string;
127
+ /**
128
+ * The stack configuration of the series.
129
+ */
130
+ stack?: ChartWizardSeriesStack | false;
131
+ }
132
+
133
+ /**
134
+ * The default state of the ChartWizard component.
135
+ */
136
+ export interface ChartWizardDefaultState extends Pick<ChartWizardState, 'stack' | 'seriesType'> { }
137
+
138
+ declare enum ActionTypes {
139
+ seriesType = 0,
140
+ stacked = 1,
141
+ categoryAxisX = 2,
142
+ valueAxisY = 3,
143
+ seriesChange = 4,
144
+ areaMarginLeft = 5,
145
+ areaMarginRight = 6,
146
+ areaMarginTop = 7,
147
+ areaMarginBottom = 8,
148
+ areaBackground = 9,
149
+ titleText = 10,
150
+ titleFontName = 11,
151
+ titleFontSize = 12,
152
+ titleColor = 13,
153
+ subtitleText = 14,
154
+ subtitleFontName = 15,
155
+ subtitleFontSize = 16,
156
+ subtitleColor = 17,
157
+ seriesColor = 18,
158
+ seriesLabel = 19,
159
+ legendVisible = 20,
160
+ legendFontName = 21,
161
+ legendFontSize = 22,
162
+ legendColor = 23,
163
+ legendPosition = 24,
164
+ categoryAxisTitleText = 25,
165
+ categoryAxisTitleFontName = 26,
166
+ categoryAxisTitleFontSize = 27,
167
+ categoryAxisTitleColor = 28,
168
+ categoryAxisLabelsFontName = 29,
169
+ categoryAxisLabelsFontSize = 30,
170
+ categoryAxisLabelsColor = 31,
171
+ categoryAxisLabelsRotation = 32,
172
+ categoryAxisReverseOrder = 33,
173
+ valueAxisTitleText = 34,
174
+ valueAxisTitleFontName = 35,
175
+ valueAxisTitleFontSize = 36,
176
+ valueAxisTitleColor = 37,
177
+ valueAxisLabelsFormat = 38,
178
+ valueAxisLabelsFontName = 39,
179
+ valueAxisLabelsFontSize = 40,
180
+ valueAxisLabelsColor = 41,
181
+ valueAxisLabelsRotation = 42
182
+ }
183
+
184
+ declare const ChartWizardMessages: {
185
+ readonly windowTitle: string;
186
+ readonly exportButton: string;
187
+ readonly exportPDFButton: string;
188
+ readonly exportSVGButton: string;
189
+ readonly exportPNGButton: string;
190
+ readonly tabChart: string;
191
+ readonly tabData: string;
192
+ readonly tabFormat: string;
193
+ readonly barChart: string;
194
+ readonly barChartBar: string;
195
+ readonly barChartStackedBar: string;
196
+ readonly barChart100StackedBar: string;
197
+ readonly pieChart: string;
198
+ readonly pieChartPie: string;
199
+ readonly columnChart: string;
200
+ readonly columnChartColumn: string;
201
+ readonly columnChartStackedColumn: string;
202
+ readonly columnChart100StackedColumn: string;
203
+ readonly lineChart: string;
204
+ readonly lineChartLine: string;
205
+ readonly lineChartStackedLine: string;
206
+ readonly lineChart100StackedLine: string;
207
+ readonly scatterChart: string;
208
+ readonly scatterChartScatter: string;
209
+ readonly configuration: string;
210
+ readonly configurationCategoryAxis: string;
211
+ readonly configurationXAxis: string;
212
+ readonly configurationValueAxis: string;
213
+ readonly configurationSeries: string;
214
+ readonly configurationSeriesAdd: string;
215
+ readonly formatChartArea: string;
216
+ readonly formatChartAreaMargins: string;
217
+ readonly formatChartAreaMarginsAuto: string;
218
+ readonly formatChartAreaMarginsLeft: string;
219
+ readonly formatChartAreaMarginsRight: string;
220
+ readonly formatChartAreaMarginsTop: string;
221
+ readonly formatChartAreaMarginsBottom: string;
222
+ readonly formatChartAreaBackground: string;
223
+ readonly formatChartAreaBackgroundColor: string;
224
+ readonly formatTitle: string;
225
+ readonly formatTitleApplyTo: string;
226
+ readonly formatTitleChartTitle: string;
227
+ readonly formatTitleChartSubtitle: string;
228
+ readonly formatTitleLabel: string;
229
+ readonly formatTitleFont: string;
230
+ readonly formatTitleFontPlaceholder: string;
231
+ readonly formatTitleSize: string;
232
+ readonly formatTitleSizePlaceholder: string;
233
+ readonly formatTitleColor: string;
234
+ readonly formatSeries: string;
235
+ readonly formatSeriesApplyTo: string;
236
+ readonly formatSeriesAllSeries: string;
237
+ readonly formatSeriesColor: string;
238
+ readonly formatSeriesShowLabels: string;
239
+ readonly formatLegend: string;
240
+ readonly formatLegendShowLegend: string;
241
+ readonly formatLegendFont: string;
242
+ readonly formatLegendFontPlaceholder: string;
243
+ readonly formatLegendSize: string;
244
+ readonly formatLegendSizePlaceholder: string;
245
+ readonly formatLegendColor: string;
246
+ readonly formatLegendPosition: string;
247
+ readonly formatLegendPositionTop: string;
248
+ readonly formatLegendPositionBottom: string;
249
+ readonly formatLegendPositionLeft: string;
250
+ readonly formatLegendPositionRight: string;
251
+ readonly formatCategoryAxis: string;
252
+ readonly formatXAxis: string;
253
+ readonly formatCategoryAxisTitle: string;
254
+ readonly formatCategoryAxisTitlePlaceholder: string;
255
+ readonly formatCategoryAxisTitleFont: string;
256
+ readonly formatCategoryAxisTitleFontPlaceholder: string;
257
+ readonly formatCategoryAxisTitleSize: string;
258
+ readonly formatCategoryAxisTitleSizePlaceholder: string;
259
+ readonly formatCategoryAxisTitleColor: string;
260
+ readonly formatCategoryAxisLabels: string;
261
+ readonly formatCategoryAxisLabelsFont: string;
262
+ readonly formatCategoryAxisLabelsFontPlaceholder: string;
263
+ readonly formatCategoryAxisLabelsSize: string;
264
+ readonly formatCategoryAxisLabelsSizePlaceholder: string;
265
+ readonly formatCategoryAxisLabelsColor: string;
266
+ readonly formatCategoryAxisLabelsRotation: string;
267
+ readonly formatCategoryAxisLabelsRotationAuto: string;
268
+ readonly formatCategoryAxisLabelsReverseOrder: string;
269
+ readonly formatValueAxis: string;
270
+ readonly formatYAxis: string;
271
+ readonly formatValueAxisTitle: string;
272
+ readonly formatValueAxisTitlePlaceholder: string;
273
+ readonly formatValueAxisTitleFont: string;
274
+ readonly formatValueAxisTitleFontPlaceholder: string;
275
+ readonly formatValueAxisTitleSize: string;
276
+ readonly formatValueAxisTitleSizePlaceholder: string;
277
+ readonly formatValueAxisTitleColor: string;
278
+ readonly formatValueAxisLabels: string;
279
+ readonly formatValueAxisLabelsFormat: string;
280
+ readonly formatValueAxisLabelsFormatText: string;
281
+ readonly formatValueAxisLabelsFormatNumber: string;
282
+ readonly formatValueAxisLabelsFormatCurrency: string;
283
+ readonly formatValueAxisLabelsFormatPercent: string;
284
+ readonly formatValueAxisLabelsFont: string;
285
+ readonly formatValueAxisLabelsFontPlaceholder: string;
286
+ readonly formatValueAxisLabelsSize: string;
287
+ readonly formatValueAxisLabelsSizePlaceholder: string;
288
+ readonly formatValueAxisLabelsColor: string;
289
+ readonly formatValueAxisLabelsRotation: string;
290
+ readonly formatValueAxisLabelsRotationAuto: string;
291
+ }
292
+
293
+ export const ChartWizardCommon: Readonly<{
294
+ ActionTypes: typeof ActionTypes;
295
+ messages: typeof ChartWizardMessages;
296
+
297
+ fontSizes: { text: string; value: string }[];
298
+ fontNames: { text: string; value: string; style: { fontFamily: string }}[];
299
+
300
+ isCategorical(seriesType?: ChartWizardSeriesType): boolean;
301
+ parseFont(font?: string): { name: string; size: string };
302
+ createInitialState(data: ChartWizardDataRow[], seriesType: ChartWizardSeriesType, defaultState?: ChartWizardDefaultState): ChartWizardState;
303
+ createState(data: ChartWizardDataRow[], seriesType: ChartWizardSeriesType): ChartWizardState;
304
+ mergeStates(state: ChartWizardState, newState: ChartWizardState): ChartWizardState;
305
+ updateState(currentState: ChartWizardState, action: ActionTypes, value: any): ChartWizardState;
306
+
307
+ /**
308
+ * Maps data rows to the Chart Wizard data format.
309
+ *
310
+ * @returns collection that can be used as Chart Wizard.
311
+ */
312
+ getWizardDataFromDataRows(dataRows: DataRow[]): ChartWizardDataRow[];
313
+ }>;
@@ -11,5 +11,6 @@ export * from './sankey';
11
11
  export * from './common';
12
12
  export * from './field-types'
13
13
  export * from './validation';
14
+ export * from './chart-wizard';
14
15
 
15
16
  export function chartBaseTheme(): any;