survey-analytics 1.9.89 → 1.9.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE +2 -2
  2. package/package.json +6 -20
  3. package/survey-analytics-datatables.types/analytics-localization/arabic.d.ts +66 -0
  4. package/survey-analytics-datatables.types/analytics-localization/dutch.d.ts +49 -0
  5. package/survey-analytics-datatables.types/analytics-localization/english.d.ts +70 -0
  6. package/survey-analytics-datatables.types/analytics-localization/farsi.d.ts +20 -0
  7. package/survey-analytics-datatables.types/analytics-localization/french.d.ts +46 -0
  8. package/survey-analytics-datatables.types/analytics-localization/german.d.ts +52 -0
  9. package/survey-analytics-datatables.types/analytics-localization/norwegian.d.ts +39 -0
  10. package/survey-analytics-datatables.types/analytics-localization/portuguese.d.ts +70 -0
  11. package/survey-analytics-datatables.types/analytics-localization/russian.d.ts +34 -0
  12. package/survey-analytics-datatables.types/entries/datatables.d.ts +17 -0
  13. package/survey-analytics-datatables.types/localizationManager.d.ts +85 -0
  14. package/survey-analytics-datatables.types/tables/columnbuilder.d.ts +38 -0
  15. package/survey-analytics-datatables.types/tables/columns.d.ts +71 -0
  16. package/survey-analytics-datatables.types/tables/config.d.ts +39 -0
  17. package/survey-analytics-datatables.types/tables/datatables.d.ts +51 -0
  18. package/survey-analytics-datatables.types/tables/extensions/columnextensions.d.ts +1 -0
  19. package/survey-analytics-datatables.types/tables/extensions/detailsextensions.d.ts +13 -0
  20. package/survey-analytics-datatables.types/tables/extensions/headerextensions.d.ts +1 -0
  21. package/survey-analytics-datatables.types/tables/extensions/rowextensions.d.ts +1 -0
  22. package/survey-analytics-datatables.types/tables/extensions/tableextensions.d.ts +22 -0
  23. package/survey-analytics-datatables.types/tables/table.d.ts +153 -0
  24. package/survey-analytics-datatables.types/utils/index.d.ts +37 -0
  25. package/survey-analytics-tabulator.types/analytics-localization/arabic.d.ts +66 -0
  26. package/survey-analytics-tabulator.types/analytics-localization/dutch.d.ts +49 -0
  27. package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +70 -0
  28. package/survey-analytics-tabulator.types/analytics-localization/farsi.d.ts +20 -0
  29. package/survey-analytics-tabulator.types/analytics-localization/french.d.ts +46 -0
  30. package/survey-analytics-tabulator.types/analytics-localization/german.d.ts +52 -0
  31. package/survey-analytics-tabulator.types/analytics-localization/norwegian.d.ts +39 -0
  32. package/survey-analytics-tabulator.types/analytics-localization/portuguese.d.ts +70 -0
  33. package/survey-analytics-tabulator.types/analytics-localization/russian.d.ts +34 -0
  34. package/survey-analytics-tabulator.types/entries/tabulator.d.ts +17 -0
  35. package/survey-analytics-tabulator.types/localizationManager.d.ts +85 -0
  36. package/survey-analytics-tabulator.types/tables/columnbuilder.d.ts +38 -0
  37. package/survey-analytics-tabulator.types/tables/columns.d.ts +71 -0
  38. package/survey-analytics-tabulator.types/tables/config.d.ts +39 -0
  39. package/survey-analytics-tabulator.types/tables/custom_jspdf_font.d.ts +1 -0
  40. package/survey-analytics-tabulator.types/tables/extensions/columnextensions.d.ts +1 -0
  41. package/survey-analytics-tabulator.types/tables/extensions/detailsextensions.d.ts +13 -0
  42. package/survey-analytics-tabulator.types/tables/extensions/headerextensions.d.ts +1 -0
  43. package/survey-analytics-tabulator.types/tables/extensions/rowextensions.d.ts +1 -0
  44. package/survey-analytics-tabulator.types/tables/extensions/tableextensions.d.ts +22 -0
  45. package/survey-analytics-tabulator.types/tables/table.d.ts +153 -0
  46. package/survey-analytics-tabulator.types/tables/tabulator.d.ts +83 -0
  47. package/survey-analytics-tabulator.types/utils/index.d.ts +37 -0
  48. package/survey-analytics.types/alternativeVizualizersWrapper.d.ts +41 -0
  49. package/survey-analytics.types/analytics-localization/arabic.d.ts +66 -0
  50. package/survey-analytics.types/analytics-localization/dutch.d.ts +49 -0
  51. package/survey-analytics.types/analytics-localization/english.d.ts +70 -0
  52. package/survey-analytics.types/analytics-localization/farsi.d.ts +20 -0
  53. package/survey-analytics.types/analytics-localization/french.d.ts +46 -0
  54. package/survey-analytics.types/analytics-localization/german.d.ts +52 -0
  55. package/survey-analytics.types/analytics-localization/italian.d.ts +69 -0
  56. package/survey-analytics.types/analytics-localization/norwegian.d.ts +39 -0
  57. package/survey-analytics.types/analytics-localization/portuguese.d.ts +70 -0
  58. package/survey-analytics.types/analytics-localization/russian.d.ts +34 -0
  59. package/survey-analytics.types/analytics-localization/spanish.d.ts +51 -0
  60. package/survey-analytics.types/boolean.d.ts +16 -0
  61. package/survey-analytics.types/choices-table.d.ts +17 -0
  62. package/survey-analytics.types/config.d.ts +38 -0
  63. package/survey-analytics.types/dataProvider.d.ts +40 -0
  64. package/survey-analytics.types/entries/summary.d.ts +30 -0
  65. package/survey-analytics.types/filterInfo.d.ts +11 -0
  66. package/survey-analytics.types/histogram.d.ts +38 -0
  67. package/survey-analytics.types/layoutEngine.d.ts +40 -0
  68. package/survey-analytics.types/localizationManager.d.ts +85 -0
  69. package/survey-analytics.types/matrix.d.ts +17 -0
  70. package/survey-analytics.types/matrixDropdownGrouped.d.ts +14 -0
  71. package/survey-analytics.types/number.d.ts +25 -0
  72. package/survey-analytics.types/plotly/boolean.d.ts +16 -0
  73. package/survey-analytics.types/plotly/histogram.d.ts +12 -0
  74. package/survey-analytics.types/plotly/index.d.ts +8 -0
  75. package/survey-analytics.types/plotly/matrix.d.ts +11 -0
  76. package/survey-analytics.types/plotly/matrixdropdown-grouped.d.ts +11 -0
  77. package/survey-analytics.types/plotly/ranking.d.ts +7 -0
  78. package/survey-analytics.types/plotly/rating.d.ts +20 -0
  79. package/survey-analytics.types/plotly/selectBase.d.ts +24 -0
  80. package/survey-analytics.types/plotly/setup.d.ts +29 -0
  81. package/survey-analytics.types/selectBase.d.ts +112 -0
  82. package/survey-analytics.types/text.d.ts +21 -0
  83. package/survey-analytics.types/utils/index.d.ts +37 -0
  84. package/survey-analytics.types/visualizationManager.d.ts +52 -0
  85. package/survey-analytics.types/visualizationMatrixDropdown.d.ts +23 -0
  86. package/survey-analytics.types/visualizationMatrixDynamic.d.ts +9 -0
  87. package/survey-analytics.types/visualizationPanel.d.ts +371 -0
  88. package/survey-analytics.types/visualizationPanelDynamic.d.ts +23 -0
  89. package/survey-analytics.types/visualizerBase.d.ts +257 -0
  90. package/survey-analytics.types/visualizerFactory.d.ts +20 -0
  91. package/survey-analytics.types/wordcloud/stopwords/dutch.d.ts +1 -0
  92. package/survey-analytics.types/wordcloud/stopwords/english.d.ts +1 -0
  93. package/survey-analytics.types/wordcloud/stopwords/index.d.ts +3 -0
  94. package/survey-analytics.types/wordcloud/stopwords/norwegian.d.ts +1 -0
  95. package/survey-analytics.types/wordcloud/stopwords/spanish.d.ts +1 -0
  96. package/survey-analytics.types/wordcloud/wordcloud.d.ts +25 -0
  97. package/survey.analytics.css +1 -1
  98. package/survey.analytics.d.ts +1 -2133
  99. package/survey.analytics.datatables/index.d.ts.d.ts +891 -0
  100. package/survey.analytics.datatables/survey.analytics.datatables.css +325 -0
  101. package/survey.analytics.datatables/survey.analytics.datatables.js +38982 -0
  102. package/survey.analytics.datatables/survey.analytics.datatables.min.css +7 -0
  103. package/survey.analytics.datatables/survey.analytics.datatables.min.js +29 -0
  104. package/survey.analytics.datatables.css +1 -1
  105. package/survey.analytics.datatables.d.ts +1 -1012
  106. package/survey.analytics.datatables.js +1 -1
  107. package/survey.analytics.datatables.min.css +1 -1
  108. package/survey.analytics.datatables.min.js +1 -1
  109. package/survey.analytics.js +40 -2
  110. package/survey.analytics.min.css +1 -1
  111. package/survey.analytics.min.js +1 -1
  112. package/survey.analytics.tabulator.css +1 -1
  113. package/survey.analytics.tabulator.d.ts +1 -1047
  114. package/survey.analytics.tabulator.js +1 -1
  115. package/survey.analytics.tabulator.min.css +1 -1
  116. package/survey.analytics.tabulator.min.js +1 -1
