survey-analytics 2.5.14 → 3.0.0-beta.0

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 (215) hide show
  1. package/fesm/shared.mjs +754 -3179
  2. package/fesm/shared.mjs.map +1 -1
  3. package/fesm/shared2.mjs +9687 -8187
  4. package/fesm/shared2.mjs.map +1 -1
  5. package/fesm/shared3.mjs +4982 -0
  6. package/fesm/shared3.mjs.map +1 -0
  7. package/fesm/shared4.mjs +42 -0
  8. package/fesm/shared4.mjs.map +1 -0
  9. package/fesm/survey.analytics.apexcharts.mjs +1061 -0
  10. package/fesm/survey.analytics.apexcharts.mjs.map +1 -0
  11. package/fesm/survey.analytics.core.mjs +3 -3
  12. package/fesm/survey.analytics.mjs +7 -755
  13. package/fesm/survey.analytics.mjs.map +1 -1
  14. package/fesm/survey.analytics.mongo.mjs +1 -1
  15. package/fesm/survey.analytics.plotly.mjs +13 -0
  16. package/fesm/survey.analytics.plotly.mjs.map +1 -0
  17. package/fesm/survey.analytics.tabulator.mjs +335 -180
  18. package/fesm/survey.analytics.tabulator.mjs.map +1 -1
  19. package/fesm/themes/index.mjs +1942 -0
  20. package/fesm/themes/index.mjs.map +1 -0
  21. package/package.json +37 -10
  22. package/survey-analytics-plotly.types/alternativeVizualizersWrapper.d.ts +73 -0
  23. package/survey-analytics-plotly.types/analytics-localization/arabic.d.ts +100 -0
  24. package/survey-analytics-plotly.types/analytics-localization/dutch.d.ts +100 -0
  25. package/survey-analytics-plotly.types/analytics-localization/english.d.ts +130 -0
  26. package/survey-analytics-plotly.types/analytics-localization/farsi.d.ts +100 -0
  27. package/survey-analytics-plotly.types/analytics-localization/finnish.d.ts +100 -0
  28. package/survey-analytics-plotly.types/analytics-localization/french.d.ts +100 -0
  29. package/survey-analytics-plotly.types/analytics-localization/german.d.ts +100 -0
  30. package/survey-analytics-plotly.types/analytics-localization/italian.d.ts +100 -0
  31. package/survey-analytics-plotly.types/analytics-localization/japanese.d.ts +100 -0
  32. package/survey-analytics-plotly.types/analytics-localization/norwegian.d.ts +100 -0
  33. package/survey-analytics-plotly.types/analytics-localization/polish.d.ts +100 -0
  34. package/survey-analytics-plotly.types/analytics-localization/portuguese.d.ts +100 -0
  35. package/survey-analytics-plotly.types/analytics-localization/russian.d.ts +100 -0
  36. package/survey-analytics-plotly.types/analytics-localization/spanish.d.ts +100 -0
  37. package/survey-analytics-plotly.types/analytics-localization/swedish.d.ts +100 -0
  38. package/survey-analytics-plotly.types/boolean.d.ts +15 -0
  39. package/survey-analytics-plotly.types/card.d.ts +29 -0
  40. package/survey-analytics-plotly.types/chartConfig.d.ts +9 -0
  41. package/survey-analytics-plotly.types/config.d.ts +35 -0
  42. package/survey-analytics-plotly.types/dashboard.d.ts +51 -0
  43. package/survey-analytics-plotly.types/dataProvider.d.ts +69 -0
  44. package/survey-analytics-plotly.types/entries/plotly.d.ts +2 -0
  45. package/survey-analytics-plotly.types/entries/summary.core.d.ts +44 -0
  46. package/survey-analytics-plotly.types/filterInfo.d.ts +11 -0
  47. package/survey-analytics-plotly.types/histogram.d.ts +102 -0
  48. package/{survey-analytics.types/layoutEngine.d.ts → survey-analytics-plotly.types/layout-engine.d.ts} +0 -12
  49. package/survey-analytics-plotly.types/localizationManager.d.ts +152 -0
  50. package/survey-analytics-plotly.types/matrix.d.ts +17 -0
  51. package/survey-analytics-plotly.types/matrixDropdownGrouped.d.ts +15 -0
  52. package/survey-analytics-plotly.types/muuri-layout-engine.d.ts +13 -0
  53. package/survey-analytics-plotly.types/nps.d.ts +37 -0
  54. package/survey-analytics-plotly.types/number.d.ts +27 -0
  55. package/survey-analytics-plotly.types/pivot.d.ts +59 -0
  56. package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/chart-adapter.d.ts +11 -2
  57. package/survey-analytics-plotly.types/plotly/setup.d.ts +150 -0
  58. package/survey-analytics-plotly.types/ranking.d.ts +12 -0
  59. package/survey-analytics-plotly.types/selectBase.d.ts +116 -0
  60. package/survey-analytics-plotly.types/statisticCalculators.d.ts +9 -0
  61. package/survey-analytics-plotly.types/statistics-table.d.ts +28 -0
  62. package/survey-analytics-plotly.types/svgbundle.d.ts +2 -0
  63. package/survey-analytics-plotly.types/text.d.ts +25 -0
  64. package/survey-analytics-plotly.types/theme.d.ts +50 -0
  65. package/survey-analytics-plotly.types/themes/default-light.d.ts +965 -0
  66. package/survey-analytics-plotly.types/utils/calculationDateRanges.d.ts +35 -0
  67. package/survey-analytics-plotly.types/utils/dateRangeModel.d.ts +32 -0
  68. package/survey-analytics-plotly.types/utils/dateRangeWidget.d.ts +38 -0
  69. package/survey-analytics-plotly.types/utils/dropdownActionWidget.d.ts +31 -0
  70. package/survey-analytics-plotly.types/utils/dropdownBase.d.ts +47 -0
  71. package/survey-analytics-plotly.types/utils/dropdownWidget.d.ts +40 -0
  72. package/survey-analytics-plotly.types/utils/index.d.ts +62 -0
  73. package/survey-analytics-plotly.types/utils/toggle.d.ts +17 -0
  74. package/survey-analytics-plotly.types/utils/utils.d.ts +9 -0
  75. package/survey-analytics-plotly.types/visualizationComposite.d.ts +8 -0
  76. package/survey-analytics-plotly.types/visualizationManager.d.ts +60 -0
  77. package/survey-analytics-plotly.types/visualizationMatrixDropdown.d.ts +23 -0
  78. package/survey-analytics-plotly.types/visualizationMatrixDynamic.d.ts +8 -0
  79. package/survey-analytics-plotly.types/visualizationPanel.d.ts +464 -0
  80. package/survey-analytics-plotly.types/visualizationPanelDynamic.d.ts +20 -0
  81. package/survey-analytics-plotly.types/visualizerBase.d.ts +422 -0
  82. package/survey-analytics-plotly.types/visualizerDescription.d.ts +19 -0
  83. package/survey-analytics-plotly.types/visualizerFactory.d.ts +41 -0
  84. package/survey-analytics-plotly.types/wordcloud/stopwords/dutch.d.ts +1 -0
  85. package/survey-analytics-plotly.types/wordcloud/stopwords/english.d.ts +1 -0
  86. package/survey-analytics-plotly.types/wordcloud/stopwords/index.d.ts +3 -0
  87. package/survey-analytics-plotly.types/wordcloud/stopwords/norwegian.d.ts +1 -0
  88. package/survey-analytics-plotly.types/wordcloud/stopwords/spanish.d.ts +1 -0
  89. package/survey-analytics-plotly.types/wordcloud/widget.d.ts +38 -0
  90. package/survey-analytics-plotly.types/wordcloud/wordcloud.d.ts +28 -0
  91. package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +28 -0
  92. package/survey-analytics-tabulator.types/entries/tabulator.d.ts +2 -25
  93. package/survey-analytics-tabulator.types/entries/tabulator.fontless.d.ts +26 -0
  94. package/survey-analytics-tabulator.types/localizationManager.d.ts +28 -0
  95. package/survey-analytics-tabulator.types/tables/extensions/footerextensions.d.ts +1 -0
  96. package/survey-analytics-tabulator.types/tables/extensions/tableextensions.d.ts +2 -1
  97. package/survey-analytics-tabulator.types/tables/tabulator.d.ts +7 -0
  98. package/survey-analytics-tabulator.types/theme.d.ts +50 -0
  99. package/survey-analytics-tabulator.types/themes/default-light.d.ts +965 -0
  100. package/survey-analytics-tabulator.types/utils/dropdownActionWidget.d.ts +31 -0
  101. package/survey-analytics-tabulator.types/utils/dropdownBase.d.ts +47 -0
  102. package/survey-analytics-tabulator.types/utils/dropdownWidget.d.ts +40 -0
  103. package/survey-analytics-tabulator.types/utils/index.d.ts +25 -2
  104. package/survey-analytics.types/alternativeVizualizersWrapper.d.ts +9 -4
  105. package/survey-analytics.types/analytics-localization/english.d.ts +28 -0
  106. package/survey-analytics.types/apexcharts/chart-adapter.d.ts +29 -0
  107. package/survey-analytics.types/apexcharts/index.d.ts +2 -0
  108. package/survey-analytics.types/apexcharts/setup.d.ts +185 -0
  109. package/survey-analytics.types/boolean.d.ts +1 -1
  110. package/survey-analytics.types/card.d.ts +29 -0
  111. package/survey-analytics.types/chartConfig.d.ts +9 -0
  112. package/survey-analytics.types/config.d.ts +1 -33
  113. package/survey-analytics.types/dashboard.d.ts +51 -0
  114. package/survey-analytics.types/dataProvider.d.ts +17 -0
  115. package/survey-analytics.types/entries/apexcharts.d.ts +2 -0
  116. package/survey-analytics.types/entries/apexcharts.fontless.d.ts +2 -0
  117. package/survey-analytics.types/entries/summary.core.d.ts +6 -0
  118. package/survey-analytics.types/histogram.d.ts +29 -13
  119. package/survey-analytics.types/layout-engine.d.ts +29 -0
  120. package/survey-analytics.types/localizationManager.d.ts +28 -0
  121. package/survey-analytics.types/matrix.d.ts +3 -2
  122. package/survey-analytics.types/matrixDropdownGrouped.d.ts +3 -2
  123. package/survey-analytics.types/muuri-layout-engine.d.ts +13 -0
  124. package/survey-analytics.types/nps.d.ts +5 -10
  125. package/survey-analytics.types/number.d.ts +8 -7
  126. package/survey-analytics.types/pivot.d.ts +25 -35
  127. package/survey-analytics.types/ranking.d.ts +3 -2
  128. package/survey-analytics.types/selectBase.d.ts +12 -15
  129. package/survey-analytics.types/statisticCalculators.d.ts +8 -13
  130. package/survey-analytics.types/statistics-table.d.ts +2 -2
  131. package/survey-analytics.types/text.d.ts +4 -3
  132. package/survey-analytics.types/theme.d.ts +50 -0
  133. package/survey-analytics.types/themes/default-light.d.ts +965 -0
  134. package/survey-analytics.types/utils/calculationDateRanges.d.ts +35 -0
  135. package/survey-analytics.types/utils/dateRangeModel.d.ts +32 -0
  136. package/survey-analytics.types/utils/dateRangeWidget.d.ts +38 -0
  137. package/survey-analytics.types/utils/dropdownActionWidget.d.ts +31 -0
  138. package/survey-analytics.types/utils/dropdownBase.d.ts +47 -0
  139. package/survey-analytics.types/utils/dropdownWidget.d.ts +40 -0
  140. package/survey-analytics.types/utils/index.d.ts +25 -2
  141. package/survey-analytics.types/utils/toggle.d.ts +17 -0
  142. package/survey-analytics.types/utils/utils.d.ts +9 -0
  143. package/survey-analytics.types/visualizationComposite.d.ts +1 -1
  144. package/survey-analytics.types/visualizationManager.d.ts +5 -5
  145. package/survey-analytics.types/visualizationMatrixDropdown.d.ts +2 -1
  146. package/survey-analytics.types/visualizationMatrixDynamic.d.ts +1 -1
  147. package/survey-analytics.types/visualizationPanel.d.ts +20 -3
  148. package/survey-analytics.types/visualizationPanelDynamic.d.ts +2 -1
  149. package/survey-analytics.types/visualizerBase.d.ts +65 -10
  150. package/survey-analytics.types/visualizerDescription.d.ts +19 -0
  151. package/survey-analytics.types/visualizerFactory.d.ts +11 -2
  152. package/survey-analytics.types/wordcloud/wordcloud.d.ts +6 -4
  153. package/survey.analytics.core.css +1131 -99
  154. package/survey.analytics.core.css.map +1 -1
  155. package/survey.analytics.core.js +5063 -1002
  156. package/survey.analytics.core.js.map +1 -1
  157. package/survey.analytics.core.min.css +9 -6
  158. package/survey.analytics.core.min.js +1 -1
  159. package/survey.analytics.core.min.js.LICENSE.txt +1 -1
  160. package/survey.analytics.css +1494 -103
  161. package/survey.analytics.css.map +1 -1
  162. package/survey.analytics.d.ts +1 -2
  163. package/survey.analytics.fontless.css +1629 -0
  164. package/survey.analytics.fontless.css.map +1 -0
  165. package/survey.analytics.fontless.min.css +14 -0
  166. package/survey.analytics.js +7427 -3055
  167. package/survey.analytics.js.map +1 -1
  168. package/survey.analytics.min.css +11 -6
  169. package/survey.analytics.min.js +1 -1
  170. package/survey.analytics.min.js.LICENSE.txt +1 -1
  171. package/survey.analytics.mongo.js +2 -2
  172. package/survey.analytics.mongo.js.map +1 -1
  173. package/survey.analytics.mongo.min.js +1 -1
  174. package/survey.analytics.mongo.min.js.LICENSE.txt +1 -1
  175. package/survey.analytics.plotly.css +1714 -0
  176. package/survey.analytics.plotly.css.map +1 -0
  177. package/survey.analytics.plotly.d.ts +1 -0
  178. package/survey.analytics.plotly.fontless.css +1492 -0
  179. package/survey.analytics.plotly.fontless.css.map +1 -0
  180. package/survey.analytics.plotly.fontless.min.css +13 -0
  181. package/survey.analytics.plotly.js +23829 -0
  182. package/survey.analytics.plotly.js.map +1 -0
  183. package/survey.analytics.plotly.min.css +14 -0
  184. package/survey.analytics.plotly.min.js +2 -0
  185. package/survey.analytics.plotly.min.js.LICENSE.txt +22 -0
  186. package/survey.analytics.tabulator.css +992 -132
  187. package/survey.analytics.tabulator.css.map +1 -1
  188. package/survey.analytics.tabulator.fontless.css +1121 -0
  189. package/survey.analytics.tabulator.fontless.css.map +1 -0
  190. package/survey.analytics.tabulator.fontless.min.css +6 -0
  191. package/survey.analytics.tabulator.js +2608 -235
  192. package/survey.analytics.tabulator.js.map +1 -1
  193. package/survey.analytics.tabulator.min.css +3 -2
  194. package/survey.analytics.tabulator.min.js +1 -1
  195. package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
  196. package/themes/default-dark.js +1032 -0
  197. package/themes/default-dark.js.map +1 -0
  198. package/themes/default-dark.min.js +2 -0
  199. package/themes/default-dark.min.js.LICENSE.txt +5 -0
  200. package/themes/default-light.js +1032 -0
  201. package/themes/default-light.js.map +1 -0
  202. package/themes/default-light.min.js +2 -0
  203. package/themes/default-light.min.js.LICENSE.txt +5 -0
  204. package/themes/index.js +2063 -0
  205. package/themes/index.js.map +1 -0
  206. package/themes/index.min.js +2 -0
  207. package/themes/index.min.js.LICENSE.txt +5 -0
  208. package/themes/themes/default-dark.d.ts +965 -0
  209. package/themes/themes/default-light.d.ts +965 -0
  210. package/themes/themes/index.d.ts +1934 -0
  211. package/themes/utils/helpers.d.ts +8 -0
  212. package/survey-analytics.types/plotly/setup.d.ts +0 -32
  213. /package/{survey-analytics.types/entries/summary.d.ts → survey-analytics-plotly.types/entries/plotly.fontless.d.ts} +0 -0
  214. /package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/index.d.ts +0 -0
  215. /package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/legacy.d.ts +0 -0
