survey-analytics 1.9.31 → 1.9.34

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.
@@ -1,174 +1,694 @@
1
- /*Type definitions for SurveyJS Analytics library v1.9.31
2
- Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
3
- Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
4
- */
5
- // Dependencies for this module:
6
- // ../../survey-core
7
- // ../../plotly.js-dist-min
8
-
9
- import { Event } from "survey-core";
10
- import { Question } from "survey-core";
11
- import { IQuestion } from "survey-core";
12
- import { QuestionMatrixDropdownModel } from "survey-core";
13
- import { ItemValue } from "survey-core";
14
- import { SurveyModel } from "survey-core";
15
- import Plotly from "plotly.js-dist-min";
16
- import { QuestionMatrixModel } from "survey-core";
17
- import { QuestionBooleanModel } from "survey-core";
18
-
19
- import "./localization/farsi";
20
- import "./localization/french";
21
- import "./localization/norwegian";
22
- import "./localization/portuguese";
23
- import "./localization/russian";
24
- import "./localization/dutch";
25
-
26
- export var localization: {
27
- currentLocaleValue: string;
28
- defaultLocaleValue: string;
29
- locales: {
30
- [index: string]: any;
1
+ declare module "localization/english" {
2
+ export var englishStrings: {
3
+ groupButton: string;
4
+ ungroupButton: string;
5
+ selectButton: string;
6
+ hideColumn: string;
7
+ showColumn: string;
8
+ makePrivateColumn: string;
9
+ makePublicColumn: string;
10
+ moveToDetail: string;
11
+ showAsColumn: string;
12
+ filterPlaceholder: string;
13
+ removeRows: string;
14
+ showLabel: string;
15
+ entriesLabel: string;
16
+ visualizer_text: string;
17
+ visualizer_wordcloud: string;
18
+ visualizer_histogram: string;
19
+ visualizer_number: string;
20
+ visualizer_choices: string;
21
+ visualizer_selectBase: string;
22
+ chartType_bar: string;
23
+ chartType_vbar: string;
24
+ chartType_stackedbar: string;
25
+ chartType_doughnut: string;
26
+ chartType_pie: string;
27
+ chartType_scatter: string;
28
+ chartType_gauge: string;
29
+ chartType_bullet: string;
30
+ hideButton: string;
31
+ makePrivateButton: string;
32
+ makePublicButton: string;
33
+ showButton: string;
34
+ filter: string;
35
+ resetFilter: string;
36
+ changeLocale: string;
37
+ en: string;
38
+ fr: string;
39
+ ru: string;
40
+ de: string;
41
+ clearButton: string;
42
+ addElement: string;
43
+ defaultOrder: string;
44
+ ascOrder: string;
45
+ descOrder: string;
46
+ showMinorColumns: string;
47
+ otherCommentTitle: string;
48
+ showPercentages: string;
49
+ hidePercentages: string;
50
+ pdfDownloadCaption: string;
51
+ xlsxDownloadCaption: string;
52
+ csvDownloadCaption: string;
53
+ saveDiagramAsPNG: string;
54
+ hideEmptyAnswers: string;
55
+ showEmptyAnswers: string;
56
+ "topNValueText-1": string;
57
+ topNValueText5: string;
58
+ topNValueText10: string;
59
+ topNValueText20: string;
60
+ hideMissingAnswers: string;
61
+ showMissingAnswers: string;
62
+ missingAnswersLabel: string;
63
+ noVisualizerForQuestion: string;
64
+ noResults: string;
65
+ showPerValues: string;
66
+ showPerColumns: string;
67
+ answer: string;
68
+ percent: string;
69
+ responses: string;
31
70
  };
32
- localeNames: {
33
- [index: string]: any;
71
+ }
72
+ declare module "localizationManager" {
73
+ export var localization: {
74
+ currentLocaleValue: string;
75
+ defaultLocaleValue: string;
76
+ locales: {
77
+ [index: string]: any;
78
+ };
79
+ localeNames: {
80
+ [index: string]: any;
81
+ };
82
+ supportedLocales: any[];
83
+ currentLocale: string;
84
+ defaultLocale: string;
85
+ getString: (strName: string) => any;
86
+ getLocales: () => Array<string>;
87
+ };
88
+ export var surveyStrings: {
89
+ groupButton: string;
90
+ ungroupButton: string;
91
+ selectButton: string;
92
+ hideColumn: string;
93
+ showColumn: string;
94
+ makePrivateColumn: string;
95
+ makePublicColumn: string;
96
+ moveToDetail: string;
97
+ showAsColumn: string;
98
+ filterPlaceholder: string;
99
+ removeRows: string;
100
+ showLabel: string;
101
+ entriesLabel: string;
102
+ visualizer_text: string;
103
+ visualizer_wordcloud: string;
104
+ visualizer_histogram: string;
105
+ visualizer_number: string;
106
+ visualizer_choices: string;
107
+ visualizer_selectBase: string;
108
+ chartType_bar: string;
109
+ chartType_vbar: string;
110
+ chartType_stackedbar: string;
111
+ chartType_doughnut: string;
112
+ chartType_pie: string;
113
+ chartType_scatter: string;
114
+ chartType_gauge: string;
115
+ chartType_bullet: string;
116
+ hideButton: string;
117
+ makePrivateButton: string;
118
+ makePublicButton: string;
119
+ showButton: string;
120
+ filter: string;
121
+ resetFilter: string;
122
+ changeLocale: string;
123
+ en: string;
124
+ fr: string;
125
+ ru: string;
126
+ de: string;
127
+ clearButton: string;
128
+ addElement: string;
129
+ defaultOrder: string;
130
+ ascOrder: string;
131
+ descOrder: string;
132
+ showMinorColumns: string;
133
+ otherCommentTitle: string;
134
+ showPercentages: string;
135
+ hidePercentages: string;
136
+ pdfDownloadCaption: string;
137
+ xlsxDownloadCaption: string;
138
+ csvDownloadCaption: string;
139
+ saveDiagramAsPNG: string;
140
+ hideEmptyAnswers: string;
141
+ showEmptyAnswers: string;
142
+ "topNValueText-1": string;
143
+ topNValueText5: string;
144
+ topNValueText10: string;
145
+ topNValueText20: string;
146
+ hideMissingAnswers: string;
147
+ showMissingAnswers: string;
148
+ missingAnswersLabel: string;
149
+ noVisualizerForQuestion: string;
150
+ noResults: string;
151
+ showPerValues: string;
152
+ showPerColumns: string;
153
+ answer: string;
154
+ percent: string;
155
+ responses: string;
156
+ };
157
+ }
158
+ declare module "localization/farsi" {
159
+ export var farsiStrings: {
160
+ groupButton: string;
161
+ ungroupButton: string;
162
+ selectButton: string;
163
+ hideColumn: string;
164
+ showColumn: string;
165
+ moveToDetail: string;
166
+ showAsColumn: string;
167
+ visualizer_text: string;
168
+ visualizer_wordcloud: string;
169
+ chartType_bar: string;
170
+ chartType_pie: string;
171
+ chartType_scatter: string;
172
+ chartType_gauge: string;
173
+ chartType_bullet: string;
174
+ hideButton: string;
175
+ resetFilter: string;
176
+ clearButton: string;
177
+ addElement: string;
178
+ };
179
+ }
180
+ declare module "localization/french" {
181
+ export var frenchStrings: {
182
+ groupButton: string;
183
+ ungroupButton: string;
184
+ selectButton: string;
185
+ hideColumn: string;
186
+ showColumn: string;
187
+ makePrivateColumn: string;
188
+ makePublicColumn: string;
189
+ moveToDetail: string;
190
+ showAsColumn: string;
191
+ visualizer_text: string;
192
+ visualizer_wordcloud: string;
193
+ chartType_bar: string;
194
+ chartType_stackedbar: string;
195
+ chartType_doughnut: string;
196
+ chartType_pie: string;
197
+ chartType_scatter: string;
198
+ chartType_gauge: string;
199
+ chartType_bullet: string;
200
+ filter: string;
201
+ hideButton: string;
202
+ resetFilter: string;
203
+ clearButton: string;
204
+ addElement: string;
205
+ defaultOrder: string;
206
+ ascOrder: string;
207
+ descOrder: string;
208
+ showMinorColumns: string;
209
+ otherCommentTitle: string;
210
+ noVisualizerForQuestion: string;
211
+ noResults: string;
212
+ };
213
+ }
214
+ declare module "localization/norwegian" {
215
+ export var norwegianStrings: {
216
+ groupButton: string;
217
+ ungroupButton: string;
218
+ selectButton: string;
219
+ hideColumn: string;
220
+ showColumn: string;
221
+ makePrivateColumn: string;
222
+ makePublicColumn: string;
223
+ moveToDetail: string;
224
+ showAsColumn: string;
225
+ filterPlaceholder: string;
226
+ removeRows: string;
227
+ showLabel: string;
228
+ entriesLabel: string;
229
+ visualizer_text: string;
230
+ visualizer_wordcloud: string;
231
+ chartType_bar: string;
232
+ chartType_stackedbar: string;
233
+ chartType_doughnut: string;
234
+ chartType_pie: string;
235
+ chartType_scatter: string;
236
+ chartType_gauge: string;
237
+ chartType_bullet: string;
238
+ hideButton: string;
239
+ makePrivateButton: string;
240
+ makePublicButton: string;
241
+ showButton: string;
242
+ resetFilter: string;
243
+ changeLocale: string;
244
+ clearButton: string;
245
+ addElement: string;
246
+ defaultOrder: string;
247
+ ascOrder: string;
248
+ descOrder: string;
249
+ showMinorColumns: string;
250
+ otherCommentTitle: string;
251
+ showPercentages: string;
252
+ hidePercentages: string;
253
+ };
254
+ }
255
+ declare module "localization/portuguese" {
256
+ export var portugueseStrings: {
257
+ groupButton: string;
258
+ ungroupButton: string;
259
+ selectButton: string;
260
+ hideColumn: string;
261
+ showColumn: string;
262
+ makePrivateColumn: string;
263
+ makePublicColumn: string;
264
+ moveToDetail: string;
265
+ showAsColumn: string;
266
+ filterPlaceholder: string;
267
+ removeRows: string;
268
+ showLabel: string;
269
+ entriesLabel: string;
270
+ visualizer_text: string;
271
+ chartType_bar: string;
272
+ chartType_stackedbar: string;
273
+ chartType_doughnut: string;
274
+ chartType_pie: string;
275
+ chartType_scatter: string;
276
+ chartType_gauge: string;
277
+ chartType_bullet: string;
278
+ hideButton: string;
279
+ makePrivateButton: string;
280
+ makePublicButton: string;
281
+ showButton: string;
282
+ filter: string;
283
+ resetFilter: string;
284
+ changeLocale: string;
285
+ clearButton: string;
286
+ addElement: string;
287
+ defaultOrder: string;
288
+ ascOrder: string;
289
+ descOrder: string;
290
+ showMinorColumns: string;
291
+ otherCommentTitle: string;
292
+ showPercentages: string;
293
+ hidePercentages: string;
294
+ saveDiagramAsPNG: string;
295
+ hideEmptyAnswers: string;
296
+ showEmptyAnswers: string;
297
+ "topNValueText-1": string;
298
+ topNValueText5: string;
299
+ topNValueText10: string;
300
+ topNValueText20: string;
301
+ noVisualizerForQuestion: string;
302
+ noResults: string;
303
+ };
304
+ }
305
+ declare module "localization/russian" {
306
+ export var russianStrings: {
307
+ groupButton: string;
308
+ ungroupButton: string;
309
+ selectButton: string;
310
+ hideColumn: string;
311
+ showColumn: string;
312
+ makePrivateColumn: string;
313
+ makePublicColumn: string;
314
+ moveToDetail: string;
315
+ filter: string;
316
+ showAsColumn: string;
317
+ visualizer_text: string;
318
+ visualizer_wordcloud: string;
319
+ chartType_bar: string;
320
+ chartType_stackedbar: string;
321
+ chartType_doughnut: string;
322
+ chartType_pie: string;
323
+ chartType_scatter: string;
324
+ chartType_gauge: string;
325
+ chartType_bullet: string;
326
+ hideButton: string;
327
+ showButton: string;
328
+ resetFilter: string;
329
+ changeLocale: string;
330
+ clearButton: string;
331
+ addElement: string;
332
+ defaultOrder: string;
333
+ ascOrder: string;
334
+ descOrder: string;
335
+ showMinorColumns: string;
336
+ otherCommentTitle: string;
337
+ noVisualizerForQuestion: string;
338
+ noResults: string;
339
+ };
340
+ }
341
+ declare module "localization/dutch" {
342
+ export var dutchStrings: {
343
+ groupButton: string;
344
+ ungroupButton: string;
345
+ selectButton: string;
346
+ hideColumn: string;
347
+ showColumn: string;
348
+ makePrivateColumn: string;
349
+ makePublicColumn: string;
350
+ moveToDetail: string;
351
+ showAsColumn: string;
352
+ filterPlaceholder: string;
353
+ removeRows: string;
354
+ showLabel: string;
355
+ entriesLabel: string;
356
+ visualizer_text: string;
357
+ visualizer_wordcloud: string;
358
+ chartType_bar: string;
359
+ chartType_stackedbar: string;
360
+ chartType_doughnut: string;
361
+ chartType_pie: string;
362
+ chartType_scatter: string;
363
+ chartType_gauge: string;
364
+ chartType_bullet: string;
365
+ hideButton: string;
366
+ makePrivateButton: string;
367
+ makePublicButton: string;
368
+ showButton: string;
369
+ resetFilter: string;
370
+ changeLocale: string;
371
+ clearButton: string;
372
+ addElement: string;
373
+ defaultOrder: string;
374
+ ascOrder: string;
375
+ descOrder: string;
376
+ showMinorColumns: string;
377
+ otherCommentTitle: string;
378
+ showPercentages: string;
379
+ hidePercentages: string;
380
+ pdfDownloadCaption: string;
381
+ xlsxDownloadCaption: string;
382
+ csvDownloadCaption: string;
383
+ saveDiagramAsPNG: string;
384
+ hideEmptyAnswers: string;
385
+ showEmptyAnswers: string;
386
+ "topNValueText-1": string;
387
+ topNValueText5: string;
388
+ topNValueText10: string;
389
+ topNValueText20: string;
390
+ };
391
+ }
392
+ declare module "localization/spanish" {
393
+ export var spanishStrings: {
394
+ ungroupButton: string;
395
+ selectButton: string;
396
+ hideColumn: string;
397
+ showColumn: string;
398
+ makePrivateColumn: string;
399
+ makePublicColumn: string;
400
+ moveToDetail: string;
401
+ showAsColumn: string;
402
+ filterPlaceholder: string;
403
+ removeRows: string;
404
+ showLabel: string;
405
+ entryLabel: string;
406
+ visualizer_text: string;
407
+ visualizer_wordcloud: string;
408
+ chartType_bar: string;
409
+ chartType_stackedbar: string;
410
+ chartType_doughnut: string;
411
+ chartType_pie: string;
412
+ chartType_scatter: string;
413
+ chartType_gauge: string;
414
+ chartType_bullet: string;
415
+ hideButton: string;
416
+ makePrivateButton: string;
417
+ makePublicButton: string;
418
+ showButton: string;
419
+ filter: string;
420
+ resetFilter: string;
421
+ changeLocale: string;
422
+ clearButton: string;
423
+ addElement: string;
424
+ defaultOrder: string;
425
+ ascOrder: string;
426
+ descOrder: string;
427
+ showMinorColumns: string;
428
+ otherCommentTitle: string;
429
+ showPercentages: string;
430
+ hidePercentages: string;
431
+ pdfDownloadCaption: string;
432
+ xlsxDownloadCaption: string;
433
+ csvDownloadCaption: string;
434
+ saveDiagramAsPNG: string;
435
+ hideEmptyAnswers: string;
436
+ showEmptyAnswers: string;
437
+ "topNValueText-1": string;
438
+ topNValueText5: string;
439
+ topNValueText10: string;
440
+ topNValueText20: string;
441
+ noVisualizerForQuestion: string;
442
+ noResults: string;
443
+ };
444
+ }
445
+ declare module "localization/italian" {
446
+ export var italianStrings: {
447
+ groupButton: string;
448
+ ungroupButton: string;
449
+ selectButton: string;
450
+ hideColumn: string;
451
+ showColumn: string;
452
+ makePrivateColumn: string;
453
+ makePublicColumn: string;
454
+ moveToDetail: string;
455
+ showAsColumn: string;
456
+ filterPlaceholder: string;
457
+ removeRows: string;
458
+ showLabel: string;
459
+ entriesLabel: string;
460
+ visualizer_text: string;
461
+ visualizer_wordcloud: string;
462
+ visualizer_histogram: string;
463
+ visualizer_number: string;
464
+ visualizer_choices: string;
465
+ visualizer_selectBase: string;
466
+ chartType_bar: string;
467
+ chartType_vbar: string;
468
+ chartType_stackedbar: string;
469
+ chartType_doughnut: string;
470
+ chartType_pie: string;
471
+ chartType_scatter: string;
472
+ chartType_gauge: string;
473
+ chartType_bullet: string;
474
+ hideButton: string;
475
+ makePrivateButton: string;
476
+ makePublicButton: string;
477
+ showButton: string;
478
+ filter: string;
479
+ resetFilter: string;
480
+ changeLocale: string;
481
+ en: string;
482
+ fr: string;
483
+ ru: string;
484
+ de: string;
485
+ clearButton: string;
486
+ addElement: string;
487
+ defaultOrder: string;
488
+ ascOrder: string;
489
+ descOrder: string;
490
+ showMinorColumns: string;
491
+ otherCommentTitle: string;
492
+ showPercentages: string;
493
+ hidePercentages: string;
494
+ pdfDownloadCaption: string;
495
+ xlsxDownloadCaption: string;
496
+ csvDownloadCaption: string;
497
+ saveDiagramAsPNG: string;
498
+ hideEmptyAnswers: string;
499
+ showEmptyAnswers: string;
500
+ "topNValueText-1": string;
501
+ topNValueText5: string;
502
+ topNValueText10: string;
503
+ topNValueText20: string;
504
+ hideMissingAnswers: string;
505
+ showMissingAnswers: string;
506
+ missingAnswersLabel: string;
507
+ noVisualizerForQuestion: string;
508
+ noResults: string;
509
+ showPerValues: string;
510
+ showPerColumns: string;
511
+ answer: string;
512
+ percent: string;
513
+ responses: string;
34
514
  };
35
- supportedLocales: any[];
36
- currentLocale: string;
37
- defaultLocale: string;
38
- getString: (strName: string) => any;
39
- getLocales: () => Array<string>;
40
- };
41
- export var surveyStrings: {
42
- groupButton: string;
43
- ungroupButton: string;
44
- selectButton: string;
45
- hideColumn: string;
46
- showColumn: string;
47
- makePrivateColumn: string;
48
- makePublicColumn: string;
49
- moveToDetail: string;
50
- showAsColumn: string;
51
- filterPlaceholder: string;
52
- removeRows: string;
53
- showLabel: string;
54
- entriesLabel: string;
55
- visualizer_text: string;
56
- visualizer_wordcloud: string;
57
- visualizer_histogram: string;
58
- visualizer_number: string;
59
- visualizer_choices: string;
60
- visualizer_selectBase: string;
61
- chartType_bar: string;
62
- chartType_vbar: string;
63
- chartType_stackedbar: string;
64
- chartType_doughnut: string;
65
- chartType_pie: string;
66
- chartType_scatter: string;
67
- chartType_gauge: string;
68
- chartType_bullet: string;
69
- hideButton: string;
70
- makePrivateButton: string;
71
- makePublicButton: string;
72
- showButton: string;
73
- filter: string;
74
- resetFilter: string;
75
- changeLocale: string;
76
- clearButton: string;
77
- addElement: string;
78
- defaultOrder: string;
79
- ascOrder: string;
80
- descOrder: string;
81
- showMinorColumns: string;
82
- otherCommentTitle: string;
83
- showPercentages: string;
84
- hidePercentages: string;
85
- pdfDownloadCaption: string;
86
- xlsxDownloadCaption: string;
87
- csvDownloadCaption: string;
88
- saveDiagramAsPNG: string;
89
- hideEmptyAnswers: string;
90
- showEmptyAnswers: string;
91
- "topNValueText-1": string;
92
- topNValueText5: string;
93
- topNValueText10: string;
94
- topNValueText20: string;
95
- hideMissingAnswers: string;
96
- showMissingAnswers: string;
97
- missingAnswersLabel: string;
98
- noVisualizerForQuestion: string;
99
- noResults: string;
100
- showPerValues: string;
101
- showPerColumns: string;
102
- answer: string;
103
- percent: string;
104
- responses: string;
105
- };
106
-
107
- /**
108
- * Describes data info:
109
- * dataName - question name, used as a key to obtain question data
110
- * getValues - function returning an array of all possible values
111
- * getLabels - function returning an array of human-friendly descriptions for values
112
- * getSeriesValues - function returning an array of all possible series values
113
- * getSeriesLabels - function returning an array of human-friendly descriptions for series values
114
- */
115
- export interface IDataInfo {
515
+ }
516
+ declare module "dataProvider" {
517
+ import { Event } from "survey-core";
518
+ /**
519
+ * Describes data info:
520
+ * dataName - question name, used as a key to obtain question data
521
+ * getValues - function returning an array of all possible values
522
+ * getLabels - function returning an array of human-friendly descriptions for values
523
+ * getSeriesValues - function returning an array of all possible series values
524
+ * getSeriesLabels - function returning an array of human-friendly descriptions for series values
525
+ */
526
+ export interface IDataInfo {
116
527
  dataName: string | Array<string>;
117
528
  getValues(): Array<any>;
118
529
  getLabels(): Array<string>;
119
530
  getSeriesValues(): Array<string>;
120
531
  getSeriesLabels(): Array<string>;
121
- }
122
- export class DataProvider {
532
+ }
533
+ export class DataProvider {
534
+ private _data;
535
+ private _getDataCore;
123
536
  static seriesMarkerKey: string;
537
+ private _filteredData;
538
+ private _statisticsCache;
124
539
  protected filterValues: {
125
- [index: string]: any;
540
+ [index: string]: any;
126
541
  };
542
+ private getStatisticsCacheKey;
127
543
  constructor(_data?: Array<any>, _getDataCore?: (dataInfo: IDataInfo) => number[][]);
128
544
  reset(dataInfo?: IDataInfo): void;
129
545
  get data(): Array<any>;
130
546
  set data(data: Array<any>);
131
547
  get filteredData(): {
132
- [index: string]: any;
548
+ [index: string]: any;
133
549
  }[];
134
550
  /**
135
- * Sets filter by question name and value.
136
- */
551
+ * Sets filter by question name and value.
552
+ */
137
553
  setFilter(questionName: string, selectedValue: any): void;
138
554
  protected getDataCore(dataInfo: IDataInfo): number[][] | number[][][];
139
555
  /**
140
- * Returns calculated statisctics for the IDataInfo object.
141
- */
556
+ * Returns calculated statisctics for the IDataInfo object.
557
+ */
142
558
  getData(dataInfo: IDataInfo): any[];
143
559
  /**
144
- * Fires when data has been changed.
145
- */
560
+ * Fires when data has been changed.
561
+ */
146
562
  onDataChanged: Event<(sender: DataProvider, options: any) => any, any>;
147
563
  protected raiseDataChanged(): void;
564
+ }
565
+ }
566
+ declare module "visualizationManager" {
567
+ import { Question } from "survey-core";
568
+ type VisualizerConstructor = new (question: Question, data: Array<{
569
+ [index: string]: any;
570
+ }>, options?: Object) => any;
571
+ /**
572
+ * Visualizers repository. You need to register a visualizer, link it to the question type name in order to visualize the question answers with the certain representation.
573
+ */
574
+ export class VisualizationManager {
575
+ static alternativesVisualizer: any;
576
+ static vizualizers: {
577
+ [index: string]: Array<VisualizerConstructor>;
578
+ };
579
+ /**
580
+ * Register visualizer (constructor) for question type.
581
+ */
582
+ static registerVisualizer(typeName: string, constructor: VisualizerConstructor): void;
583
+ /**
584
+ * Unregister visualizer (constructor) for question type.
585
+ */
586
+ static unregisterVisualizer(typeName: string, constructor: VisualizerConstructor): void;
587
+ /**
588
+ * Unregister visualizer (constructor) for all question types.
589
+ */
590
+ static unregisterVisualizerForAll(constructor: VisualizerConstructor): void;
591
+ /**
592
+ * Get visualizers (constructors) for question type.
593
+ */
594
+ static getVisualizersByType(typeName: string): VisualizerConstructor[];
595
+ /**
596
+ * Get visualizers (constructors) for question type.
597
+ */
598
+ static getAlternativesVisualizer(): any;
599
+ /**
600
+ * Register visualizer (constructor) for question type.
601
+ */
602
+ static registerAlternativesVisualizer(constructor: any): void;
603
+ }
148
604
  }
149
-
150
- import "./visualizerBase.scss";
151
- /**
152
- * VisualizerBase is a base object for all visuzlizers. It responsible for the rendering and destroying visualizer.
153
- *
154
- * constructor parameters:
155
- * question - a survey question to visualize,
156
- * data - an array of answers in format of survey result,
157
- * options - object with the following options,
158
- * name - visualizer name
159
- *
160
- * options:
161
- * seriesValues - an array of series values in data to group data by series,
162
- * seriesLabels - labels for series to display, if not passed the seriesValues are used as labels,
163
- * survey - pass survey instance to use localses from the survey JSON,
164
- * dataProvider - dataProvider for this visualizer,
165
- *
166
- */
167
- export class VisualizerBase implements IDataInfo {
605
+ declare module "visualizerFactory" {
606
+ import { Question } from "survey-core";
607
+ import { VisualizerBase } from "visualizerBase";
608
+ /**
609
+ * Visualizers factory. Creates visualizer for the given question.
610
+ */
611
+ export class VisualizerFactory {
612
+ /**
613
+ * Create visualizer by question. You can pass data and options to the created visualizer as well.
614
+ * If more then one visualizer are registered for the question, then they are combined using wrapper for showing alternative viaualizers.
615
+ */
616
+ static createVisualizer(question: Question, data: Array<{
617
+ [index: string]: any;
618
+ }>, options?: {
619
+ [index: string]: any;
620
+ }): VisualizerBase;
621
+ }
622
+ }
623
+ declare module "utils/index" {
624
+ export class DocumentHelper {
625
+ static createSelector(options: Array<{
626
+ value: string;
627
+ text: string;
628
+ }>, isSelected: (option: {
629
+ value: string;
630
+ text: string;
631
+ }) => boolean, handler: (e: any) => void): HTMLDivElement;
632
+ static createButton(handler: (e: any) => void, text?: string, className?: string): HTMLElement;
633
+ static createElement(tagName: string, className?: string, attrs?: any): HTMLElement;
634
+ static createSvgElement(path: string): SVGSVGElement;
635
+ static createSvgButton(path: string): HTMLButtonElement;
636
+ static createSvgToggleButton(svgPath1: string, svPpath2: string, text1: string, text2: string, handler1: (e: any) => any, handler2: (e: any) => any, state?: string, className?: string): HTMLElement;
637
+ static createInput(className: string, placeholder?: string, defaultValue?: string): HTMLInputElement;
638
+ }
639
+ export var options: {
640
+ runningInBrowser: boolean;
641
+ };
642
+ export function allowDomRendering(): boolean;
643
+ export function createCommercialLicenseLink(): HTMLElement;
644
+ export class DataHelper {
645
+ static zipArrays(...arrays: any[]): any[][];
646
+ static unzipArrays(zipArray: any[][]): any[][];
647
+ static sortDictionary(keys: any[], values: any[], desc: boolean): {
648
+ keys: any[];
649
+ values: any[];
650
+ };
651
+ static toPercentage(value: number, maxValue: number): number;
652
+ }
653
+ export function createLinksContainer(links: Array<{
654
+ name: string;
655
+ content: any;
656
+ }>): HTMLElement;
657
+ export function createImagesContainer(links: Array<{
658
+ name: string;
659
+ content: any;
660
+ }>): HTMLElement;
661
+ }
662
+ declare module "visualizerBase" {
663
+ import { Question } from "survey-core";
664
+ import { IDataInfo, DataProvider } from "dataProvider";
665
+ import { Event } from "survey-core";
666
+ import "./visualizerBase.scss";
667
+ /**
668
+ * VisualizerBase is a base object for all visuzlizers. It responsible for the rendering and destroying visualizer.
669
+ *
670
+ * constructor parameters:
671
+ * question - a survey question to visualize,
672
+ * data - an array of answers in format of survey result,
673
+ * options - object with the following options,
674
+ * name - visualizer name
675
+ *
676
+ * options:
677
+ * seriesValues - an array of series values in data to group data by series,
678
+ * seriesLabels - labels for series to display, if not passed the seriesValues are used as labels,
679
+ * survey - pass survey instance to use localses from the survey JSON,
680
+ * dataProvider - dataProvider for this visualizer,
681
+ *
682
+ */
683
+ export class VisualizerBase implements IDataInfo {
168
684
  question: Question;
169
685
  options: {
170
- [index: string]: any;
686
+ [index: string]: any;
171
687
  };
688
+ private _name?;
689
+ private _showHeader;
690
+ private _footerVisualizer;
691
+ private _dataProvider;
172
692
  protected labelTruncateLength: number;
173
693
  protected renderResult: HTMLElement;
174
694
  protected toolbarContainer: HTMLElement;
@@ -177,216 +697,627 @@ export class VisualizerBase implements IDataInfo {
177
697
  protected _supportSelection: boolean;
178
698
  static otherCommentCollapsed: boolean;
179
699
  /**
180
- * The event is fired right after a visualizer's content is rendered in DOM.
181
- **/
700
+ * The event is fired right after a visualizer's content is rendered in DOM.
701
+ **/
182
702
  onAfterRender: Event<(sender: VisualizerBase, options: any) => any, any>;
183
703
  protected afterRender(contentContainer: HTMLElement): void;
184
704
  protected toolbarItemCreators: {
185
- [name: string]: (toolbar?: HTMLDivElement) => HTMLElement;
705
+ [name: string]: (toolbar?: HTMLDivElement) => HTMLElement;
186
706
  };
187
707
  constructor(question: Question, data: Array<{
188
- [index: string]: any;
708
+ [index: string]: any;
189
709
  }>, options?: {
190
- [index: string]: any;
710
+ [index: string]: any;
191
711
  }, _name?: string);
192
712
  protected get questionOptions(): any;
193
713
  /**
194
- * This method is called then data has been changed for some reason, e.g. filter was set.
195
- * This method should be overriden if descendant computes own statistics or process data somehow.
196
- */
714
+ * This method is called then data has been changed for some reason, e.g. filter was set.
715
+ * This method should be overriden if descendant computes own statistics or process data somehow.
716
+ */
197
717
  protected onDataChanged(): void;
198
718
  /**
199
- * Name of the data field of data object from the data array.
200
- */
719
+ * Name of the data field of data object from the data array.
720
+ */
201
721
  get dataName(): string | Array<string>;
202
722
  /**
203
- * Indicates whether visualizer has footer. Usually it is true then a question has comment or choices question has other item.
204
- */
723
+ * Indicates whether visualizer has footer. Usually it is true then a question has comment or choices question has other item.
724
+ */
205
725
  get hasFooter(): boolean;
206
726
  protected createVisualizer(question: Question): VisualizerBase;
207
727
  /**
208
- * Footer visualizer getter.
209
- */
728
+ * Footer visualizer getter.
729
+ */
210
730
  get footerVisualizer(): VisualizerBase;
211
731
  /**
212
- * Indicates whether visualizer supports selection. Visualizers of questions with choices allow to select choice by clicking on the diagram bar and filter other data for the selected item.
213
- */
732
+ * Indicates whether visualizer supports selection. Visualizers of questions with choices allow to select choice by clicking on the diagram bar and filter other data for the selected item.
733
+ */
214
734
  get supportSelection(): boolean;
215
735
  /**
216
- * Series values getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
217
- */
736
+ * Series values getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
737
+ */
218
738
  getSeriesValues(): Array<string>;
219
739
  /**
220
- * Series labels getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
221
- */
740
+ * Series labels getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
741
+ */
222
742
  getSeriesLabels(): Array<string>;
223
743
  /**
224
- * Available values of question answers (available choices).
225
- */
744
+ * Available values of question answers (available choices).
745
+ */
226
746
  getValues(): Array<any>;
227
747
  /**
228
- * Available labels of question answers (human readable representation of available choices).
229
- */
748
+ * Available labels of question answers (human readable representation of available choices).
749
+ */
230
750
  getLabels(): Array<string>;
231
751
  /**
232
- * Registers creator of visualizer toolbar item.
233
- */
752
+ * Registers creator of visualizer toolbar item.
753
+ */
234
754
  registerToolbarItem(name: string, creator: (toolbar?: HTMLDivElement) => HTMLElement): void;
235
755
  /**
236
- * The name of the visaulizer.
237
- */
756
+ * The name of the visaulizer.
757
+ */
238
758
  get name(): string;
239
759
  /**
240
- * The actual data of the visaulizer.
241
- */
760
+ * The actual data of the visaulizer.
761
+ */
242
762
  protected get data(): {
243
- [index: string]: any;
763
+ [index: string]: any;
244
764
  }[];
245
765
  /**
246
- * The data provider is used by the visaulizer.
247
- */
766
+ * The data provider is used by the visaulizer.
767
+ */
248
768
  protected get dataProvider(): DataProvider;
249
769
  /**
250
- * Updates visualizer data.
251
- */
770
+ * Updates visualizer data.
771
+ */
252
772
  updateData(data: Array<{
253
- [index: string]: any;
773
+ [index: string]: any;
254
774
  }>): void;
255
775
  onUpdate: () => void;
256
776
  invokeOnUpdate(): void;
257
777
  /**
258
- * Destroys visualizer.
259
- */
778
+ * Destroys visualizer.
779
+ */
260
780
  destroy(): void;
261
781
  /**
262
- * Method for clearing all rendered elements from outside.
263
- */
782
+ * Method for clearing all rendered elements from outside.
783
+ */
264
784
  clear(): void;
265
785
  protected createToolbarItems(toolbar: HTMLDivElement): void;
266
786
  /**
267
- * Destroys visualizer toolbar.
268
- */
787
+ * Destroys visualizer toolbar.
788
+ */
269
789
  protected destroyToolbar(container: HTMLElement): void;
270
790
  /**
271
- * Renderss visualizer toolbar.
272
- */
791
+ * Renderss visualizer toolbar.
792
+ */
273
793
  protected renderToolbar(container: HTMLElement): void;
274
794
  /**
275
- * Destroys visualizer content.
276
- * Usually overriden in descendants.
277
- */
795
+ * Destroys visualizer content.
796
+ * Usually overriden in descendants.
797
+ */
278
798
  protected destroyContent(container: HTMLElement): void;
279
799
  /**
280
- * Renders visualizer content.
281
- * Usually overriden in descendants.
282
- */
800
+ * Renders visualizer content.
801
+ * Usually overriden in descendants.
802
+ */
283
803
  protected renderContent(container: HTMLElement): void;
284
804
  /**
285
- * Destroys visualizer footer.
286
- */
805
+ * Destroys visualizer footer.
806
+ */
287
807
  protected destroyFooter(container: HTMLElement): void;
288
808
  /**
289
- * Renders visualizer footer.
290
- */
809
+ * Renders visualizer footer.
810
+ */
291
811
  protected renderFooter(container: HTMLElement): void;
292
812
  /**
293
- * Renders visualizer in the given container.
294
- */
295
- render(targetElement: HTMLElement): void;
813
+ * Renders visualizer in the given container.
814
+ */
815
+ render(targetElement: HTMLElement | string): void;
296
816
  /**
297
- * Redraws visualizer and all inner content.
298
- */
817
+ * Redraws visualizer and all inner content.
818
+ */
299
819
  refresh(): void;
300
820
  protected processText(text: string): string;
301
821
  getRandomColor(): any;
822
+ private _backgroundColor;
302
823
  get backgroundColor(): string;
303
824
  set backgroundColor(value: string);
304
825
  protected getBackgroundColorCore(): string;
305
826
  protected setBackgroundColorCore(color: string): void;
306
827
  static customColors: string[];
828
+ private static colors;
307
829
  getColors(count?: number): any;
308
830
  get showHeader(): boolean;
309
831
  set showHeader(newValue: boolean);
310
832
  /**
311
- * Returns data to be used in the visualizer.
312
- */
833
+ * Returns data to be used in the visualizer.
834
+ */
313
835
  getData(): any;
314
836
  getState(): any;
315
837
  setState(state: any): void;
838
+ }
316
839
  }
317
-
318
- type VisualizerConstructor = new (question: Question, data: Array<{
319
- [index: string]: any;
320
- }>, options?: Object) => any;
321
- /**
322
- * Visualizers repository. You need to register a visualizer, link it to the question type name in order to visualize the question answers with the certain representation.
323
- */
324
- export class VisualizationManager {
325
- static alternativesVisualizer: any;
326
- static vizualizers: {
327
- [index: string]: Array<VisualizerConstructor>;
328
- };
329
- /**
330
- * Register visualizer (constructor) for question type.
331
- */
332
- static registerVisualizer(typeName: string, constructor: VisualizerConstructor): void;
333
- /**
334
- * Unregister visualizer (constructor) for question type.
335
- */
336
- static unregisterVisualizer(typeName: string, constructor: VisualizerConstructor): void;
337
- /**
338
- * Unregister visualizer (constructor) for all question types.
339
- */
340
- static unregisterVisualizerForAll(constructor: VisualizerConstructor): void;
341
- /**
342
- * Get visualizers (constructors) for question type.
343
- */
344
- static getVisualizersByType(typeName: string): VisualizerConstructor[];
840
+ declare module "number" {
841
+ import { Question } from "survey-core";
842
+ import { VisualizerBase } from "visualizerBase";
843
+ export class NumberModel extends VisualizerBase {
844
+ private _resultAverage;
845
+ private _resultMin;
846
+ private _resultMax;
847
+ static stepsCount: number;
848
+ static generateTextsCallback: (question: Question, maxValue: number, minValue: number, stepsCount: number, texts: string[]) => string[];
849
+ protected chartTypes: Array<string>;
850
+ chartType: String;
851
+ static showAsPercentage: boolean;
852
+ constructor(question: Question, data: Array<{
853
+ [index: string]: any;
854
+ }>, options?: {
855
+ [index: string]: any;
856
+ }, name?: string);
857
+ protected onDataChanged(): void;
858
+ protected onChartTypeChanged(): void;
859
+ protected setChartType(chartType: string): void;
860
+ destroy(): void;
861
+ generateText(maxValue: number, minValue: number, stepsCount: number): any;
862
+ generateValues(maxValue: number, stepsCount: number): any[];
863
+ generateColors(maxValue: number, minValue: number, stepsCount: number): any[];
864
+ getData(): number[];
865
+ }
866
+ }
867
+ declare module "selectBase" {
868
+ import { Question, ItemValue, Event } from "survey-core";
869
+ import { VisualizerBase } from "visualizerBase";
870
+ export interface IVisualizerWithSelection {
871
+ selection: ItemValue;
872
+ onDataItemSelected: (selectedValue: any, selectedText: string) => void;
873
+ setSelection(item: ItemValue): void;
874
+ }
875
+ export interface IAnswersData {
876
+ datasets: Array<Array<any>>;
877
+ labels: Array<string>;
878
+ colors: Array<string>;
879
+ texts: Array<Array<any>>;
880
+ seriesLabels: Array<string>;
881
+ }
882
+ export class SelectBase extends VisualizerBase implements IVisualizerWithSelection {
883
+ protected selectedItem: ItemValue;
884
+ private choicesOrderSelector;
885
+ private showPercentageBtn;
886
+ private emptyAnswersBtn;
887
+ private transposeDataBtn;
888
+ private topNSelector;
889
+ private _showPercentages;
890
+ private _showOnlyPercentages;
891
+ private _percentagePrecision;
892
+ protected _answersOrder: string;
893
+ protected _supportSelection: boolean;
894
+ private _hideEmptyAnswers;
895
+ private _topN;
896
+ static topNValuesDefaults: number[];
897
+ topNValues: any[];
898
+ private _transposeData;
899
+ private _showMissingAnswers;
900
+ private missingAnswersBtn;
901
+ constructor(question: Question, data: Array<{
902
+ [index: string]: any;
903
+ }>, options?: any, name?: string);
904
+ protected chartTypes: string[];
905
+ chartType: string;
906
+ private updateEmptyAnswersBtn;
907
+ private updateTransposeDataBtn;
908
+ private updateOrderSelector;
909
+ private updateShowPercentageBtn;
910
+ private updateTopNSelector;
911
+ private updateMissingAnswersBtn;
912
+ protected onChartTypeChanged(): void;
913
+ protected setChartType(chartType: string): void;
914
+ getSelectedItemByText(itemText: string): any;
915
+ setSelection(item: ItemValue): void;
916
+ get selection(): ItemValue;
917
+ get showOnlyPercentages(): boolean;
918
+ set showOnlyPercentages(val: boolean);
919
+ get showPercentages(): boolean;
920
+ set showPercentages(val: boolean);
921
+ get answersOrder(): string;
922
+ set answersOrder(value: string);
923
+ get hideEmptyAnswers(): boolean;
924
+ set hideEmptyAnswers(value: boolean);
925
+ get transposeData(): boolean;
926
+ set transposeData(value: boolean);
927
+ get topN(): number;
928
+ set topN(value: number);
929
+ protected isSupportMissingAnswers(): boolean;
930
+ get showMissingAnswers(): boolean;
931
+ set showMissingAnswers(value: boolean);
932
+ refreshContent(): void;
933
+ onDataItemSelected: (selectedValue: any, selectedText: string) => void;
934
+ get showValuesInOriginalOrder(): boolean;
935
+ valuesSource(): Array<ItemValue>;
936
+ getValues(): Array<any>;
937
+ getLabels(): Array<string>;
938
+ getPercentages(): Array<Array<number>>;
939
+ protected hideEmptyAnswersInData(answersData: IAnswersData): IAnswersData;
940
+ protected answersDataReady(answersData: IAnswersData): any;
345
941
  /**
346
- * Get visualizers (constructors) for question type.
347
- */
348
- static getAlternativesVisualizer(): any;
942
+ * Fires when answer data has been combined before they passed to draw graph.
943
+ * options - the answers data object containing: datasets, labels, colors, additional texts (percentage).
944
+ * options fields can be modified
945
+ */
946
+ onAnswersDataReady: Event<(sender: SelectBase, options: any) => any, any>;
349
947
  /**
350
- * Register visualizer (constructor) for question type.
351
- */
352
- static registerAlternativesVisualizer(constructor: any): void;
948
+ * Returns object with all infotmation for data visualization: datasets, labels, colors, additional texts (percentage).
949
+ */
950
+ getAnswersData(): IAnswersData;
951
+ protected transpose(data: Array<Array<number>>): Array<Array<number>>;
952
+ private static _stateProperties;
953
+ getState(): any;
954
+ setState(state: any): void;
955
+ }
353
956
  }
354
- export {};
355
-
356
- import "./visualizationPanel.scss";
357
- export interface IVisualizerPanelRenderedElement extends IVisualizerPanelElement {
358
- renderedElement?: HTMLElement;
957
+ declare module "matrix" {
958
+ import { ItemValue, QuestionMatrixModel, Question } from "survey-core";
959
+ import { IAnswersData, SelectBase } from "selectBase";
960
+ export class Matrix extends SelectBase {
961
+ constructor(question: Question, data: Array<{
962
+ [index: string]: any;
963
+ }>, options?: Object, name?: string);
964
+ protected get matrixQuestion(): QuestionMatrixModel;
965
+ protected isSupportMissingAnswers(): boolean;
966
+ getSeriesValues(): Array<string>;
967
+ getSeriesLabels(): Array<string>;
968
+ getSelectedItemByText(itemText: string): any;
969
+ valuesSource(): Array<ItemValue>;
970
+ private getHasAnswersInAllSeriesArray;
971
+ private getHasAnswersInSeries;
972
+ protected hideEmptyAnswersInData(answersData: IAnswersData): IAnswersData;
973
+ getData(): any[];
974
+ }
975
+ }
976
+ declare module "boolean" {
977
+ import { Question, QuestionBooleanModel } from "survey-core";
978
+ import { ItemValue } from "survey-core";
979
+ import { SelectBase } from "selectBase";
980
+ export class BooleanModel extends SelectBase {
981
+ protected chartTypes: string[];
982
+ chartType: string;
983
+ constructor(question: Question, data: Array<{
984
+ [index: string]: any;
985
+ }>, options?: Object, name?: string);
986
+ get booleanQuestion(): QuestionBooleanModel;
987
+ static trueColor: string;
988
+ static falseColor: string;
989
+ getSelectedItemByText(itemText: string): ItemValue;
990
+ getValues(): Array<any>;
991
+ getLabels(): Array<string>;
992
+ }
993
+ }
994
+ declare module "histogram" {
995
+ import { ItemValue, Question } from "survey-core";
996
+ import { SelectBase } from "selectBase";
997
+ export class HistogramModel extends SelectBase {
998
+ protected valueType: "date" | "number";
999
+ private _cachedValues;
1000
+ private _continiousData;
1001
+ private _cachedIntervals;
1002
+ protected chartTypes: string[];
1003
+ chartType: string;
1004
+ static IntervalsCount: number;
1005
+ static UseIntervalsFrom: number;
1006
+ constructor(question: Question, data: Array<{
1007
+ [index: string]: any;
1008
+ }>, options?: Object, name?: string);
1009
+ private reset;
1010
+ getContiniousValue(value: any): number;
1011
+ getString(value: number): string;
1012
+ getSelectedItemByText(itemText: string): ItemValue;
1013
+ /**
1014
+ * Updates visualizer data.
1015
+ */
1016
+ updateData(data: Array<{
1017
+ [index: string]: any;
1018
+ }>): void;
1019
+ protected onDataChanged(): void;
1020
+ protected getContiniousValues(): {
1021
+ original: any;
1022
+ continious: number;
1023
+ }[];
1024
+ protected isSupportMissingAnswers(): boolean;
1025
+ getValues(): Array<any>;
1026
+ getLabels(): Array<string>;
1027
+ get hasCustomIntervals(): boolean;
1028
+ get intervals(): any;
1029
+ getData(): any;
1030
+ }
1031
+ }
1032
+ declare module "config" {
1033
+ export interface IVisualizerPanelElement {
1034
+ name: string;
1035
+ displayName: string;
1036
+ isVisible: boolean;
1037
+ isPublic: boolean;
1038
+ type?: string;
1039
+ chartType?: string;
1040
+ answersOrder?: string;
1041
+ hideEmptyAnswers?: boolean;
1042
+ topN?: number;
1043
+ }
1044
+ export interface IState {
1045
+ locale?: string;
1046
+ elements?: IVisualizerPanelElement[];
1047
+ }
1048
+ export interface IPermission {
1049
+ name: string;
1050
+ isPublic: boolean;
1051
+ }
359
1052
  }
360
- /**
361
- * VisualizationPanel is responsible for visualizing an array of survey questions
362
- *
363
- * constructor parameters:
364
- * questions - an array of survey questions to visualize,
365
- * data - an array of answers in format of survey result,
366
- * options - object with the following options,
367
- * elements - list of visual element descriptions
368
- *
369
- * options:
370
- * allowDynamicLayout - set it to false to disable items drag/drop reordering and dynamic layouting,
371
- * labelTruncateLength - the length of the label where the truncation starts. Set to -1 to disable truncate. Default is 27.
372
- * allowHideQuestions - set it to false to deny user to hide/show individual questions,
373
- * allowMakeQuestionsPrivate - set it to true to allow make elements private/public also see persmissions property,
374
- * seriesValues - an array of series values in data to group data by series,
375
- * seriesLabels - labels for series to display, if not passed the seriesValues are used as labels,
376
- * survey - pass survey instance to use localses from the survey JSON,
377
- * dataProvider - dataProvider for this visualizer,
378
- * layoutEngine - layout engine to be used for layouting inner visualizers
379
- *
380
- */
381
- export class VisualizationPanel extends VisualizerBase {
1053
+ declare module "filterInfo" {
1054
+ import { IVisualizerWithSelection } from "selectBase";
1055
+ export class FilterInfo {
1056
+ private _htmlElement;
1057
+ private text;
1058
+ constructor(visualizer: IVisualizerWithSelection);
1059
+ get htmlElement(): HTMLDivElement;
1060
+ update(selection: {
1061
+ value: any;
1062
+ text: string;
1063
+ }): void;
1064
+ }
1065
+ }
1066
+ declare module "layoutEngine" {
1067
+ export class LayoutEngine {
1068
+ protected _allowed: boolean;
1069
+ constructor(_allowed: boolean);
1070
+ protected startCore(container: HTMLElement): void;
1071
+ protected stopCore(): void;
1072
+ protected updateCore(): void;
1073
+ get allowed(): boolean;
1074
+ start(container: HTMLElement): void;
1075
+ stop(): void;
1076
+ update(): void;
1077
+ add(elements: Array<HTMLElement>, options?: any): void;
1078
+ remove(elements: Array<HTMLElement>, options?: any): void;
1079
+ onMoveCallback: (fromIndex: number, toIndex: number) => void;
1080
+ destroy(): void;
1081
+ }
1082
+ export class MuuriLayoutEngine extends LayoutEngine {
1083
+ private _selector;
1084
+ private _muuri;
1085
+ private _layoutingTimer;
1086
+ constructor(allowed: boolean, _selector: string);
1087
+ protected startCore(container: HTMLElement): void;
1088
+ protected stopCore(): void;
1089
+ protected updateCore(): void;
1090
+ add(elements: Array<HTMLElement>, options?: any): void;
1091
+ remove(elements: Array<HTMLElement>, options?: any): void;
1092
+ }
1093
+ }
1094
+ declare module "visualizationPanel" {
1095
+ import { Event, SurveyModel } from "survey-core";
1096
+ import { VisualizerBase } from "visualizerBase";
1097
+ import { IVisualizerPanelElement, IState, IPermission } from "config";
1098
+ import { LayoutEngine } from "layoutEngine";
1099
+ import { DataProvider } from "dataProvider";
1100
+ import "./visualizationPanel.scss";
1101
+ export interface IVisualizerPanelRenderedElement extends IVisualizerPanelElement {
1102
+ renderedElement?: HTMLElement;
1103
+ }
1104
+ /**
1105
+ * Visualization Panel configuration. Pass it as the third argument to the `VisualizationPanel` constructor:
1106
+ *
1107
+ * ```js
1108
+ * const vizPanel = new SurveyAnalytics.VisualizationPanel(surveyQuestions, surveyResults, vizPanelOptions);
1109
+ * ```
1110
+ */
1111
+ export interface IVisualizationPanelOptions {
1112
+ /**
1113
+ * The number of label characters after which truncation starts.
1114
+ * Set this property to -1 to disable truncation.
1115
+ *
1116
+ * Default value: 27
1117
+ */
1118
+ labelTruncateLength?: number;
1119
+ allowMakeQuestionsPrivate?: boolean;
1120
+ seriesValues?: string[];
1121
+ seriesLabels?: string[];
1122
+ useValuesAsLabels?: boolean;
1123
+ /**
1124
+ * Pass a survey instance to use survey locales in the Visualization Panel.
1125
+ */
1126
+ survey?: SurveyModel;
1127
+ /**
1128
+ * A common data provider for all visualizers.
1129
+ */
1130
+ dataProvider?: DataProvider;
1131
+ /**
1132
+ * Allows users to change the visibility of individual charts.
1133
+ * This property adds a Hide button to each chart.
1134
+ *
1135
+ * Default value: `true`
1136
+ */
1137
+ allowHideQuestions?: boolean;
1138
+ /**
1139
+ * Specifies whether to arrange charts based on the available screen space and allow users to reorder them via drag and drop.
1140
+ * If this property is disabled, charts are displayed one under the other, and users cannot reorder them.
1141
+ *
1142
+ * Default value: `true`
1143
+ *
1144
+ * [View the "Disable the Layout Engine" example](https://surveyjs.io/Examples/Analytics?id=custom-layout)
1145
+ *
1146
+ * @see layoutEngine
1147
+ */
1148
+ allowDynamicLayout?: boolean;
1149
+ /**
1150
+ * A layout engine used to arrange charts on the Visualization Panel.
1151
+ * You can use this property to integrate a third-party layout engine with SurveyJS Analytics.
1152
+ *
1153
+ * @see allowDynamicLayout
1154
+ */
1155
+ layoutEngine?: LayoutEngine;
1156
+ /**
1157
+ * Allows users to switch between absolute and percentage values in bar charts.
1158
+ * This property adds a Show Percentages button to each bar chart.
1159
+ *
1160
+ * Default value: `false`
1161
+ *
1162
+ * @see showPercentages
1163
+ * @see showOnlyPercentages
1164
+ * @see percentagePrecision
1165
+ */
1166
+ allowShowPercentages?: boolean;
1167
+ /**
1168
+ * Specifies whether bar charts display percentages in addition to absolute values.
1169
+ * Users can change this property value if you enable the `allowShowPercentages` property.
1170
+ *
1171
+ * Default value: `false`
1172
+ *
1173
+ * @see allowShowPercentages
1174
+ * @see showOnlyPercentages
1175
+ * @see percentagePrecision
1176
+ */
1177
+ showPercentages?: boolean;
1178
+ /**
1179
+ * Specifies whether bar charts display only percentages, without absolute values.
1180
+ * Applies only if the `allowShowPercentages` or `showPercentages` property is enables.
1181
+ *
1182
+ * Default value: `false`
1183
+ *
1184
+ * @see allowShowPercentages
1185
+ * @see showPercentages
1186
+ * @see percentagePrecision
1187
+ */
1188
+ showOnlyPercentages?: boolean;
1189
+ /**
1190
+ * Specifies percentage precision.
1191
+ *
1192
+ * Default value: 0
1193
+ *
1194
+ * @see allowShowPercentages
1195
+ * @see showPercentages
1196
+ * @see showOnlyPercentages
1197
+ */
1198
+ percentagePrecision?: number;
1199
+ /**
1200
+ * Removes the Free Trial bar.
1201
+ * **IMPORTANT**: You can enable this property only if you have a SurveyJS Analytics commercial license. It is illegal to enable this property without a license.
1202
+ */
1203
+ haveCommercialLicense?: boolean;
1204
+ /**
1205
+ * Allows users to sort answers by answer count. Applies only to bar and scatter charts.
1206
+ * This property adds a Sorting dropdown to each bar and scatter chart.
1207
+ *
1208
+ * Default value: `true`
1209
+ *
1210
+ * @see answersOrder
1211
+ */
1212
+ allowChangeAnswersOrder?: boolean;
1213
+ /**
1214
+ * Specifies how to sort answers in bar and scatter charts.
1215
+ * Accepted values:
1216
+ *
1217
+ * - `"default"` (default) - Do not sort answers.
1218
+ * - `"asc"` - Sort answers by ascending answer count.
1219
+ * - `"desc"` - Sort answers by descending answer count.
1220
+ *
1221
+ * Users can change this property value if you enable the `allowChangeAnswersOrder` property.
1222
+ *
1223
+ * @see allowChangeAnswersOrder
1224
+ */
1225
+ answersOrder?: "default" | "asc" | "desc";
1226
+ /**
1227
+ * Allows users to hide answers with zero count in bar and scatter charts.
1228
+ * This property adds a Hide Empty Answers button to each bar and scatter chart.
1229
+ *
1230
+ * Default value: `false`
1231
+ */
1232
+ allowHideEmptyAnswers?: boolean;
1233
+ /**
1234
+ * Hides answers with zero count in bar and scatter charts.
1235
+ * Users can change this property value if you enable the `allowHideEmptyAnswers` property.
1236
+ *
1237
+ * Default value: `false`
1238
+ *
1239
+ * @see allowHideEmptyAnswers
1240
+ */
1241
+ hideEmptyAnswers?: boolean;
1242
+ /**
1243
+ * Allows users to select whether to show top 5, 10, or 20 answers by answer count.
1244
+ * This property adds a Top N Answers dropdown to each chart.
1245
+ *
1246
+ * Default value: `false`
1247
+ */
1248
+ allowTopNAnswers?: boolean;
1249
+ /**
1250
+ * Allows users to show the number of respondents who did not answer a particular question.
1251
+ * This property adds a Show Missing Answers button to each chart.
1252
+ *
1253
+ * Default value: `false`
1254
+ */
1255
+ allowShowMissingAnswers?: boolean;
1256
+ allowExperimentalFeatures?: boolean;
1257
+ /**
1258
+ * Default chart type.
1259
+ *
1260
+ * Accepted values depend on the question type as follows:
1261
+ *
1262
+ * - Boolean: `"bar"` | `"pie"` | `"doughnut"`
1263
+ * - Date, Number: `"bar"` | `"scatter"`
1264
+ * - Matrix: `"bar"` | `"pie"` | `"doughnut"` | `"stackedbar"`
1265
+ * - Rating: `"bar"` | `"scatter"` | `"gauge"` | `"bullet"`
1266
+ * - Radiogroup, Checkbox, Dropdown, Image Picker: `"bar"` | `"pie"` | `"doughnut"` | `"scatter"`
1267
+ *
1268
+ * To set a type for an individual chart, access this chart in the `visualizers` array and set its `chartType` property to one of the values described above:
1269
+ *
1270
+ * ```js
1271
+ * const vizPanel = new SurveyAnalytics.VisualizationPanel( ... );
1272
+ * vizPanel.visualizers[0].chartType = "stackedbar";
1273
+ * ```
1274
+ *
1275
+ */
1276
+ defaultChartType?: string;
1277
+ /**
1278
+ * Allows users to transpose a visualized matrix question.
1279
+ * This property adds a Transpose button to charts that visualize matrixes. When users select Per Values, matrix rows go to chart arguments, and matrix columns form chart series. When users select Per Columns, matrix rows form chart series, and matrix columns go to chart arguments.
1280
+ *
1281
+ * Default value: `false`
1282
+ */
1283
+ allowTransposeData?: boolean;
1284
+ /**
1285
+ * Allows users to cross-filter charts. The filter applies when users selects a series point.
1286
+ *
1287
+ * Default value: `true`
1288
+ */
1289
+ allowSelection?: boolean;
1290
+ renderContent?: Function;
1291
+ destroyContent?: Function;
1292
+ /**
1293
+ * Removes HTML tags from survey element titles.
1294
+ * Survey element titles can contain HTML markup and are specified by users. An attacker can inject malicious code into the titles. To guard against it, keep this property set to `true`.
1295
+ *
1296
+ * Default value: `true`
1297
+ */
1298
+ stripHtmlFromTitles?: boolean;
1299
+ }
1300
+ /**
1301
+ * VisualizationPanel is responsible for visualizing an array of survey questions
1302
+ * <br/>
1303
+ * <br/> constructor parameters:
1304
+ * <br/> questions - an array of survey questions to visualize,
1305
+ * <br/> data - an array of answers in format of survey result,
1306
+ * <br/> options - object of the IVisualizationPanelOptions type, @see IVisualizationPanelOptions
1307
+ * <br/> elements - list of visual element descriptions
1308
+ *
1309
+ */
1310
+ export class VisualizationPanel extends VisualizerBase {
382
1311
  protected questions: Array<any>;
1312
+ private _elements;
383
1313
  static haveCommercialLicense: boolean;
384
1314
  visualizers: Array<VisualizerBase>;
1315
+ private haveCommercialLicense;
1316
+ private renderedQuestionsCount;
385
1317
  constructor(questions: Array<any>, data: Array<{
386
- [index: string]: any;
387
- }>, options?: {
388
- [index: string]: any;
389
- }, _elements?: Array<IVisualizerPanelRenderedElement>);
1318
+ [index: string]: any;
1319
+ }>, options?: IVisualizationPanelOptions, _elements?: Array<IVisualizerPanelRenderedElement>);
1320
+ private onAfterRenderQuestionCallback;
390
1321
  protected showElement(elementName: string): void;
391
1322
  protected hideElement(elementName: string): void;
392
1323
  protected makeElementPrivate(element: IVisualizerPanelElement): void;
@@ -394,610 +1325,238 @@ export class VisualizationPanel extends VisualizerBase {
394
1325
  protected moveVisibleElement(fromVisibleIndex: number, toVisibleIndex: number): void;
395
1326
  protected moveElement(fromIndex: number, toIndex: number): void;
396
1327
  protected setBackgroundColorCore(color: string): void;
1328
+ private buildVisualizers;
1329
+ private destroyVisualizers;
397
1330
  /**
398
- * Returns current locale of the visualization panel.
399
- * If locales more than one, the language selection dropdown will be added in the toolbar
400
- * In order to use survey locales the survey instance object should be passed as 'survey' option for visualizer
401
- */
1331
+ * Returns current locale of the visualization panel.
1332
+ * If locales more than one, the language selection dropdown will be added in the toolbar
1333
+ * In order to use survey locales the survey instance object should be passed as 'survey' option for visualizer
1334
+ */
402
1335
  get locale(): string;
403
1336
  /**
404
- * Sets locale for visualization panel.
405
- */
1337
+ * Sets locale for visualization panel.
1338
+ */
406
1339
  set locale(newLocale: string);
1340
+ private setLocale;
407
1341
  /**
408
- * Returns whether the VisualizationPanel allows dynamic layouting - rearrange items via drap/drop. Set via options.
409
- */
1342
+ * Returns whether the VisualizationPanel allows dynamic layouting - rearrange items via drap/drop. Set via options.
1343
+ */
410
1344
  get allowDynamicLayout(): boolean;
411
1345
  /**
412
- * Returns whether the VisualizationPanel allows to hide/show individual inner visualizers.
413
- */
1346
+ * Returns whether the VisualizationPanel allows to hide/show individual inner visualizers.
1347
+ */
414
1348
  get allowHideQuestions(): boolean;
415
1349
  /**
416
- * Returns whether the VisualizationPanel allows to make private/public individual inner visualizers for work with permissions.
417
- */
1350
+ * Returns whether the VisualizationPanel allows to make private/public individual inner visualizers for work with permissions.
1351
+ */
418
1352
  get allowMakeQuestionsPrivate(): boolean;
1353
+ private _layoutEngine;
419
1354
  /**
420
- * Returns the layout engine instance if any.
421
- */
1355
+ * Returns the layout engine instance if any.
1356
+ */
422
1357
  get layoutEngine(): LayoutEngine;
423
1358
  protected buildElements(questions: any[]): IVisualizerPanelElement[];
424
1359
  /**
425
- * Returns panel elements descriptions array.
426
- * Inner visualizers are rendered in the order of this array and with titles from the displayName property
427
- */
1360
+ * Returns panel elements descriptions array.
1361
+ * Inner visualizers are rendered in the order of this array and with titles from the displayName property
1362
+ */
428
1363
  getElements(): IVisualizerPanelElement[];
429
1364
  /**
430
- * Returns panel's visible elements.
431
- */
1365
+ * Returns panel's visible elements.
1366
+ */
432
1367
  get visibleElements(): IVisualizerPanelRenderedElement[];
433
1368
  /**
434
- * Returns panel's hidden elements.
435
- */
1369
+ * Returns panel's hidden elements.
1370
+ */
436
1371
  get hiddenElements(): IVisualizerPanelRenderedElement[];
437
1372
  /**
438
- * Returns panel's public elements.
439
- */
1373
+ * Returns panel's public elements.
1374
+ */
440
1375
  get publicElements(): IVisualizerPanelRenderedElement[];
441
1376
  /**
442
- * Returns panel's private elements.
443
- */
1377
+ * Returns panel's private elements.
1378
+ */
444
1379
  get privateElements(): IVisualizerPanelRenderedElement[];
445
1380
  protected get locales(): any;
446
1381
  /**
447
- * Returns panel element description by the question name.
448
- */
1382
+ * Returns panel element description by the question name.
1383
+ */
449
1384
  getElement(name: string): IVisualizerPanelRenderedElement;
450
1385
  /**
451
- * Returns panel element visualizer by the question name.
452
- */
1386
+ * Returns panel element visualizer by the question name.
1387
+ */
453
1388
  getVisualizer(visualizerName: string): VisualizerBase;
454
1389
  /**
455
- * Fires when element visibility has been changed.
456
- * options:
457
- * elements - panel elements array
458
- * changed - changed element
459
- * reason - reason (string) why event fired: "ADDED", "MOVED" or "REMOVED"
460
- */
1390
+ * Fires when element visibility has been changed.
1391
+ * options:
1392
+ * elements - panel elements array
1393
+ * changed - changed element
1394
+ * reason - reason (string) why event fired: "ADDED", "MOVED" or "REMOVED"
1395
+ */
461
1396
  onVisibleElementsChanged: Event<(sender: VisualizationPanel, options: any) => any, any>;
462
1397
  protected visibleElementsChanged(element: IVisualizerPanelElement, reason: string): void;
463
1398
  /**
464
- * Fires when vizualization panel state changed.
465
- * sender - this panel
466
- * state - new state of the panel
467
- */
1399
+ * Fires when vizualization panel state changed.
1400
+ * sender - this panel
1401
+ * state - new state of the panel
1402
+ */
468
1403
  onStateChanged: Event<(sender: VisualizationPanel, state: IState) => any, any>;
469
1404
  /**
470
- * Fires when permissions changed
471
- */
1405
+ * Fires when permissions changed
1406
+ */
472
1407
  onPermissionsChangedCallback: any;
473
1408
  /**
474
- * Renders given panel element.
475
- */
1409
+ * Renders given panel element.
1410
+ */
476
1411
  protected renderPanelElement(element: IVisualizerPanelRenderedElement, container: HTMLElement): HTMLElement;
477
1412
  protected renderToolbar(container: HTMLElement): void;
478
1413
  /**
479
- * Renders all questions into given HTML container element.
480
- * container - HTML element to render the panel
481
- */
1414
+ * Renders all questions into given HTML container element.
1415
+ * container - HTML element to render the panel
1416
+ */
482
1417
  renderContent(container: HTMLElement): void;
483
1418
  /**
484
- * Destroys visualizer and all inner content.
485
- */
1419
+ * Destroys visualizer and all inner content.
1420
+ */
486
1421
  protected destroyContent(container: HTMLElement): void;
487
1422
  /**
488
- * Redraws visualizer toobar and all inner content.
489
- */
1423
+ * Redraws visualizer toobar and all inner content.
1424
+ */
490
1425
  refresh(): void;
491
1426
  /**
492
- * Updates layout of visualizer inner content.
493
- */
1427
+ * Updates layout of visualizer inner content.
1428
+ */
494
1429
  layout(): void;
495
1430
  /**
496
- * Sets filter by question name and value.
497
- */
1431
+ * Sets filter by question name and value.
1432
+ */
498
1433
  setFilter(questionName: string, selectedValue: any): void;
499
1434
  /**
500
- * Gets vizualization panel state.
501
- */
1435
+ * Gets vizualization panel state.
1436
+ */
502
1437
  get state(): IState;
503
1438
  /**
504
- * Sets vizualization panel state.
505
- */
1439
+ * Sets vizualization panel state.
1440
+ */
506
1441
  set state(newState: IState);
507
1442
  /**
508
- * Gets vizualization panel permissions.
509
- */
1443
+ * Gets vizualization panel permissions.
1444
+ */
510
1445
  get permissions(): IPermission[];
511
1446
  /**
512
- * Sets vizualization panel permissions.
513
- */
1447
+ * Sets vizualization panel permissions.
1448
+ */
514
1449
  set permissions(permissions: IPermission[]);
515
1450
  destroy(): void;
1451
+ }
516
1452
  }
517
-
518
- export class VisualizationPanelDynamic extends VisualizerBase {
519
- protected _panelVisualizer: VisualizationPanel;
520
- constructor(question: Question, data: Array<{
521
- [index: string]: any;
522
- }>, options?: {
523
- [index: string]: any;
524
- }, name?: string);
525
- get name(): string;
526
- updateData(data: Array<{
527
- [index: string]: any;
528
- }>): void;
529
- protected onDataChanged(): void;
530
- getQuestions(): IQuestion[];
531
- destroyContent(container: HTMLElement): void;
532
- renderContent(container: HTMLElement): void;
533
- destroy(): void;
534
- }
535
-
536
- export class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
537
- constructor(question: Question, data: Array<{
538
- [index: string]: any;
539
- }>, options?: Object);
540
- get name(): string;
541
- getQuestions(): any;
542
- }
543
-
544
- export class VisualizationMatrixDropdown extends VisualizerBase {
545
- protected _matrixDropdownVisualizer: VisualizerBase;
546
- constructor(question: QuestionMatrixDropdownModel, data: Array<{
547
- [index: string]: any;
548
- }>, options?: {
549
- [index: string]: any;
550
- }, name?: string);
551
- get matrixDropdownVisualizer(): VisualizerBase;
552
- updateData(data: Array<{
553
- [index: string]: any;
554
- }>): void;
555
- protected onDataChanged(): void;
556
- getQuestions(): any;
557
- destroyContent(container: HTMLElement): void;
558
- renderContent(container: HTMLElement): void;
559
- destroy(): void;
560
- }
561
-
562
- export class AlternativeVisualizersWrapper extends VisualizerBase implements IVisualizerWithSelection {
563
- constructor(visualizers: Array<VisualizerBase>, question: Question, data: Array<{
564
- [index: string]: any;
565
- }>, options?: Object);
566
- protected visualizerContainer: HTMLElement;
567
- get hasFooter(): boolean;
568
- getVisualizers(): VisualizerBase[];
569
- updateData(data: Array<{
570
- [index: string]: any;
571
- }>): void;
572
- set onDataItemSelected(val: (selectedValue: any, selectedText: string) => void);
573
- setSelection(item: ItemValue): void;
574
- get selection(): any;
575
- protected renderContent(container: HTMLElement): void;
576
- protected setBackgroundColorCore(color: string): void;
577
- destroy(): void;
578
- }
579
-
580
- import "./datatables.scss";
581
- interface DataTablesOptions extends ITableOptions {
582
- buttons: boolean | string[] | any[] | any;
583
- dom: string;
584
- orderFixed: Array<number | string> | Array<Array<number | string>> | object;
585
- rowGroup: boolean | any;
586
- headerCallback: any;
587
- }
588
- export class DataTables extends Table {
589
- datatableApi: any;
590
- currentPageNumber: number;
591
- /**
592
- * The event is fired columns configuration has been changed.
593
- * <br/> sender the datatables adapter
594
- * <br/> options.survey current survey
595
- * @see getColumns
596
- */
597
- onColumnsReorder: Event<(sender: DataTables, options: any) => any, any>;
598
- static initJQuery($: any): void;
599
- static set haveCommercialLicense(val: boolean);
600
- constructor(survey: SurveyModel, data: Array<Object>, options: DataTablesOptions, _columns?: Array<ITableColumn>);
601
- destroy(): void;
602
- setColumnVisibility(columnName: string, isVisible: boolean): void;
603
- setColumnLocation(columnName: string, location: QuestionLocation): void;
604
- applyFilter(value: string): void;
605
- applyColumnFilter(columnName: string, value: string): void;
606
- sortByColumn(columnName: string, direction: string): void;
607
- setPageSize(value: number): void;
608
- setPageNumber(value: number): void;
609
- getPageNumber(): number;
610
- render(targetNode: HTMLElement): void;
611
- getColumns(): Array<any>;
612
- layout(): void;
613
- }
614
- export class DatatablesRow extends TableRow {
615
- protected table: Table;
616
- protected extensionsContainer: HTMLElement;
617
- protected detailsContainer: HTMLElement;
618
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement, _innerRow: any);
619
- get innerRow(): any;
620
- getElement(): HTMLElement;
621
- getRowData(): HTMLElement;
622
- getDataPosition(): number;
623
- remove(): void;
624
- }
625
- export {};
626
-
627
- import "./tabulator.scss";
628
- interface ITabulatorOptions extends ITableOptions {
629
- tabulatorOptions?: any;
630
- downloadHiddenColumns?: boolean;
631
- actionsColumnWidth?: number;
632
- downloadButtons: Array<string>;
633
- downloadOptions?: {
634
- [type: string]: any;
635
- };
636
- onDownloadCallbacks?: {
637
- [type: string]: (tabulator: Tabulator, options: any) => void;
638
- };
639
- }
640
- export class Tabulator extends Table {
641
- static set haveCommercialLicense(val: boolean);
642
- constructor(survey: SurveyModel, data: Array<Object>, options: ITabulatorOptions, _columns?: Array<any>);
643
- tabulatorTables: any;
644
- render(targetNode: HTMLElement): void;
645
- destroy: () => void;
646
- getColumns(): Array<any>;
647
- setColumnVisibility(columnName: string, isVisible: boolean): void;
648
- setColumnLocation(columnName: string, location: QuestionLocation): void;
649
- setColumnWidth(columnName: string, width: number | string): void;
650
- sortByColumn(columnName: string, direction: string): void;
651
- applyColumnFilter(columnName: string, value: string): void;
652
- applyFilter(value: string): void;
653
- getPageNumber(): number;
654
- setPageNumber(value: number): void;
655
- setPageSize(value: number): void;
656
- download(type: string): void;
657
- layout(hard?: boolean): void;
658
- }
659
- export class TabulatorRow extends TableRow {
660
- protected table: Table;
661
- protected extensionsContainer: HTMLElement;
662
- protected detailsContainer: HTMLElement;
663
- protected innerRow: any;
664
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement, innerRow: any);
665
- getElement(): HTMLElement;
666
- getRowData(): HTMLElement;
667
- getDataPosition(): number;
668
- remove(): void;
669
- }
670
- export {};
671
-
672
- export class WordCloudAdapter {
673
- static drawOutOfBound: boolean;
674
- static shrinkToFit: boolean;
675
- static abortThreshold: any;
676
- static weightFactor: number;
677
- constructor(model: WordCloud);
678
- get wordcloud(): any;
679
- create(node: HTMLElement): any;
680
- destroy(node: HTMLElement): void;
681
- }
682
- export class WordCloud extends VisualizerBase {
683
- constructor(question: Question, data: Array<{
684
- [index: string]: any;
685
- }>, options?: Object, name?: string);
686
- getData(): (string | number)[][];
687
- protected destroyContent(container: HTMLElement): void;
688
- protected renderContent(container: HTMLElement): void;
689
- destroy(): void;
690
- }
691
-
692
- export var textHelper: {
693
- getStopWords: (locale?: string) => string[];
694
- };
695
-
696
- import "./text.scss";
697
- export class TextTableAdapter {
698
- constructor(model: Text);
699
- create(container: HTMLElement): void;
700
- destroy(node: HTMLElement): void;
701
- }
702
- export class Text extends VisualizerBase {
703
- constructor(question: Question, data: Array<{
704
- [index: string]: any;
705
- }>, options?: Object, name?: string);
706
- getData(): {
707
- columnsCount: number;
708
- data: string[][];
709
- };
710
- protected destroyContent(container: HTMLElement): void;
711
- protected renderContent(container: HTMLElement): void;
712
- destroy(): void;
713
- }
714
-
715
- export interface IVisualizerPanelElement {
716
- name: string;
717
- displayName: string;
718
- isVisible: boolean;
719
- isPublic: boolean;
720
- type?: string;
721
- chartType?: string;
722
- answersOrder?: string;
723
- hideEmptyAnswers?: boolean;
724
- topN?: number;
725
- }
726
- export interface IState {
727
- locale?: string;
728
- elements?: IVisualizerPanelElement[];
729
- }
730
- export interface IPermission {
731
- name: string;
732
- isPublic: boolean;
733
- }
734
-
735
- export class LayoutEngine {
736
- protected _allowed: boolean;
737
- constructor(_allowed: boolean);
738
- protected startCore(container: HTMLElement): void;
739
- protected stopCore(): void;
740
- protected updateCore(): void;
741
- get allowed(): boolean;
742
- start(container: HTMLElement): void;
743
- stop(): void;
744
- update(): void;
745
- add(elements: Array<HTMLElement>, options?: any): void;
746
- remove(elements: Array<HTMLElement>, options?: any): void;
747
- onMoveCallback: (fromIndex: number, toIndex: number) => void;
748
- destroy(): void;
749
- }
750
- export class MuuriLayoutEngine extends LayoutEngine {
751
- constructor(allowed: boolean, _selector: string);
752
- protected startCore(container: HTMLElement): void;
753
- protected stopCore(): void;
754
- protected updateCore(): void;
755
- add(elements: Array<HTMLElement>, options?: any): void;
756
- remove(elements: Array<HTMLElement>, options?: any): void;
757
- }
758
-
759
- export interface IVisualizerWithSelection {
760
- selection: ItemValue;
761
- onDataItemSelected: (selectedValue: any, selectedText: string) => void;
762
- setSelection(item: ItemValue): void;
763
- }
764
- export interface IAnswersData {
765
- datasets: Array<Array<any>>;
766
- labels: Array<string>;
767
- colors: Array<string>;
768
- texts: Array<Array<any>>;
769
- seriesLabels: Array<string>;
770
- }
771
- export class SelectBase extends VisualizerBase implements IVisualizerWithSelection {
772
- protected selectedItem: ItemValue;
773
- protected _answersOrder: string;
774
- protected _supportSelection: boolean;
775
- static topNValuesDefaults: number[];
776
- topNValues: any[];
1453
+ declare module "visualizationPanelDynamic" {
1454
+ import { VisualizerBase } from "visualizerBase";
1455
+ import { VisualizationPanel } from "visualizationPanel";
1456
+ import { Question, IQuestion } from "survey-core";
1457
+ export class VisualizationPanelDynamic extends VisualizerBase {
1458
+ protected _panelVisualizer: VisualizationPanel;
777
1459
  constructor(question: Question, data: Array<{
778
- [index: string]: any;
779
- }>, options?: any, name?: string);
780
- protected chartTypes: string[];
781
- chartType: string;
782
- protected onChartTypeChanged(): void;
783
- protected setChartType(chartType: string): void;
784
- getSelectedItemByText(itemText: string): any;
785
- setSelection(item: ItemValue): void;
786
- get selection(): ItemValue;
787
- get showOnlyPercentages(): boolean;
788
- set showOnlyPercentages(val: boolean);
789
- get showPercentages(): boolean;
790
- set showPercentages(val: boolean);
791
- get answersOrder(): string;
792
- set answersOrder(value: string);
793
- get hideEmptyAnswers(): boolean;
794
- set hideEmptyAnswers(value: boolean);
795
- get transposeData(): boolean;
796
- set transposeData(value: boolean);
797
- get topN(): number;
798
- set topN(value: number);
799
- protected isSupportMissingAnswers(): boolean;
800
- get showMissingAnswers(): boolean;
801
- set showMissingAnswers(value: boolean);
802
- refreshContent(): void;
803
- onDataItemSelected: (selectedValue: any, selectedText: string) => void;
804
- valuesSource(): Array<ItemValue>;
805
- getValues(): Array<any>;
806
- getLabels(): Array<string>;
807
- getPercentages(): Array<Array<number>>;
808
- protected hideEmptyAnswersInData(answersData: IAnswersData): IAnswersData;
809
- protected answersDataReady(answersData: IAnswersData): any;
810
- /**
811
- * Fires when answer data has been combined before they passed to draw graph.
812
- * options - the answers data object containing: datasets, labels, colors, additional texts (percentage).
813
- * options fields can be modified
814
- */
815
- onAnswersDataReady: Event<(sender: SelectBase, options: any) => any, any>;
816
- /**
817
- * Returns object with all infotmation for data visualization: datasets, labels, colors, additional texts (percentage).
818
- */
819
- getAnswersData(): IAnswersData;
820
- protected transpose(data: Array<Array<number>>): Array<Array<number>>;
821
- getState(): any;
822
- setState(state: any): void;
1460
+ [index: string]: any;
1461
+ }>, options?: {
1462
+ [index: string]: any;
1463
+ }, name?: string);
1464
+ private onAfterRenderPanelCallback;
1465
+ get name(): string;
1466
+ private updatePanelVisualizerData;
1467
+ updateData(data: Array<{
1468
+ [index: string]: any;
1469
+ }>): void;
1470
+ protected onDataChanged(): void;
1471
+ getQuestions(): IQuestion[];
1472
+ destroyContent(container: HTMLElement): void;
1473
+ renderContent(container: HTMLElement): void;
1474
+ destroy(): void;
1475
+ }
823
1476
  }
824
-
825
- export interface ITableOptions {
826
- [index: string]: any;
827
- /**
828
- * Set this property to true to render column headings using question names
829
- */
830
- useNamesAsTitles?: boolean;
831
- /**
832
- * Use this event to change the display value of question in table.
833
- * <br/> `sender` - the table object that fires the event.
834
- * <br/> `options.question` - the question obect for which event is fired.
835
- * <br/> `options.displayValue` - the question display value. You can change this option before it is displayed in the table.
836
- */
837
- onGetQuestionValue?: (options: {
838
- question: Question;
839
- displayValue: any;
840
- }) => void;
1477
+ declare module "visualizationMatrixDynamic" {
1478
+ import { Question } from "survey-core";
1479
+ import { VisualizationPanelDynamic } from "visualizationPanelDynamic";
1480
+ export class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
1481
+ constructor(question: Question, data: Array<{
1482
+ [index: string]: any;
1483
+ }>, options?: Object);
1484
+ get name(): string;
1485
+ getQuestions(): any;
1486
+ }
841
1487
  }
842
- export abstract class Table {
843
- protected survey: SurveyModel;
844
- protected data: Array<Object>;
845
- protected options: ITableOptions;
846
- protected _columns: Array<ITableColumn>;
847
- static showFilesAsImages: boolean;
848
- static haveCommercialLicense: boolean;
849
- protected tableData: any;
850
- protected extensions: TableExtensions;
851
- constructor(survey: SurveyModel, data: Array<Object>, options?: ITableOptions, _columns?: Array<ITableColumn>);
852
- protected renderResult: HTMLElement;
853
- protected currentPageSize: number;
854
- protected currentPageNumber: number;
855
- protected _rows: TableRow[];
856
- protected isColumnReorderEnabled: boolean;
857
- onColumnsVisibilityChanged: Event<(sender: Table, options: any) => any, any>;
858
- onColumnsLocationChanged: Event<(sender: Table, options: any) => any, any>;
859
- onRowRemoved: Event<(sender: Table, options: any) => any, any>;
860
- renderDetailActions: (container: HTMLElement, row: TableRow) => HTMLElement;
861
- getData(): Object[];
862
- abstract applyFilter(value: string): void;
863
- abstract applyColumnFilter(columnName: string, value: string): void;
864
- abstract sortByColumn(columnName: string, direction: string): void;
865
- render(targetNode: HTMLElement): void;
866
- enableColumnReorder(): void;
867
- disableColumnReorder(): void;
868
- getPageNumber(): number;
869
- setPageNumber(value: number): void;
870
- getPageSize(): number;
871
- setPageSize(value: number): void;
872
- getCreatedRows(): TableRow[];
873
- clearCreatedRows(): void;
874
- protected buildColumns: (survey: SurveyModel) => ITableColumn[];
875
- isColumnVisible(column: ITableColumn): boolean;
876
- get columns(): Array<ITableColumn>;
877
- set columns(columns: Array<ITableColumn>);
878
- protected initTableData(data: Array<any>): void;
879
- moveColumn(from: number, to: number): void;
880
- setColumnLocation(columnName: string, location: QuestionLocation): void;
881
- getColumnByName(columnName: string): ITableColumn;
882
- setColumnVisibility(columnName: string, isVisible: boolean): void;
883
- setColumnWidth(columnName: string, width: string | number): void;
884
- removeRow(row: TableRow): void;
885
- /**
886
- * Returns current locale of the table.
887
- * If locales more than one, the language selection dropdown will be added in the toolbar
888
- */
889
- get locale(): string;
890
- /**
891
- * Sets locale for table.
892
- */
893
- set locale(newLocale: string);
894
- getLocales(): Array<string>;
895
- refresh(hard?: boolean): void;
1488
+ declare module "visualizationMatrixDropdown" {
1489
+ import { QuestionMatrixDropdownModel } from "survey-core";
1490
+ import { VisualizerBase } from "visualizerBase";
1491
+ export class VisualizationMatrixDropdown extends VisualizerBase {
1492
+ protected _matrixDropdownVisualizer: VisualizerBase;
1493
+ constructor(question: QuestionMatrixDropdownModel, data: Array<{
1494
+ [index: string]: any;
1495
+ }>, options?: {
1496
+ [index: string]: any;
1497
+ }, name?: string);
1498
+ get matrixDropdownVisualizer(): VisualizerBase;
1499
+ private onPanelAfterRenderCallback;
1500
+ private updateDropdownVisualizerData;
1501
+ updateData(data: Array<{
1502
+ [index: string]: any;
1503
+ }>): void;
1504
+ protected onDataChanged(): void;
1505
+ getQuestions(): any;
1506
+ destroyContent(container: HTMLElement): void;
1507
+ renderContent(container: HTMLElement): void;
896
1508
  destroy(): void;
897
- get isRendered(): boolean;
898
- /**
899
- * Vizualization panel state getter.
900
- */
901
- get state(): ITableState;
902
- /**
903
- * Vizualization panel state setter.
904
- */
905
- set state(newState: ITableState);
906
- /**
907
- * Fires when table state changed.
908
- */
909
- onStateChanged: Event<(sender: Table, options: any) => any, any>;
910
- /**
911
- * Gets table permissions.
912
- */
913
- get permissions(): IPermission[];
914
- /**
915
- * Sets table permissions.
916
- */
917
- set permissions(permissions: IPermission[]);
918
- /**
919
- * Fires when permissions changed
920
- */
921
- onPermissionsChangedCallback: any;
1509
+ }
922
1510
  }
923
- export abstract class TableRow {
924
- protected table: Table;
925
- protected extensionsContainer: HTMLElement;
926
- protected detailsContainer: HTMLElement;
927
- constructor(table: Table, extensionsContainer: HTMLElement, detailsContainer: HTMLElement);
928
- details: Details;
929
- extensions: TableExtensions;
930
- onToggleDetails: Event<(sender: TableRow, options: any) => any, any>;
931
- /**
932
- * Returns row's html element
933
- */
934
- abstract getElement(): HTMLElement;
935
- /**
936
- * Returns data, which is displayed in the row.
937
- */
938
- abstract getRowData(): any;
939
- /**
940
- * Returns position of row in the table's data.
941
- */
942
- abstract getDataPosition(): number;
943
- protected isSelected: boolean;
944
- render(): void;
945
- openDetails(): void;
946
- closeDetails(): void;
947
- toggleDetails(): void;
948
- getIsSelected(): boolean;
949
- toggleSelect(): void;
950
- remove(): void;
1511
+ declare module "alternativeVizualizersWrapper" {
1512
+ import { Question, ItemValue } from "survey-core";
1513
+ import { VisualizerBase } from "visualizerBase";
1514
+ import { IVisualizerWithSelection } from "selectBase";
1515
+ export class AlternativeVisualizersWrapper extends VisualizerBase implements IVisualizerWithSelection {
1516
+ private visualizers;
1517
+ constructor(visualizers: Array<VisualizerBase>, question: Question, data: Array<{
1518
+ [index: string]: any;
1519
+ }>, options?: Object);
1520
+ protected visualizerContainer: HTMLElement;
1521
+ get hasFooter(): boolean;
1522
+ getVisualizers(): VisualizerBase[];
1523
+ private visualizersWithSelection;
1524
+ private selectedItem;
1525
+ private visualizer;
1526
+ private onAfterVisualizerRenderCallback;
1527
+ private setVisualizer;
1528
+ updateData(data: Array<{
1529
+ [index: string]: any;
1530
+ }>): void;
1531
+ set onDataItemSelected(val: (selectedValue: any, selectedText: string) => void);
1532
+ setSelection(item: ItemValue): void;
1533
+ get selection(): any;
1534
+ protected renderContent(container: HTMLElement): void;
1535
+ protected setBackgroundColorCore(color: string): void;
951
1536
  destroy(): void;
1537
+ }
952
1538
  }
953
-
954
- export enum QuestionLocation {
955
- Column = 0,
956
- Row = 1
957
- }
958
- export enum ColumnDataType {
959
- Text = 0,
960
- FileLink = 1,
961
- Image = 2
962
- }
963
- export interface ITableColumn {
964
- name: string;
965
- displayName: string;
966
- dataType: ColumnDataType;
967
- isVisible: boolean;
968
- isPublic: boolean;
969
- location: QuestionLocation;
970
- width?: string | number;
971
- isComment?: boolean;
972
- }
973
- export interface ITableState {
974
- locale?: string;
975
- elements?: ITableColumn[];
976
- pageSize?: number;
977
- }
978
- export interface IPermission {
979
- name: string;
980
- isPublic: boolean;
981
- }
982
-
983
- export interface PlotlyOptions {
1539
+ declare module "plotly/setup" {
1540
+ import { Event } from "survey-core";
1541
+ import { SelectBase } from "selectBase";
1542
+ export interface PlotlyOptions {
984
1543
  traces: Array<any>;
985
1544
  layout: any;
986
1545
  hasSeries: boolean;
987
- }
988
- export class PlotlySetup {
1546
+ }
1547
+ export class PlotlySetup {
989
1548
  static imageExportFormat: string;
990
1549
  /**
991
- * Fires when end user clicks on the 'save as image' button.
992
- */
1550
+ * Fires when end user clicks on the 'save as image' button.
1551
+ */
993
1552
  static onImageSaving: Event<(sender: SelectBase, options: any) => any, any>;
994
1553
  /**
995
- * Fires before plot will be created. User can change traces, layout and config of the plot.
996
- * Options is an object with the following fields: traces, layout and config of the plot.
997
- */
1554
+ * Fires before plot will be created. User can change traces, layout and config of the plot.
1555
+ * Options is an object with the following fields: traces, layout and config of the plot.
1556
+ */
998
1557
  static onPlotCreating: Event<(sender: SelectBase, options: any) => any, any>;
999
1558
  static setups: {
1000
- [type: string]: (model: SelectBase) => PlotlyOptions;
1559
+ [type: string]: (model: SelectBase) => PlotlyOptions;
1001
1560
  };
1002
1561
  static setup(charType: string, model: SelectBase): PlotlyOptions;
1003
1562
  static getTruncatedLabel: (label: string, labelTruncateLength: number) => string;
@@ -1005,210 +1564,262 @@ export class PlotlySetup {
1005
1564
  static setupBar(model: SelectBase): PlotlyOptions;
1006
1565
  static setupVBar(model: SelectBase): PlotlyOptions;
1007
1566
  static setupScatter(model: SelectBase): PlotlyOptions;
1567
+ }
1008
1568
  }
1009
-
1010
- export class PlotlyChartAdapter {
1011
- protected model: SelectBase;
1012
- constructor(model: SelectBase);
1013
- protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
1014
- get chart(): Promise<Plotly.PlotlyHTMLElement>;
1015
- create(chartNode: HTMLElement): any;
1016
- destroy(node: HTMLElement): void;
1017
- }
1018
- export class SelectBasePlotly extends SelectBase {
1019
- static types: string[];
1020
- static displayModeBar: any;
1021
- constructor(question: Question, data: Array<{
1022
- [index: string]: any;
1023
- }>, options?: {
1024
- [index: string]: any;
1025
- }, name?: string);
1026
- protected destroyContent(container: HTMLElement): void;
1027
- protected renderContent(container: HTMLElement): void;
1028
- getData(): any[];
1569
+ declare module "plotly/selectBase" {
1570
+ import { Question } from "survey-core";
1571
+ import { SelectBase } from "selectBase";
1572
+ import Plotly from "plotly.js-dist-min";
1573
+ export class PlotlyChartAdapter {
1574
+ protected model: SelectBase;
1575
+ private _chart;
1576
+ constructor(model: SelectBase);
1577
+ protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
1578
+ get chart(): Promise<Plotly.PlotlyHTMLElement>;
1579
+ create(chartNode: HTMLElement): any;
1580
+ destroy(node: HTMLElement): void;
1581
+ }
1582
+ export class SelectBasePlotly extends SelectBase {
1583
+ private _chartAdapter;
1584
+ static types: string[];
1585
+ static displayModeBar: any;
1586
+ constructor(question: Question, data: Array<{
1587
+ [index: string]: any;
1588
+ }>, options?: {
1589
+ [index: string]: any;
1590
+ }, name?: string);
1591
+ protected destroyContent(container: HTMLElement): void;
1592
+ protected renderContent(container: HTMLElement): void;
1593
+ getData(): any[];
1594
+ }
1029
1595
  }
1030
-
1031
- export class MatrixPlotly extends Matrix {
1032
- static types: string[];
1033
- constructor(question: Question, data: Array<{
1034
- [index: string]: any;
1035
- }>, options?: Object, name?: string);
1036
- protected destroyContent(container: HTMLElement): void;
1037
- protected renderContent(container: HTMLElement): void;
1596
+ declare module "plotly/matrix" {
1597
+ import { Question } from "survey-core";
1598
+ import { Matrix } from "matrix";
1599
+ export class MatrixPlotly extends Matrix {
1600
+ private _chartAdapter;
1601
+ static types: string[];
1602
+ constructor(question: Question, data: Array<{
1603
+ [index: string]: any;
1604
+ }>, options?: Object, name?: string);
1605
+ protected destroyContent(container: HTMLElement): void;
1606
+ protected renderContent(container: HTMLElement): void;
1607
+ }
1038
1608
  }
1039
-
1040
- export class PlotlyBoolChartAdapter extends PlotlyChartAdapter {
1041
- constructor(model: BooleanPlotly);
1042
- protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
1609
+ declare module "plotly/boolean" {
1610
+ import { Question } from "survey-core";
1611
+ import { BooleanModel } from "boolean";
1612
+ import { PlotlyChartAdapter } from "plotly/selectBase";
1613
+ export class PlotlyBoolChartAdapter extends PlotlyChartAdapter {
1614
+ constructor(model: BooleanPlotly);
1615
+ protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: object): void;
1616
+ }
1617
+ export class BooleanPlotly extends BooleanModel {
1618
+ private _chartAdapter;
1619
+ static types: string[];
1620
+ constructor(question: Question, data: Array<{
1621
+ [index: string]: any;
1622
+ }>, options?: Object, name?: string);
1623
+ protected destroyContent(container: HTMLElement): void;
1624
+ protected renderContent(container: HTMLElement): void;
1625
+ }
1043
1626
  }
1044
- export class BooleanPlotly extends BooleanModel {
1045
- static types: string[];
1046
- constructor(question: Question, data: Array<{
1047
- [index: string]: any;
1048
- }>, options?: Object, name?: string);
1049
- protected destroyContent(container: HTMLElement): void;
1050
- protected renderContent(container: HTMLElement): void;
1627
+ declare module "plotly/ranking" {
1628
+ import { SelectBasePlotly } from "plotly/selectBase";
1629
+ export class RankingPlotly extends SelectBasePlotly {
1630
+ getQuestionResults(): any[];
1631
+ getEmptyData(): any;
1632
+ getData(): any[];
1633
+ applyResultToPlotlyData(result: any[], plotlyData: any, choices: any): void;
1634
+ }
1051
1635
  }
1052
-
1053
- export class RankingPlotly extends SelectBasePlotly {
1054
- getQuestionResults(): any[];
1055
- getEmptyData(): any;
1056
- getData(): any[];
1057
- applyResultToPlotlyData(result: any[], plotlyData: any, choices: any): void;
1636
+ declare module "matrixDropdownGrouped" {
1637
+ import { ItemValue, QuestionMatrixDropdownModel, Question } from "survey-core";
1638
+ import { SelectBase } from "selectBase";
1639
+ export class MatrixDropdownGrouped extends SelectBase {
1640
+ constructor(question: Question, data: Array<{
1641
+ [index: string]: any;
1642
+ }>, options?: Object, name?: string);
1643
+ protected get matrixQuestion(): QuestionMatrixDropdownModel;
1644
+ get dataName(): string | Array<string>;
1645
+ getSeriesValues(): Array<string>;
1646
+ getSeriesLabels(): Array<string>;
1647
+ valuesSource(): Array<ItemValue>;
1648
+ protected isSupportMissingAnswers(): boolean;
1649
+ getData(): any[];
1650
+ }
1058
1651
  }
1059
-
1060
- export class MatrixDropdownGroupedPlotly extends MatrixDropdownGrouped {
1061
- static types: string[];
1062
- constructor(question: QuestionMatrixDropdownModel, data: Array<{
1063
- [index: string]: any;
1064
- }>, options?: Object, name?: string);
1065
- protected destroyContent(container: HTMLElement): void;
1066
- protected renderContent(container: HTMLElement): void;
1652
+ declare module "plotly/matrixdropdown-grouped" {
1653
+ import { QuestionMatrixDropdownModel } from "survey-core";
1654
+ import { MatrixDropdownGrouped } from "matrixDropdownGrouped";
1655
+ export class MatrixDropdownGroupedPlotly extends MatrixDropdownGrouped {
1656
+ private _chartAdapter;
1657
+ static types: string[];
1658
+ constructor(question: QuestionMatrixDropdownModel, data: Array<{
1659
+ [index: string]: any;
1660
+ }>, options?: Object, name?: string);
1661
+ protected destroyContent(container: HTMLElement): void;
1662
+ protected renderContent(container: HTMLElement): void;
1663
+ }
1067
1664
  }
1068
-
1069
- export class HistogramPlotly extends HistogramModel {
1070
- static types: string[];
1071
- constructor(question: Question, data: Array<{
1072
- [index: string]: any;
1073
- }>, options?: Object, name?: string);
1074
- protected destroyContent(container: HTMLElement): void;
1075
- protected renderContent(container: HTMLElement): void;
1076
- getData(): any[];
1665
+ declare module "plotly/histogram" {
1666
+ import { Question } from "survey-core";
1667
+ import { HistogramModel } from "histogram";
1668
+ export class HistogramPlotly extends HistogramModel {
1669
+ private _chartAdapter;
1670
+ static types: string[];
1671
+ constructor(question: Question, data: Array<{
1672
+ [index: string]: any;
1673
+ }>, options?: Object, name?: string);
1674
+ protected destroyContent(container: HTMLElement): void;
1675
+ protected renderContent(container: HTMLElement): void;
1676
+ getData(): any[];
1677
+ }
1077
1678
  }
1078
-
1079
- export class PlotlyGaugeAdapter {
1080
- constructor(model: GaugePlotly);
1081
- get chart(): Promise<Plotly.PlotlyHTMLElement>;
1082
- create(chartNode: HTMLElement): any;
1083
- destroy(node: HTMLElement): void;
1679
+ declare module "plotly/rating" {
1680
+ import { Question } from "survey-core";
1681
+ import { NumberModel } from "number";
1682
+ import Plotly from "plotly.js-dist-min";
1683
+ export class PlotlyGaugeAdapter {
1684
+ private model;
1685
+ private _chart;
1686
+ constructor(model: GaugePlotly);
1687
+ get chart(): Promise<Plotly.PlotlyHTMLElement>;
1688
+ create(chartNode: HTMLElement): any;
1689
+ destroy(node: HTMLElement): void;
1690
+ }
1691
+ export class GaugePlotly extends NumberModel {
1692
+ private _chartAdapter;
1693
+ static types: string[];
1694
+ constructor(question: Question, data: Array<{
1695
+ [index: string]: any;
1696
+ }>, options?: Object, name?: string);
1697
+ protected destroyContent(container: HTMLElement): void;
1698
+ protected renderContent(container: HTMLElement): void;
1699
+ }
1084
1700
  }
1085
- export class GaugePlotly extends NumberModel {
1086
- static types: string[];
1087
- constructor(question: Question, data: Array<{
1088
- [index: string]: any;
1089
- }>, options?: Object, name?: string);
1090
- protected destroyContent(container: HTMLElement): void;
1091
- protected renderContent(container: HTMLElement): void;
1701
+ declare module "plotly/index" {
1702
+ export * from "plotly/setup";
1703
+ export * from "plotly/selectBase";
1704
+ export * from "plotly/matrix";
1705
+ export * from "plotly/boolean";
1706
+ export * from "plotly/ranking";
1707
+ export * from "plotly/matrixdropdown-grouped";
1708
+ export * from "plotly/histogram";
1709
+ export * from "plotly/rating";
1092
1710
  }
1093
-
1094
- export class Details {
1095
- protected table: Table;
1096
- protected targetNode: HTMLElement;
1097
- constructor(table: Table, row: TableRow, targetNode: HTMLElement);
1098
- protected location: string;
1099
- open(): void;
1100
- protected createShowAsColumnButton: (columnName: string) => HTMLElement;
1101
- close(): void;
1711
+ declare module "wordcloud/stopwords/english" {
1712
+ export var stopWords: string[];
1102
1713
  }
1103
-
1104
- interface ITableExtension {
1105
- location: string;
1106
- name: string;
1107
- visibleIndex: number;
1108
- render: (table: Table, opt: any) => HTMLElement;
1109
- destroy?: () => void;
1714
+ declare module "wordcloud/stopwords/norwegian" {
1715
+ export var stopWords: string[];
1110
1716
  }
1111
- export class TableExtensions {
1112
- constructor(table: Table);
1113
- render(targetNode: HTMLElement, location: string, options?: any): void;
1114
- destroy(): void;
1115
- static registerExtension(extension: ITableExtension): void;
1116
- static unregisterExtension(location: string, actionName: string): void;
1117
- static findExtension(location: string, actionName: string): ITableExtension;
1717
+ declare module "wordcloud/stopwords/dutch" {
1718
+ export var stopWords: string[];
1118
1719
  }
1119
- export {};
1120
-
1121
- export class Matrix extends SelectBase {
1122
- constructor(question: Question, data: Array<{
1123
- [index: string]: any;
1124
- }>, options?: Object, name?: string);
1125
- protected get matrixQuestion(): QuestionMatrixModel;
1126
- protected isSupportMissingAnswers(): boolean;
1127
- getSeriesValues(): Array<string>;
1128
- getSeriesLabels(): Array<string>;
1129
- getSelectedItemByText(itemText: string): any;
1130
- valuesSource(): Array<ItemValue>;
1131
- protected hideEmptyAnswersInData(answersData: IAnswersData): IAnswersData;
1132
- getData(): any[];
1720
+ declare module "wordcloud/stopwords/index" {
1721
+ export var textHelper: {
1722
+ getStopWords: (locale?: string) => string[];
1723
+ };
1133
1724
  }
1134
-
1135
- export class BooleanModel extends SelectBase {
1136
- protected chartTypes: string[];
1137
- chartType: string;
1138
- constructor(question: Question, data: Array<{
1139
- [index: string]: any;
1140
- }>, options?: Object, name?: string);
1141
- get booleanQuestion(): QuestionBooleanModel;
1142
- static trueColor: string;
1143
- static falseColor: string;
1144
- getSelectedItemByText(itemText: string): ItemValue;
1145
- getValues(): Array<any>;
1146
- getLabels(): Array<string>;
1725
+ declare module "wordcloud/wordcloud" {
1726
+ import { Question } from "survey-core";
1727
+ import { VisualizerBase } from "visualizerBase";
1728
+ export class WordCloudAdapter {
1729
+ private model;
1730
+ private _wordcloud;
1731
+ static drawOutOfBound: boolean;
1732
+ static shrinkToFit: boolean;
1733
+ static abortThreshold: any;
1734
+ static weightFactor: number;
1735
+ constructor(model: WordCloud);
1736
+ get wordcloud(): any;
1737
+ create(node: HTMLElement): any;
1738
+ destroy(node: HTMLElement): void;
1739
+ }
1740
+ export class WordCloud extends VisualizerBase {
1741
+ private _wordcloudAdapter;
1742
+ constructor(question: Question, data: Array<{
1743
+ [index: string]: any;
1744
+ }>, options?: Object, name?: string);
1745
+ getData(): (string | number)[][];
1746
+ protected destroyContent(container: HTMLElement): void;
1747
+ protected renderContent(container: HTMLElement): void;
1748
+ destroy(): void;
1749
+ }
1147
1750
  }
1148
-
1149
- export class MatrixDropdownGrouped extends SelectBase {
1150
- constructor(question: Question, data: Array<{
1151
- [index: string]: any;
1152
- }>, options?: Object, name?: string);
1153
- protected get matrixQuestion(): QuestionMatrixDropdownModel;
1154
- get dataName(): string | Array<string>;
1155
- getSeriesValues(): Array<string>;
1156
- getSeriesLabels(): Array<string>;
1157
- valuesSource(): Array<ItemValue>;
1158
- protected isSupportMissingAnswers(): boolean;
1159
- getData(): any[];
1751
+ declare module "text" {
1752
+ import { Question } from "survey-core";
1753
+ import { VisualizerBase } from "visualizerBase";
1754
+ import "./text.scss";
1755
+ export class TextTableAdapter {
1756
+ private model;
1757
+ constructor(model: Text);
1758
+ create(container: HTMLElement): void;
1759
+ destroy(node: HTMLElement): void;
1760
+ }
1761
+ export class Text extends VisualizerBase {
1762
+ private _textTableAdapter;
1763
+ constructor(question: Question, data: Array<{
1764
+ [index: string]: any;
1765
+ }>, options?: Object, name?: string);
1766
+ getData(): {
1767
+ columnsCount: number;
1768
+ data: string[][];
1769
+ };
1770
+ protected destroyContent(container: HTMLElement): void;
1771
+ protected renderContent(container: HTMLElement): void;
1772
+ destroy(): void;
1773
+ }
1160
1774
  }
1161
-
1162
- export class HistogramModel extends SelectBase {
1163
- protected valueType: "date" | "number";
1164
- protected chartTypes: string[];
1165
- chartType: string;
1166
- static IntervalsCount: number;
1167
- static UseIntervalsFrom: number;
1168
- constructor(question: Question, data: Array<{
1169
- [index: string]: any;
1170
- }>, options?: Object, name?: string);
1171
- getContiniousValue(value: any): number;
1172
- getString(value: number): string;
1173
- getSelectedItemByText(itemText: string): ItemValue;
1174
- /**
1175
- * Updates visualizer data.
1176
- */
1177
- updateData(data: Array<{
1178
- [index: string]: any;
1179
- }>): void;
1180
- protected onDataChanged(): void;
1181
- protected getContiniousValues(): {
1182
- original: any;
1183
- continious: number;
1184
- }[];
1185
- protected isSupportMissingAnswers(): boolean;
1186
- getValues(): Array<any>;
1187
- getLabels(): Array<string>;
1188
- get hasCustomIntervals(): boolean;
1189
- get intervals(): any;
1190
- getData(): any;
1775
+ declare module "choices-table" {
1776
+ import { Question } from "survey-core";
1777
+ import { SelectBase } from "selectBase";
1778
+ import "./choices-table.scss";
1779
+ export class ChoicesTableAdapter {
1780
+ private model;
1781
+ constructor(model: ChoicesTable);
1782
+ create(container: HTMLElement): void;
1783
+ destroy(node: HTMLElement): void;
1784
+ }
1785
+ export class ChoicesTable extends SelectBase {
1786
+ private _choicesTableAdapter;
1787
+ constructor(question: Question, data: Array<{
1788
+ [index: string]: any;
1789
+ }>, options?: Object, name?: string);
1790
+ protected destroyContent(container: HTMLElement): void;
1791
+ protected renderContent(container: HTMLElement): void;
1792
+ destroy(): void;
1793
+ }
1191
1794
  }
1192
-
1193
- export class NumberModel extends VisualizerBase {
1194
- static stepsCount: number;
1195
- static generateTextsCallback: (question: Question, maxValue: number, minValue: number, stepsCount: number, texts: string[]) => string[];
1196
- protected chartTypes: Array<string>;
1197
- chartType: String;
1198
- static showAsPercentage: boolean;
1199
- constructor(question: Question, data: Array<{
1200
- [index: string]: any;
1201
- }>, options?: {
1202
- [index: string]: any;
1203
- }, name?: string);
1204
- protected onDataChanged(): void;
1205
- protected onChartTypeChanged(): void;
1206
- protected setChartType(chartType: string): void;
1207
- destroy(): void;
1208
- generateText(maxValue: number, minValue: number, stepsCount: number): any;
1209
- generateValues(maxValue: number, stepsCount: number): any[];
1210
- generateColors(maxValue: number, minValue: number, stepsCount: number): any[];
1211
- getData(): number[];
1795
+ declare module "entries/summary" {
1796
+ export * from "localizationManager";
1797
+ import "localization/farsi";
1798
+ import "localization/french";
1799
+ import "localization/norwegian";
1800
+ import "localization/portuguese";
1801
+ import "localization/russian";
1802
+ import "localization/dutch";
1803
+ import "localization/spanish";
1804
+ import "localization/italian";
1805
+ export * from "dataProvider";
1806
+ export * from "number";
1807
+ export * from "selectBase";
1808
+ export * from "matrix";
1809
+ export * from "boolean";
1810
+ export * from "histogram";
1811
+ export * from "visualizerBase";
1812
+ export * from "visualizationManager";
1813
+ export * from "visualizationPanel";
1814
+ export * from "visualizationPanelDynamic";
1815
+ export * from "visualizationMatrixDynamic";
1816
+ export * from "visualizationMatrixDropdown";
1817
+ export * from "alternativeVizualizersWrapper";
1818
+ export * from "plotly/index";
1819
+ export * from "wordcloud/wordcloud";
1820
+ export * from "wordcloud/stopwords/index";
1821
+ export * from "text";
1822
+ export * from "choices-table";
1823
+ export { DocumentHelper } from "utils/index";
1212
1824
  }
1213
-
1214
-
1825
+ declare module 'survey-analytics' { import main = require('entries/summary'); export = main; }