@@ -0,0 +1,371 @@
1
+ import { Event, SurveyModel } from "survey-core";
2
+ import { VisualizerBase } from "./visualizerBase";
3
+ import { AlternativeVisualizersWrapper } from "./alternativeVizualizersWrapper";
4
+ import { IVisualizerPanelElement, IState, IPermission } from "./config";
5
+ import { LayoutEngine } from "./layoutEngine";
6
+ import { DataProvider } from "./dataProvider";
7
+ export interface IVisualizerPanelRenderedElement extends IVisualizerPanelElement {
8
+ renderedElement?: HTMLElement;
9
+ }
10
+ /**
11
+ * Visualization Panel configuration. Pass it as the third argument to the [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel) constructor:
12
+ *
13
+ * ```js
14
+ * import { VisualizationPanel } from "survey-analytics";
15
+ *
16
+ * const vizPanel = new VisualizationPanel(
17
+ * surveyQuestions,
18
+ * surveyResults,
19
+ * vizPanelOptions
20
+ * );
21
+ * ```
22
+ */
23
+ export interface IVisualizationPanelOptions {
24
+ /**
25
+ * The number of label characters after which truncation starts.
26
+ *
27
+ * Set this property to -1 to disable truncation.
28
+ *
29
+ * Default value: 27
30
+ */
31
+ labelTruncateLength?: number;
32
+ allowMakeQuestionsPrivate?: boolean;
33
+ seriesValues?: string[];
34
+ seriesLabels?: string[];
35
+ useValuesAsLabels?: boolean;
36
+ /**
37
+ * Pass a survey instance to use survey locales in the Visualization Panel.
38
+ */
39
+ survey?: SurveyModel;
40
+ /**
41
+ * A common data provider for all visualizers.
42
+ */
43
+ dataProvider?: DataProvider;
44
+ /**
45
+ * Allows users to change the visibility of individual charts.
46
+ *
47
+ * This property adds a Hide button to each chart.
48
+ *
49
+ * Default value: `true`
50
+ */
51
+ allowHideQuestions?: boolean;
52
+ /**
53
+ * Specifies whether to arrange charts based on the available screen space and allow users to reorder them via drag and drop.
54
+ *
55
+ * If this property is disabled, charts are displayed one under the other and users cannot reorder them.
56
+ *
57
+ * Default value: `true`
58
+ *
59
+ * [View Demo](https://surveyjs.io/Examples/Analytics?id=custom-layout (linkStyle))
60
+ *
61
+ * @see layoutEngine
62
+ */
63
+ allowDynamicLayout?: boolean;
64
+ /**
65
+ * A layout engine used to arrange charts on the Visualization Panel.
66
+ *
67
+ * You can use this property to integrate a third-party layout engine with SurveyJS Dashboard.
68
+ *
69
+ * @see allowDynamicLayout
70
+ */
71
+ layoutEngine?: LayoutEngine;
72
+ /**
73
+ * Allows users to switch between absolute and percentage values in bar charts.
74
+ *
75
+ * This property adds a Show Percentages button to each bar chart.
76
+ *
77
+ * Default value: `false`
78
+ *
79
+ * @see showPercentages
80
+ * @see showOnlyPercentages
81
+ * @see percentagePrecision
82
+ */
83
+ allowShowPercentages?: boolean;
84
+ /**
85
+ * Specifies whether bar charts display percentages in addition to absolute values.
86
+ *
87
+ * Users can change this property value if you enable the `allowShowPercentages` property.
88
+ *
89
+ * Default value: `false`
90
+ *
91
+ * @see allowShowPercentages
92
+ * @see showOnlyPercentages
93
+ * @see percentagePrecision
94
+ */
95
+ showPercentages?: boolean;
96
+ /**
97
+ * Specifies whether bar charts display only percentages, without absolute values.
98
+ *
99
+ * Applies only if the `allowShowPercentages` or `showPercentages` property is enabled.
100
+ *
101
+ * Default value: `false`
102
+ *
103
+ * @see allowShowPercentages
104
+ * @see showPercentages
105
+ * @see percentagePrecision
106
+ */
107
+ showOnlyPercentages?: boolean;
108
+ /**
109
+ * Specifies percentage precision.
110
+ *
111
+ * Default value: 0
112
+ *
113
+ * @see allowShowPercentages
114
+ * @see showPercentages
115
+ * @see showOnlyPercentages
116
+ */
117
+ percentagePrecision?: number;
118
+ /**
119
+ * Removes the Free Trial bar.
120
+ *
121
+ * Default value: `false`
122
+ *
123
+ * > You can enable this property only if you have a SurveyJS Dashboard commercial license. It is illegal to enable this property without a license.
124
+ */
125
+ haveCommercialLicense?: boolean;
126
+ /**
127
+ * Allows users to sort answers by answer count. Applies only to bar and scatter charts.
128
+ *
129
+ * This property adds a Sorting dropdown to each bar and scatter chart.
130
+ *
131
+ * Default value: `true`
132
+ *
133
+ * @see answersOrder
134
+ */
135
+ allowChangeAnswersOrder?: boolean;
136
+ /**
137
+ * Specifies how to sort answers in bar and scatter charts.
138
+ * Accepted values:
139
+ *
140
+ * - `"default"` (default) - Do not sort answers.
141
+ * - `"asc"` - Sort answers by ascending answer count.
142
+ * - `"desc"` - Sort answers by descending answer count.
143
+ *
144
+ * Users can change this property value if you enable the `allowChangeAnswersOrder` property.
145
+ *
146
+ * @see allowChangeAnswersOrder
147
+ */
148
+ answersOrder?: "default" | "asc" | "desc";
149
+ /**
150
+ * Allows users to hide answers with zero count in bar and scatter charts.
151
+ *
152
+ * This property adds a Hide Empty Answers button to each bar and scatter chart.
153
+ *
154
+ * Default value: `false`
155
+ */
156
+ allowHideEmptyAnswers?: boolean;
157
+ /**
158
+ * Hides answers with zero count in bar and scatter charts.
159
+ *
160
+ * Users can change this property value if you enable the `allowHideEmptyAnswers` property.
161
+ *
162
+ * Default value: `false`
163
+ *
164
+ * @see allowHideEmptyAnswers
165
+ */
166
+ hideEmptyAnswers?: boolean;
167
+ /**
168
+ * Allows users to select whether to show top 5, 10, or 20 answers by answer count.
169
+ *
170
+ * This property adds a Top N Answers dropdown to each chart.
171
+ *
172
+ * Default value: `false`
173
+ */
174
+ allowTopNAnswers?: boolean;
175
+ /**
176
+ * Allows users to show the number of respondents who did not answer a particular question.
177
+ *
178
+ * This property adds a Show Missing Answers button to each chart.
179
+ *
180
+ * Default value: `false`
181
+ */
182
+ allowShowMissingAnswers?: boolean;
183
+ allowExperimentalFeatures?: boolean;
184
+ /**
185
+ * Default chart type.
186
+ *
187
+ * Accepted values depend on the question type as follows:
188
+ *
189
+ * - Boolean: `"bar"` | `"pie"` | `"doughnut"`
190
+ * - Date, Number: `"bar"` | `"scatter"`
191
+ * - Matrix: `"bar"` | `"pie"` | `"doughnut"` | `"stackedbar"`
192
+ * - Rating: `"bar"` | `"scatter"` | `"gauge"` | `"bullet"`
193
+ * - Radiogroup, Checkbox, Dropdown, Image Picker: `"bar"` | `"pie"` | `"doughnut"` | `"scatter"`
194
+ *
195
+ * 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:
196
+ *
197
+ * ```js
198
+ * const vizPanel = new SurveyAnalytics.VisualizationPanel( ... );
199
+ * vizPanel.visualizers[0].chartType = "stackedbar";
200
+ * ```
201
+ *
202
+ */
203
+ defaultChartType?: string;
204
+ /**
205
+ * Allows users to transpose a visualized matrix question.
206
+ *
207
+ * 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.
208
+ *
209
+ * Default value: `false`
210
+ */
211
+ allowTransposeData?: boolean;
212
+ /**
213
+ * Allows users to cross-filter charts. The filter applies when users select a series point.
214
+ *
215
+ * Default value: `true`
216
+ */
217
+ allowSelection?: boolean;
218
+ renderContent?: Function;
219
+ destroyContent?: Function;
220
+ /**
221
+ * Removes HTML tags from survey element titles.
222
+ *
223
+ * 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`.
224
+ *
225
+ * Default value: `true`
226
+ */
227
+ stripHtmlFromTitles?: boolean;
228
+ }
229
+ /**
230
+ * An object that visualizes survey results and allows users to analyze them.
231
+ *
232
+ * Constructor parameters:
233
+ *
234
+ * - `questions`: Array\<[`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\>\
235
+ * Survey questions to visualize. Call `SurveyModel`'s [`getAllQuestions()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#getQuestionByName) method to access all survey questions and pass its result as the `questions` parameter.
236
+ * - `data`: `Array<any>`\
237
+ * Survey results.
238
+ * - `options`: [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions)\
239
+ * Visualization Panel configuration.
240
+ *
241
+ * [View Demo](https://surveyjs.io/dashboard/examples/interactive-survey-data-dashboard/ (linkStyle))
242
+ */
243
+ export declare class VisualizationPanel extends VisualizerBase {
244
+ protected questions: Array<any>;
245
+ private _elements;
246
+ static haveCommercialLicense: boolean;
247
+ visualizers: Array<VisualizerBase>;
248
+ private haveCommercialLicense;
249
+ private renderedQuestionsCount;
250
+ constructor(questions: Array<any>, data: Array<{
251
+ [index: string]: any;
252
+ }>, options?: IVisualizationPanelOptions, _elements?: Array<IVisualizerPanelRenderedElement>);
253
+ private onAfterRenderQuestionCallback;
254
+ /**
255
+ * An event that is raised when a user selects a different visualizer type from the Type drop-down menu.
256
+ *
257
+ * Parameters:
258
+ *
259
+ * - `sender`: `AlternativeVisualizersWrapper`\
260
+ * An object that controls altenative visualizers.
261
+ *
262
+ * - `options.visualizer`: `VisualizerBase`\
263
+ * An applied visualizer.
264
+ **/
265
+ onAlternativeVisualizerChanged: Event<(sender: AlternativeVisualizersWrapper, options: any) => any, AlternativeVisualizersWrapper, any>;
266
+ private onAlternativeVisualizerChangedCallback;
267
+ protected showElement(elementName: string): void;
268
+ protected hideElement(elementName: string): void;
269
+ protected makeElementPrivate(element: IVisualizerPanelElement): void;
270
+ protected makeElementPublic(element: IVisualizerPanelElement): void;
271
+ protected moveVisibleElement(fromVisibleIndex: number, toVisibleIndex: number): void;
272
+ protected moveElement(fromIndex: number, toIndex: number): void;
273
+ protected setBackgroundColorCore(color: string): void;
274
+ private buildVisualizers;
275
+ private destroyVisualizers;
276
+ protected setLocale(newLocale: string): void;
277
+ /**
278
+ * Returns the [`allowDynamicLayout`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowDynamicLayout) property value of the [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions) object.
279
+ */
280
+ get allowDynamicLayout(): boolean;
281
+ /**
282
+ * Returns the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property value of the [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions) object.
283
+ */
284
+ get allowHideQuestions(): boolean;
285
+ get allowMakeQuestionsPrivate(): boolean;
286
+ private _layoutEngine;
287
+ /**
288
+ * Returns a [`LayoutEngine`](https://surveyjs.io/dashboard/documentation/api-reference/layoutengine) instance used to arrange visualization items on `VisualizationPanel`.
289
+ */
290
+ get layoutEngine(): LayoutEngine;
291
+ protected buildElements(questions: any[]): IVisualizerPanelElement[];
292
+ /**
293
+ * Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about visualization items.
294
+ * @see visibleElements
295
+ * @see hiddenElements
296
+ */
297
+ getElements(): IVisualizerPanelElement[];
298
+ /**
299
+ * Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about currently visible visualization items.
300
+ *
301
+ * If you want to disallow users to hide visualization items, set the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property to `false`.
302
+ * @see hiddenElements
303
+ * @see getElements
304
+ */
305
+ get visibleElements(): IVisualizerPanelRenderedElement[];
306
+ /**
307
+ * Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about currently hidden visualization items.
308
+ *
309
+ * If you want to disallow users to hide visualization items, set the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property to `false`.
310
+ * @see visibleElements
311
+ * @see getElements
312
+ */
313
+ get hiddenElements(): IVisualizerPanelRenderedElement[];
314
+ get publicElements(): IVisualizerPanelRenderedElement[];
315
+ get privateElements(): IVisualizerPanelRenderedElement[];
316
+ protected get locales(): any;
317
+ /**
318
+ * Returns panel element description by the question name.
319
+ */
320
+ getElement(name: string): IVisualizerPanelRenderedElement;
321
+ /**
322
+ * Returns a [visualizer](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase) that visualizes a specified survey question.
323
+ * @param questionName A question [name](https://surveyjs.io/form-library/documentation/api-reference/question#name).
324
+ */
325
+ getVisualizer(questionName: string): VisualizerBase;
326
+ /**
327
+ * An event that is raised when users [move a visualization item](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowDynamicLayout) or [toggle its visibility](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions).
328
+ *
329
+ * Parameters:
330
+ *
331
+ * - `sender`: [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel)\
332
+ * A `VisualizationPanel` that raised the event.
333
+ *
334
+ * - `options.elements`: Array\<[`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement)\>\
335
+ * Information about visualization items rendered by this `VisualizationPanel`.
336
+ *
337
+ * - `options.changed`: [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement)\
338
+ * A visualization item that has been changed.
339
+ *
340
+ * - `options.reason`: `"ADDED"` | `"REMOVED"` | `"MOVED"`\
341
+ * Indicates the reason why the event has been raised.
342
+ */
343
+ onVisibleElementsChanged: Event<(sender: VisualizationPanel, options: any) => any, VisualizationPanel, any>;
344
+ protected visibleElementsChanged(element: IVisualizerPanelElement, reason: string): void;
345
+ onStateChanged: Event<(sender: VisualizationPanel, state: IState) => any, VisualizationPanel, any>;
346
+ onPermissionsChangedCallback: any;
347
+ protected renderPanelElement(element: IVisualizerPanelRenderedElement, container: HTMLElement): HTMLElement;
348
+ protected renderToolbar(container: HTMLElement): void;
349
+ renderContent(container: HTMLElement): void;
350
+ protected destroyContent(container: HTMLElement): void;
351
+ /**
352
+ * Redraws the `VisualizationPanel` and all its content.
353
+ */
354
+ refresh(): void;
355
+ layout(): void;
356
+ /**
357
+ * Filters visualized data based on a specified question name and value. This method is called when a user clicks a chart point.
358
+ * @param questionName A question [name](https://surveyjs.io/form-library/documentation/api-reference/question#name).
359
+ * @param selectedValue
360
+ * @see IVisualizationPanelOptions.allowSelection
361
+ */
362
+ setFilter(questionName: string, selectedValue: any): void;
363
+ get state(): IState;
364
+ /**
365
+ * Sets vizualization panel state.
366
+ */
367
+ set state(newState: IState);
368
+ get permissions(): IPermission[];
369
+ set permissions(permissions: IPermission[]);
370
+ destroy(): void;
371
+ }
@@ -0,0 +1,23 @@
1
+ import { VisualizerBase } from "./visualizerBase";
2
+ import { VisualizationPanel } from "./visualizationPanel";
3
+ import { Question, IQuestion } from "survey-core";
4
+ export declare class VisualizationPanelDynamic extends VisualizerBase {
5
+ protected _panelVisualizer: VisualizationPanel;
6
+ constructor(question: Question, data: Array<{
7
+ [index: string]: any;
8
+ }>, options?: {
9
+ [index: string]: any;
10
+ }, name?: string);
11
+ protected setLocale(newLocale: string): void;
12
+ private onAfterRenderPanelCallback;
13
+ get type(): string;
14
+ private updatePanelVisualizerData;
15
+ updateData(data: Array<{
16
+ [index: string]: any;
17
+ }>): void;
18
+ protected onDataChanged(): void;
19
+ getQuestions(): IQuestion[];
20
+ destroyContent(container: HTMLElement): void;
21
+ renderContent(container: HTMLElement): void;
22
+ destroy(): void;
23
+ }
@@ -0,0 +1,257 @@
1
+ import { Question } from "survey-core";
2
+ import { IDataInfo, DataProvider } from "./dataProvider";
3
+ import { Event } from "survey-core";
4
+ /**
5
+ * A base object for all visualizers. Use it to implement a custom visualizer.
6
+ *
7
+ * Constructor parameters:
8
+ *
9
+ * - `question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
10
+ * A survey question to visualize.
11
+ * - `data`: `Array<any>`\
12
+ * Survey results.
13
+ * - `options`\
14
+ * An object with the following properties:
15
+ * - `seriesValues`: `Array<String>`\
16
+ * Series values used to group data.
17
+ * - `seriesLabels`: `Array<String>`\
18
+ * Series labels to display. If this property is not set, `seriesValues` are used as labels.
19
+ * - `survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
20
+ * Pass a `SurveyModel` instance if you want to use locales from the survey JSON schema.
21
+ * - `dataProvider`: `DataProvider`\
22
+ * A data provider for this visualizer.
23
+ * - `type`: `String`\
24
+ * *(Optional)* The visualizer's type.
25
+ *
26
+ * [View Demo](https://surveyjs.io/dashboard/examples/how-to-plot-survey-data-in-custom-bar-chart/ (linkStyle))
27
+ */
28
+ export declare class VisualizerBase implements IDataInfo {
29
+ question: Question;
30
+ options: {
31
+ [index: string]: any;
32
+ };
33
+ private _type?;
34
+ private _showToolbar;
35
+ private _footerVisualizer;
36
+ private _dataProvider;
37
+ labelTruncateLength: number;
38
+ protected renderResult: HTMLElement;
39
+ protected toolbarContainer: HTMLElement;
40
+ protected headerContainer: HTMLElement;
41
+ protected contentContainer: HTMLElement;
42
+ protected footerContainer: HTMLElement;
43
+ protected _supportSelection: boolean;
44
+ static otherCommentCollapsed: boolean;
45
+ /**
46
+ * An event that is raised after the visualizer's content is rendered.
47
+ *
48
+ * Parameters:
49
+ *
50
+ * - `sender`: `VisualizerBase`\
51
+ * A `VisualizerBase` instance that raised the event.
52
+ *
53
+ * - `options.htmlElement`: `HTMLElement`\
54
+ * A page element with the visualizer's content.
55
+ * @see render
56
+ * @see refresh
57
+ **/
58
+ onAfterRender: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
59
+ protected afterRender(contentContainer: HTMLElement): void;
60
+ /**
61
+ * An event that is raised after a new locale is set.
62
+ *
63
+ * Parameters:
64
+ *
65
+ * - `sender`: `VisualizerBase`\
66
+ * A `VisualizerBase` instance that raised the event.
67
+ *
68
+ * - `options.locale`: `String`\
69
+ * The indentifier of a new locale (for example, "en").
70
+ * @see locale
71
+ */
72
+ onLocaleChanged: Event<(sender: VisualizerBase, options: {
73
+ locale: string;
74
+ }) => any, VisualizerBase, any>;
75
+ protected toolbarItemCreators: {
76
+ [name: string]: (toolbar?: HTMLDivElement) => HTMLElement;
77
+ };
78
+ constructor(question: Question, data: Array<{
79
+ [index: string]: any;
80
+ }>, options?: {
81
+ [index: string]: any;
82
+ }, _type?: string);
83
+ protected get questionOptions(): any;
84
+ protected onDataChanged(): void;
85
+ /**
86
+ * Returns the identifier of a visualized question.
87
+ */
88
+ get name(): string | Array<string>;
89
+ /**
90
+ * Indicates whether the visualizer displays a header. This property is `true` when a visualized question has a correct answer.
91
+ * @see hasFooter
92
+ */
93
+ get hasHeader(): boolean;
94
+ /**
95
+ * Indicates whether the visualizer displays a footer. This property is `true` when a visualized question has a comment.
96
+ * @see hasHeader
97
+ */
98
+ get hasFooter(): boolean;
99
+ protected createVisualizer<T = VisualizerBase>(question: Question): T;
100
+ /**
101
+ * Allows you to access the footer visualizer. Returns `undefined` if the footer is absent.
102
+ * @see hasFooter
103
+ */
104
+ get footerVisualizer(): VisualizerBase;
105
+ /**
106
+ * Indicates whether users can select series points to cross-filter charts. To allow or disallow selection, set the `allowSelection` property of the `options` object in the constructor.
107
+ */
108
+ get supportSelection(): boolean;
109
+ getSeriesValues(): Array<string>;
110
+ getSeriesLabels(): Array<string>;
111
+ getValues(): Array<any>;
112
+ getLabels(): Array<string>;
113
+ /**
114
+ * Registers a function used to create a toolbar item for this visualizer.
115
+ *
116
+ * The following code shows how to add a custom button and drop-down menu to the toolbar:
117
+ *
118
+ * ```js
119
+ * import { VisualizationPanel, DocumentHelper } from "survey-analytics";
120
+ *
121
+ * const vizPanel = new VisualizationPanel( ... );
122
+ *
123
+ * // Add a custom button to the toolbar
124
+ * visPanel.visualizers[0].registerToolbarItem("my-toolbar-button", () => {
125
+ * return DocumentHelper.createButton(
126
+ * // A button click event handler
127
+ * () => {
128
+ * alert("Custom toolbar button is clicked");
129
+ * },
130
+ * // Button caption
131
+ * "Button"
132
+ * );
133
+ * });
134
+ *
135
+ * // Add a custom drop-down menu to the toolbar
136
+ * vizPanel.visualizers[0].registerToolbarItem("my-toolbar-dropdown", () => {
137
+ * return DocumentHelper.createSelector(
138
+ * // Menu items
139
+ * [
140
+ * { value: 1, text: "One" },
141
+ * { value: 2, text: "Two" },
142
+ * { value: 3, text: "Three" }
143
+ * ],
144
+ * // A function that specifies initial selection
145
+ * (option) => false,
146
+ * // An event handler that is executed when selection is changed
147
+ * (e) => {
148
+ * alert(e.target.value);
149
+ * }
150
+ * );
151
+ * });
152
+ * ```
153
+ * @param name A custom name for the toolbar item.
154
+ * @param creator A function that accepts the toolbar and should return an `HTMLElement` with the toolbar item.
155
+ */
156
+ registerToolbarItem(name: string, creator: (toolbar?: HTMLDivElement) => HTMLElement): void;
157
+ /**
158
+ * Returns the visualizer's type.
159
+ */
160
+ get type(): string;
161
+ /**
162
+ * Returns an array of survey results used to calculate values for visualization. If a user applies a filter, the array is also filtered.
163
+ *
164
+ * To get an array of calculated and visualized values, call the [`getData()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#getData) method.
165
+ */
166
+ protected get data(): {
167
+ [index: string]: any;
168
+ }[];
169
+ protected get dataProvider(): DataProvider;
170
+ /**
171
+ * Updates visualized data.
172
+ * @param data A data array with survey results to be visualized.
173
+ */
174
+ updateData(data: Array<{
175
+ [index: string]: any;
176
+ }>): void;
177
+ onUpdate: () => void;
178
+ invokeOnUpdate(): void;
179
+ /**
180
+ * Deletes the visualizer and all its elements from the DOM.
181
+ * @see clear
182
+ */
183
+ destroy(): void;
184
+ /**
185
+ * Empties the toolbar, header, footer, and content containers.
186
+ *
187
+ * If you want to empty and delete the visualizer and all its elements from the DOM, call the [`destroy()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#destroy) method instead.
188
+ */
189
+ clear(): void;
190
+ protected createToolbarItems(toolbar: HTMLDivElement): void;
191
+ protected getCorrectAnswerText(): string;
192
+ protected destroyToolbar(container: HTMLElement): void;
193
+ protected renderToolbar(container: HTMLElement): void;
194
+ protected destroyHeader(container: HTMLElement): void;
195
+ protected destroyContent(container: HTMLElement): void;
196
+ protected renderHeader(container: HTMLElement): void;
197
+ protected renderContent(container: HTMLElement): void;
198
+ protected destroyFooter(container: HTMLElement): void;
199
+ protected renderFooter(container: HTMLElement): void;
200
+ /**
201
+ * Renders the visualizer in a specified container.
202
+ * @param targetElement An `HTMLElement` or an `id` of a page element in which you want to render the visualizer.
203
+ */
204
+ render(targetElement: HTMLElement | string): void;
205
+ /**
206
+ * Re-renders the visualizer and its content.
207
+ */
208
+ refresh(): void;
209
+ protected processText(text: string): string;
210
+ getRandomColor(): any;
211
+ private _backgroundColor;
212
+ get backgroundColor(): string;
213
+ set backgroundColor(value: string);
214
+ protected getBackgroundColorCore(): string;
215
+ protected setBackgroundColorCore(color: string): void;
216
+ static customColors: string[];
217
+ private static colors;
218
+ getColors(count?: number): any;
219
+ /**
220
+ * Gets or sets the visibility of the visualizer's toolbar.
221
+ *
222
+ * Default value: `true`
223
+ */
224
+ get showToolbar(): boolean;
225
+ set showToolbar(newValue: boolean);
226
+ /**
227
+ * Returns an array of calculated and visualized values. If a user applies a filter, the array is also filtered.
228
+ *
229
+ * To get an array of source survey results, use the [`data`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#data) property.
230
+ */
231
+ getData(): any;
232
+ /**
233
+ * Returns an object with properties that describe a current visualizer state. The properties are different for each individual visualizer.
234
+ *
235
+ * > This method is overriden in descendant classes.
236
+ * @see setState
237
+ */
238
+ getState(): any;
239
+ /**
240
+ * Sets the visualizer's state.
241
+ *
242
+ * > This method is overriden in descendant classes.
243
+ * @see getState
244
+ */
245
+ setState(state: any): void;
246
+ /**
247
+ * Gets or sets the current locale.
248
+ *
249
+ * If you want to inherit the locale from a visualized survey, assign a `SurveyModel` instance to the `survey` property of the `options` object in the constructor.
250
+ *
251
+ * If the survey is [translated into more than one language](https://surveyjs.io/form-library/examples/survey-localization/), the toolbar displays a language selection drop-down menu.
252
+ * @see onLocaleChanged
253
+ */
254
+ get locale(): string;
255
+ set locale(newLocale: string);
256
+ protected setLocale(newLocale: string): void;
257
+ }
@@ -0,0 +1,20 @@
1
+ import { Question } from "survey-core";
2
+ import { VisualizerBase } from "./visualizerBase";
3
+ /**
4
+ * An object that allows you to create individual visualizers without creating a [visualization panel](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel).
5
+ */
6
+ export declare class VisualizerFactory {
7
+ /**
8
+ * Creates a visualizer for a specified question.
9
+ *
10
+ * If a question has more than one [registered](https://surveyjs.io/dashboard/documentation/api-reference/visualizationmanager#registerVisualizer) visualizer, users can switch between them using a drop-down menu.
11
+ * @param question A question for which to create a visualizer.
12
+ * @param data A data array with survey results to be visualized.
13
+ * @param options An object with any custom properties you need within the visualizer.
14
+ */
15
+ static createVisualizer(question: Question, data: Array<{
16
+ [index: string]: any;
17
+ }>, options?: {
18
+ [index: string]: any;
19
+ }): VisualizerBase;
20
+ }
@@ -0,0 +1 @@
1
+ export declare var stopWords: string[];
@@ -0,0 +1 @@
1
+ export declare var stopWords: string[];
@@ -0,0 +1,3 @@
1
+ export declare var textHelper: {
2
+ getStopWords: (locale?: string) => string[];
3
+ };
@@ -0,0 +1 @@
1
+ export declare var stopWords: string[];