@@ -0,0 +1,422 @@
1
+ import { Question, Event } from "survey-core";
2
+ import { DataProvider, GetDataFn } from "./dataProvider";
3
+ import { DashboardTheme, IDashboardTheme } from "./theme";
4
+ import "./visualizerBase.scss";
5
+ export interface IChartAdapter {
6
+ getChartTypes(): string[];
7
+ create(chartNode: HTMLElement): Promise<any>;
8
+ update(chartNode: HTMLElement): Promise<any>;
9
+ destroy(node: HTMLElement): void;
10
+ }
11
+ export interface ICalculatedDataInfo {
12
+ dataPath?: string;
13
+ valueNames: Array<string>;
14
+ seriesNames?: Array<string>;
15
+ getLabel?(value: string): string;
16
+ getSeriesLabel?(series: string): string;
17
+ }
18
+ export declare type ICalculationResult<T = number> = {
19
+ data: Array<Array<T>>;
20
+ values: Array<string>;
21
+ series?: Array<string>;
22
+ };
23
+ export interface IAnswersData {
24
+ datasets: Array<Array<any>>;
25
+ values: Array<string>;
26
+ labels: Array<string>;
27
+ colors: Array<string>;
28
+ texts: Array<Array<any>>;
29
+ seriesLabels: Array<string>;
30
+ labelsTitle?: string;
31
+ valuesTitle?: string;
32
+ }
33
+ export interface IDataInfo {
34
+ name: string;
35
+ dataPath?: string;
36
+ dataNames: Array<string>;
37
+ getValues(): Array<any>;
38
+ getLabels(): Array<string>;
39
+ getSeriesValues(): Array<string>;
40
+ getSeriesLabels(): Array<string>;
41
+ }
42
+ export type ToolbarItemType = "button" | "dropdown" | "filter" | "license";
43
+ type ToolbarItemCreators = {
44
+ [name: string]: {
45
+ creator: (toolbar?: HTMLDivElement) => HTMLElement;
46
+ type: ToolbarItemType;
47
+ index: number;
48
+ groupIndex: number;
49
+ };
50
+ };
51
+ export interface IVisualizerOptions {
52
+ dataField: string;
53
+ type?: string;
54
+ availableTypes?: string[];
55
+ title?: string;
56
+ allowChangeType?: boolean;
57
+ answersOrder?: "default" | "asc" | "desc";
58
+ [key: string]: any;
59
+ }
60
+ export declare class PostponeHelper {
61
+ static postponeFunction: (fn: () => void, timeout?: number) => any;
62
+ static postpone(fn: () => void, timeout?: number): any;
63
+ }
64
+ /**
65
+ * A base object for all visualizers. Use it to implement a custom visualizer.
66
+ *
67
+ * Constructor parameters:
68
+ *
69
+ * - `question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
70
+ * A survey question to visualize.
71
+ * - `data`: `Array<any>`\
72
+ * Survey results.
73
+ * - `options`\
74
+ * An object with the following properties:
75
+ * - `dataProvider`: `DataProvider`\
76
+ * A data provider for this visualizer.
77
+ * - `renderContent`: `(contentContainer: HTMLElement, visualizer: VisualizerBase) => void`\
78
+ * A function that renders the visualizer's HTML markup. Append the markup to `contentContainer`.
79
+ * - `survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
80
+ * Pass a `SurveyModel` instance if you want to use locales from the survey JSON schema.
81
+ * - `seriesValues`: `Array<string>`\
82
+ * Series values used to group data.
83
+ * - `seriesLabels`: `Array<string>`\
84
+ * Series labels to display. If this property is not set, `seriesValues` are used as labels.
85
+ * - `type`: `string`\
86
+ * *(Optional)* The visualizer's type.
87
+ *
88
+ * [View Demo](https://surveyjs.io/dashboard/examples/how-to-plot-survey-data-in-custom-bar-chart/ (linkStyle))
89
+ */
90
+ export declare class VisualizerBase implements IDataInfo {
91
+ question: Question;
92
+ options: {
93
+ [index: string]: any;
94
+ };
95
+ private _type?;
96
+ static haveCommercialLicense: boolean;
97
+ static suppressVisualizerStubRendering: boolean;
98
+ static chartAdapterType: any;
99
+ private _appliedTheme;
100
+ private _theme;
101
+ private _showToolbar;
102
+ private _footerVisualizer;
103
+ private _dataProvider;
104
+ private _getDataCore;
105
+ labelTruncateLength: number;
106
+ protected haveCommercialLicense: boolean;
107
+ protected renderResult: HTMLElement;
108
+ protected toolbarContainer: HTMLElement;
109
+ protected headerContainer: HTMLElement;
110
+ protected contentContainer: HTMLElement;
111
+ protected footerContainer: HTMLElement;
112
+ protected _supportSelection: boolean;
113
+ protected _chartAdapter: IChartAdapter;
114
+ static otherCommentCollapsed: boolean;
115
+ protected _footerIsCollapsed: boolean;
116
+ /**
117
+ * An event that is raised after the visualizer's content is rendered.
118
+ *
119
+ * Parameters:
120
+ *
121
+ * - `sender`: `VisualizerBase`\
122
+ * A `VisualizerBase` instance that raised the event.
123
+ *
124
+ * - `options.htmlElement`: `HTMLElement`\
125
+ * A page element with the visualizer's content.
126
+ * @see render
127
+ * @see refresh
128
+ **/
129
+ onAfterRender: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
130
+ protected afterRender(contentContainer: HTMLElement): void;
131
+ /**
132
+ * An event that is raised after a new locale is set.
133
+ *
134
+ * Parameters:
135
+ *
136
+ * - `sender`: `VisualizerBase`\
137
+ * A `VisualizerBase` instance that raised the event.
138
+ *
139
+ * - `options.locale`: `string`\
140
+ * The indentifier of a new locale (for example, "en").
141
+ * @see locale
142
+ */
143
+ onLocaleChanged: Event<(sender: VisualizerBase, options: {
144
+ locale: string;
145
+ }) => any, VisualizerBase, any>;
146
+ /**
147
+ * An event that is raised when the visualizer's state has changed.
148
+ *
149
+ * The state includes selected chart types, chart layout, sorting, filtering, and other customizations that a user has made while using the dashboard. Handle the `onStateChanged` event to save these customizations, for example, in `localStorage` and restore them when the user reloads the page.
150
+ *
151
+ * Parameters:
152
+ *
153
+ * - `sender`: `VisualizerBase`\
154
+ * A `VisualizerBase` instance that raised the event.
155
+ *
156
+ * - `state`: `any`\
157
+ * A new state of the visualizer. Includes information about the visualized elements and current locale.
158
+ *
159
+ * [View Demo](https://surveyjs.io/dashboard/examples/save-dashboard-state-to-local-storage/ (linkStyle))
160
+ * @see getState
161
+ * @see setState
162
+ */
163
+ onStateChanged: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
164
+ protected stateChanged(name: string, value: any): void;
165
+ protected toolbarItemCreators: ToolbarItemCreators;
166
+ onGetToolbarItemCreators: () => ToolbarItemCreators;
167
+ protected getToolbarItemCreators(): ToolbarItemCreators;
168
+ constructor(question: Question, data: Array<{
169
+ [index: string]: any;
170
+ }> | GetDataFn, options?: {
171
+ [index: string]: any;
172
+ }, _type?: string);
173
+ protected get questionOptions(): any;
174
+ protected onDataChanged(): void;
175
+ protected getName(): string;
176
+ protected get allowChangeType(): any;
177
+ /**
178
+ * Returns the identifier of a visualized question.
179
+ */
180
+ get name(): string;
181
+ get dataNames(): Array<string>;
182
+ get dataPath(): string;
183
+ /**
184
+ * Indicates whether the visualizer displays a header. This property is `true` when a visualized question has a correct answer.
185
+ * @see hasFooter
186
+ */
187
+ get hasHeader(): boolean;
188
+ /**
189
+ * Indicates whether the visualizer displays a footer. This property is `true` when a visualized question has a comment.
190
+ * @see hasHeader
191
+ */
192
+ get hasFooter(): boolean;
193
+ protected createVisualizer<T = VisualizerBase>(question: Question, options?: {
194
+ [index: string]: any;
195
+ }, data?: any[]): T;
196
+ /**
197
+ * Allows you to access the footer visualizer. Returns `undefined` if the footer is absent.
198
+ * @see hasFooter
199
+ */
200
+ get footerVisualizer(): VisualizerBase;
201
+ /**
202
+ * Indicates whether users can select series points to cross-filter charts. To allow or disallow selection, set the [`allowSelection`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowSelection) property of the `IVisualizationPanelOptions` object in the [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel) constructor.
203
+ */
204
+ get supportSelection(): boolean;
205
+ getSeriesValues(): Array<string>;
206
+ getSeriesLabels(): Array<string>;
207
+ getValues(): Array<any>;
208
+ getLabels(): Array<string>;
209
+ getChartAdapter(): IChartAdapter;
210
+ /**
211
+ * Registers a function used to create a toolbar item for this visualizer.
212
+ *
213
+ * The following code shows how to add a custom button and drop-down menu to the toolbar:
214
+ *
215
+ * ```js
216
+ * import { VisualizationPanel, DocumentHelper } from "survey-analytics";
217
+ *
218
+ * const vizPanel = new VisualizationPanel( ... );
219
+ *
220
+ * // Add a custom button to the toolbar
221
+ * vizPanel.visualizers[0].registerToolbarItem("my-toolbar-button", () => {
222
+ * return DocumentHelper.createButton(
223
+ * // A button click event handler
224
+ * () => {
225
+ * alert("Custom toolbar button is clicked");
226
+ * },
227
+ * // Button caption
228
+ * "Button"
229
+ * );
230
+ * });
231
+ *
232
+ * // Add a custom drop-down menu to the toolbar
233
+ * vizPanel.visualizers[0].registerToolbarItem("my-toolbar-dropdown", () => {
234
+ * return DocumentHelper.createSelector(
235
+ * // Menu items
236
+ * [
237
+ * { value: 1, text: "One" },
238
+ * { value: 2, text: "Two" },
239
+ * { value: 3, text: "Three" }
240
+ * ],
241
+ * // A function that specifies initial selection
242
+ * (option) => false,
243
+ * // An event handler that is executed when selection is changed
244
+ * (e) => {
245
+ * alert(e.target.value);
246
+ * }
247
+ * );
248
+ * });
249
+ * ```
250
+ * @param name A custom name for the toolbar item.
251
+ * @param creator A function that accepts the toolbar and should return an `HTMLElement` with the toolbar item.
252
+ * @see unregisterToolbarItem
253
+ */
254
+ registerToolbarItem(name: string, creator: (toolbar?: HTMLDivElement) => HTMLElement, type: ToolbarItemType, index?: number, groupIndex?: number): void;
255
+ /**
256
+ *
257
+ * Unregisters a function used to create a toolbar item. Allows you to remove a toolbar item.
258
+ * @param name A toolbar item name.
259
+ * @returns A function previously used to [register](#registerToolbarItem) the removed toolbar item.
260
+ * @see registerToolbarItem
261
+ */
262
+ unregisterToolbarItem(name: string): (toolbar?: HTMLDivElement) => HTMLElement;
263
+ /**
264
+ * Returns the visualizer's title.
265
+ */
266
+ get title(): string;
267
+ protected getTitle(question: Question): string;
268
+ /**
269
+ * Returns the visualizer's type.
270
+ */
271
+ get type(): string;
272
+ get dataType(): string;
273
+ /**
274
+ * @deprecated Use [`surveyData`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel#surveyData) instead.
275
+ */
276
+ protected get data(): any[];
277
+ /**
278
+ * Returns an array of survey results used to calculate values for visualization. If a user applies a filter, the array is also filtered.
279
+ *
280
+ * To get an array of calculated and visualized values, call the [`getCalculatedValues()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#getCalculatedValues) method.
281
+ */
282
+ protected get surveyData(): any[];
283
+ protected get dataProvider(): DataProvider;
284
+ /**
285
+ * Updates visualized data.
286
+ * @param data A data array with survey results to be visualized.
287
+ */
288
+ updateData(data: Array<{
289
+ [index: string]: any;
290
+ }> | GetDataFn): void;
291
+ onUpdate: () => void;
292
+ invokeOnUpdate(): void;
293
+ /**
294
+ * Deletes the visualizer and all its elements from the DOM.
295
+ * @see clear
296
+ */
297
+ destroy(): void;
298
+ /**
299
+ * Empties the toolbar, header, footer, and content containers.
300
+ *
301
+ * 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.
302
+ */
303
+ clear(): void;
304
+ getSortedToolbarItemCreators(): Array<any>;
305
+ protected createToolbarItems(toolbar: HTMLDivElement): void;
306
+ protected getCorrectAnswerText(): string;
307
+ protected renderBanner(container: HTMLElement): void;
308
+ protected destroyToolbar(container: HTMLElement): void;
309
+ protected renderToolbar(container: HTMLElement): void;
310
+ protected destroyHeader(container: HTMLElement): void;
311
+ protected destroyContent(container: HTMLElement): void;
312
+ protected renderHeader(container: HTMLElement): void;
313
+ protected renderContentAsync(container: HTMLElement): Promise<HTMLElement>;
314
+ protected ensureQuestionIsReady(): Promise<void>;
315
+ protected renderContent(container: HTMLElement): void;
316
+ protected destroyFooter(container: HTMLElement): void;
317
+ get isFooterCollapsed(): boolean;
318
+ set isFooterCollapsed(newVal: boolean);
319
+ protected renderFooter(container: HTMLElement): void;
320
+ /**
321
+ * Renders the visualizer in a specified container.
322
+ * @param targetElement An `HTMLElement` or an `id` of a page element in which you want to render the visualizer.
323
+ */
324
+ render(targetElement: HTMLElement | string, isRoot?: boolean): void;
325
+ updateToolbar(): void;
326
+ protected isSupportSoftUpdateContent(): boolean;
327
+ protected softUpdateContent(): void;
328
+ protected hardUpdateContent(): void;
329
+ updateContent(): void;
330
+ /**
331
+ * Re-renders the visualizer and its content.
332
+ */
333
+ refresh(): void;
334
+ refreshContent(): void;
335
+ protected processText(text: string): string;
336
+ getRandomColor(): any;
337
+ private _backgroundColor;
338
+ get backgroundColor(): any;
339
+ set backgroundColor(value: any);
340
+ protected getBackgroundColorCore(): any;
341
+ protected setBackgroundColorCore(color: string): void;
342
+ protected onThemeChanged(): void;
343
+ get theme(): DashboardTheme;
344
+ set theme(theme: DashboardTheme);
345
+ applyTheme(theme: IDashboardTheme): void;
346
+ static customColors: string[];
347
+ private static colors;
348
+ static getColors(count?: number): any;
349
+ /**
350
+ * Gets or sets the visibility of the visualizer's toolbar.
351
+ *
352
+ * Default value: `true`
353
+ */
354
+ get showToolbar(): boolean;
355
+ set showToolbar(newValue: boolean);
356
+ /**
357
+ * @deprecated Use [`getCalculatedValues()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel#getCalculatedValues) instead.
358
+ */
359
+ getData(): any;
360
+ private _calculationsCache;
361
+ protected getCalculatedValuesCore(): ICalculationResult;
362
+ protected loadingData: boolean;
363
+ renderLoadingIndicator(contentContainer: HTMLElement): void;
364
+ convertFromExternalData(externalCalculatedData: any): ICalculationResult;
365
+ /**
366
+ * Returns object with all infotmation for data visualization: datasets, labels, colors, additional texts (percentage).
367
+ */
368
+ getAnswersData(): Promise<IAnswersData>;
369
+ /**
370
+ * Returns an array of calculated and visualized values. If a user applies a filter, the array is also filtered.
371
+ *
372
+ * To get an array of source survey results, use the [`surveyData`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#surveyData) property.
373
+ */
374
+ getCalculatedValues(): Promise<ICalculationResult>;
375
+ protected _settingState: boolean;
376
+ protected _defaultStateValue: any;
377
+ getDefaultState(): any;
378
+ /**
379
+ * Returns an object with properties that describe a current visualizer state. The properties are different for each individual visualizer.
380
+ *
381
+ * > This method is overriden in classes descendant from `VisualizerBase`.
382
+ * @see setState
383
+ * @see resetState
384
+ * @see onStateChanged
385
+ */
386
+ getState(): any;
387
+ protected setStateCore(state: any): void;
388
+ /**
389
+ * Sets the visualizer's state.
390
+ *
391
+ * [View Demo](https://surveyjs.io/dashboard/examples/save-dashboard-state-to-local-storage/ (linkStyle))
392
+ *
393
+ * > This method is overriden in classes descendant from `VisualizerBase`.
394
+ * @see getState
395
+ * @see resetState
396
+ * @see onStateChanged
397
+ */
398
+ setState(state: any): void;
399
+ /**
400
+ * Resets the visualizer's state.
401
+ *
402
+ * > This method is overriden in classes descendant from `VisualizerBase`.
403
+ * @see getState
404
+ * @see setState
405
+ * @see onStateChanged
406
+ */
407
+ resetState(): void;
408
+ /**
409
+ * Gets or sets the current locale.
410
+ *
411
+ * If you want to inherit the locale from a visualized survey, assign a [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model) instance to the [`survey`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#survey) property of the `IVisualizationPanelOptions` object in the [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel) constructor.
412
+ *
413
+ * 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.
414
+ *
415
+ * [View Demo](https://surveyjs.io/dashboard/examples/localize-survey-data-dashboard-ui/ (linkStyle))
416
+ * @see onLocaleChanged
417
+ */
418
+ get locale(): string;
419
+ set locale(newLocale: string);
420
+ protected setLocale(newLocale: string): void;
421
+ }
422
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Question } from "survey-core";
2
+ import { IVisualizerOptions } from "./visualizerBase";
3
+ export interface IVisualizerDescription {
4
+ visualizerType: string;
5
+ visualizerTypes?: Array<string>;
6
+ chartType?: string;
7
+ availableTypes?: any;
8
+ question?: Question;
9
+ questionName?: string;
10
+ dataName?: string;
11
+ displayValueName?: string;
12
+ title?: string;
13
+ answersOrder?: "default" | "asc" | "desc";
14
+ options?: {
15
+ [index: string]: any;
16
+ };
17
+ }
18
+ export declare function getDataName(description: Question | IVisualizerDescription): any;
19
+ export declare function createVisualizerDescription(vOptions: IVisualizerOptions, question: Question): IVisualizerDescription;
@@ -0,0 +1,41 @@
1
+ import { Question } from "survey-core";
2
+ import { VisualizerBase } from "./visualizerBase";
3
+ import { IVisualizerDescription } from "./visualizerDescription";
4
+ /**
5
+ * An object that allows you to create individual visualizers without creating a [visualization panel](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel).
6
+ */
7
+ export declare class VisualizerFactory {
8
+ /**
9
+ * Creates a visualizer for a single question.
10
+ *
11
+ * ```js
12
+ * import { VisualizerFactory } from "survey-analytics";
13
+ *
14
+ * const visualizer = new VisualizerFactory.createVisualizer(
15
+ * question,
16
+ * data,
17
+ * options
18
+ * );
19
+ *
20
+ * visualizer.render("containerId")
21
+ * ```
22
+ *
23
+ * 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.
24
+ * @param description A question for which to create a visualizer.
25
+ * @param data A data array with survey results to be visualized.
26
+ * @param options An object with any custom properties you need within the visualizer.
27
+ */
28
+ static createVisualizer(description: Question | IVisualizerDescription, data: Array<{
29
+ [index: string]: any;
30
+ }>, options?: {
31
+ [index: string]: any;
32
+ }): VisualizerBase;
33
+ static getVisualizerCreatorsByQuestion(question: Question): Array<{
34
+ typeName: string;
35
+ creator: any;
36
+ }>;
37
+ static getVisualizerCreatorsByDescription(description: IVisualizerDescription): Array<{
38
+ typeName: string;
39
+ creator: any;
40
+ }>;
41
+ }
@@ -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[];
@@ -0,0 +1 @@
1
+ export declare var stopWords: string[];
@@ -0,0 +1,38 @@
1
+ export declare const defaultOptions: {
2
+ spiralResolution: number;
3
+ spiralLimit: number;
4
+ lineHeight: number;
5
+ xWordPadding: number;
6
+ yWordPadding: number;
7
+ weightFactor: number;
8
+ topN: number;
9
+ maxHeight: number;
10
+ padding: number;
11
+ };
12
+ export declare class WordCloudWidget {
13
+ private _options;
14
+ private _words;
15
+ private _placedWords;
16
+ private _minWeight;
17
+ private _weightFactor;
18
+ private _renderedTarget;
19
+ constructor(_options?: {
20
+ spiralResolution: number;
21
+ spiralLimit: number;
22
+ lineHeight: number;
23
+ xWordPadding: number;
24
+ yWordPadding: number;
25
+ weightFactor: number;
26
+ topN: number;
27
+ maxHeight: number;
28
+ padding: number;
29
+ });
30
+ colors: string[];
31
+ get words(): Array<Array<any>>;
32
+ set words(w: Array<Array<any>>);
33
+ private createWordElement;
34
+ private isIntersectWithPlaced;
35
+ private arrangeWords;
36
+ render(target: HTMLDivElement): void;
37
+ dispose(): void;
38
+ }
@@ -0,0 +1,28 @@
1
+ import { Question, Event } from "survey-core";
2
+ import { ICalculationResult, VisualizerBase } from "../visualizerBase";
3
+ export declare class WordCloudAdapter {
4
+ private model;
5
+ private _wordcloud;
6
+ static drawOutOfBound: boolean;
7
+ static shrinkToFit: boolean;
8
+ static abortThreshold: any;
9
+ static weightFactor: number;
10
+ static onWordcloudCreating: Event<(sender: WordCloud, options: any) => any, WordCloud, any>;
11
+ constructor(model: WordCloud);
12
+ get wordcloud(): any;
13
+ create(element: HTMLElement): Promise<any>;
14
+ destroy(node: HTMLElement): void;
15
+ }
16
+ export declare class WordCloud extends VisualizerBase {
17
+ private _wordcloudAdapter;
18
+ private _values;
19
+ constructor(question: Question, data: Array<{
20
+ [index: string]: any;
21
+ }>, options?: Object, type?: string);
22
+ convertFromExternalData(externalCalculatedData: any): ICalculationResult;
23
+ getValues(): Array<any>;
24
+ protected getCalculatedValuesCore(): ICalculationResult;
25
+ protected destroyContent(container: HTMLElement): void;
26
+ protected renderContentAsync(container: HTMLElement): Promise<HTMLElement>;
27
+ destroy(): void;
28
+ }
@@ -2,8 +2,10 @@ export declare var englishStrings: {
2
2
  groupButton: string;
3
3
  ungroupButton: string;
4
4
  selectButton: string;
5
+ columnReorder: string;
5
6
  hideColumn: string;
6
7
  showColumn: string;
8
+ columns: string;
7
9
  makePrivateColumn: string;
8
10
  makePublicColumn: string;
9
11
  moveToDetail: string;
@@ -12,10 +14,12 @@ export declare var englishStrings: {
12
14
  removeRows: string;
13
15
  showLabel: string;
14
16
  entriesLabel: string;
17
+ entriesOnPageLabel: string;
15
18
  visualizer_text: string;
16
19
  visualizer_wordcloud: string;
17
20
  visualizer_histogram: string;
18
21
  visualizer_number: string;
22
+ visualizer_average: string;
19
23
  visualizer_choices: string;
20
24
  visualizer_selectBase: string;
21
25
  visualizer_matrix: string;
@@ -29,6 +33,9 @@ export declare var englishStrings: {
29
33
  chartType_bullet: string;
30
34
  chartType_line: string;
31
35
  chartType_radar: string;
36
+ chartType_histogram: string;
37
+ chartType_vhistogram: string;
38
+ chartType_stackedhistogram: string;
32
39
  hideButton: string;
33
40
  makePrivateButton: string;
34
41
  makePublicButton: string;
@@ -38,6 +45,7 @@ export declare var englishStrings: {
38
45
  changeLocale: string;
39
46
  clearButton: string;
40
47
  addElement: string;
48
+ allQuestions: string;
41
49
  defaultOrder: string;
42
50
  ascOrder: string;
43
51
  descOrder: string;
@@ -46,10 +54,30 @@ export declare var englishStrings: {
46
54
  otherCommentTitle: string;
47
55
  showPercentages: string;
48
56
  hidePercentages: string;
57
+ exportAs: string;
49
58
  pdfDownloadCaption: string;
50
59
  xlsxDownloadCaption: string;
51
60
  csvDownloadCaption: string;
52
61
  saveDiagramAsPNG: string;
62
+ responsesText: string;
63
+ noData: string;
64
+ selectDateRange: string;
65
+ includeToday: string;
66
+ reportingPeriodCustom: string;
67
+ reportingPeriodLast7days: string;
68
+ reportingPeriodLast14days: string;
69
+ reportingPeriodLast28days: string;
70
+ reportingPeriodLast30days: string;
71
+ reportingPeriodLastWeekMon: string;
72
+ reportingPeriodLastWeekSun: string;
73
+ reportingPeriodLastMonth: string;
74
+ reportingPeriodLastQuarter: string;
75
+ reportingPeriodLastYear: string;
76
+ reportingPeriodWtdSun: string;
77
+ reportingPeriodWtdMon: string;
78
+ reportingPeriodMtd: string;
79
+ reportingPeriodQtd: string;
80
+ reportingPeriodYtd: string;
53
81
  hideEmptyAnswers: string;
54
82
  showEmptyAnswers: string;
55
83
  "topNValueText-1": string;
@@ -1,25 +1,2 @@
1
- export * from "../localizationManager";
2
- import "../analytics-localization/farsi";
3
- import "../analytics-localization/french";
4
- import "../analytics-localization/german";
5
- import "../analytics-localization/norwegian";
6
- import "../analytics-localization/portuguese";
7
- import "../analytics-localization/russian";
8
- import "../analytics-localization/dutch";
9
- import "../analytics-localization/spanish";
10
- import "../analytics-localization/italian";
11
- import "../analytics-localization/arabic";
12
- import "../analytics-localization/japanese";
13
- import "../analytics-localization/polish";
14
- import "../analytics-localization/finnish";
15
- import "../analytics-localization/swedish";
16
- import "../tables/extensions/rowextensions";
17
- import "../tables/extensions/headerextensions";
18
- import "../tables/extensions/columnextensions";
19
- import "../tables/extensions/detailsextensions";
20
- export * from "../tables/table";
21
- export * from "../tables/tabulator";
22
- export * from "../tables/columnbuilder";
23
- export * from "../tables/columns";
24
- export { TableExtensions } from "../tables/extensions/tableextensions";
25
- export { DocumentHelper } from "../utils/index";
1
+ export * from "./tabulator.fontless";
2
+ import "./fonts.scss";