survey-analytics 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm/shared.mjs +1 -1
- package/fesm/shared2.mjs +110 -63
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +2 -2
- package/fesm/survey.analytics.mjs +3 -3
- package/fesm/survey.analytics.tabulator.mjs +6 -3
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +3 -3
- package/survey-analytics-tabulator.types/tables/table.d.ts +18 -5
- package/survey-analytics.types/entries/summary.core.d.ts +1 -0
- package/survey-analytics.types/visualizationComposite.d.ts +8 -0
- package/survey-analytics.types/visualizationMatrixDynamic.d.ts +1 -2
- package/survey-analytics.types/visualizationPanel.d.ts +6 -0
- package/survey-analytics.types/visualizationPanelDynamic.d.ts +1 -2
- package/survey-analytics.types/visualizerBase.d.ts +6 -1
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +173 -98
- package/survey.analytics.core.js.map +1 -1
- package/survey.analytics.core.min.css +1 -1
- package/survey.analytics.core.min.js +1 -1
- package/survey.analytics.core.min.js.LICENSE.txt +1 -1
- package/survey.analytics.css +1 -1
- package/survey.analytics.js +174 -98
- package/survey.analytics.js.map +1 -1
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js +1 -1
- package/survey.analytics.min.js.LICENSE.txt +1 -1
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +11 -4
- package/survey.analytics.tabulator.js.map +1 -1
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +1 -1
- package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"pre-push-check": "npm run lint && npm run test",
|
|
19
19
|
"pwinst": "playwright install chromium"
|
|
20
20
|
},
|
|
21
|
-
"version": "2.3.
|
|
21
|
+
"version": "2.3.8",
|
|
22
22
|
"name": "survey-analytics",
|
|
23
23
|
"description": "SurveyJS analytics Library.",
|
|
24
24
|
"main": "survey.analytics.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"concurrently": "^5.3.0",
|
|
60
60
|
"css-loader": "^7.1.2",
|
|
61
61
|
"eslint": "^7.32.0",
|
|
62
|
-
"eslint-plugin-
|
|
62
|
+
"eslint-plugin-surveyjs": "git+https://github.com/surveyjs/eslint-surveyjs.git",
|
|
63
63
|
"html-loader": "^5.0.0",
|
|
64
64
|
"http-server": "^14.1.1",
|
|
65
65
|
"husky": "^8.0.3",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@types/plotly.js-dist-min": "^2.3.0",
|
|
93
93
|
"@types/tabulator-tables": "^6.2.3",
|
|
94
|
-
"survey-core": "2.3.
|
|
94
|
+
"survey-core": "2.3.8"
|
|
95
95
|
},
|
|
96
96
|
"husky": {
|
|
97
97
|
"hooks": {
|
|
@@ -5,14 +5,26 @@ import { ITableExtension, TableExtensions } from "./extensions/tableextensions";
|
|
|
5
5
|
export interface ITableOptions {
|
|
6
6
|
[index: string]: any;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Specifies whether to use question names instead of question titles as column headings.
|
|
9
|
+
*
|
|
10
|
+
* Default value: `false`
|
|
9
11
|
*/
|
|
10
12
|
useNamesAsTitles?: boolean;
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
14
|
+
* Specifies the delimiter used to separate multiple choice items in a list.
|
|
15
|
+
*
|
|
16
|
+
* Default value: `", "`
|
|
17
|
+
*/
|
|
18
|
+
itemsDelimiter?: string;
|
|
19
|
+
/**
|
|
20
|
+
* A callback function that allows you to customize a question's display value in the table.
|
|
21
|
+
*
|
|
22
|
+
* Parameters:
|
|
23
|
+
*
|
|
24
|
+
* - `options.question`: `Question`\
|
|
25
|
+
* The question for which the callback is executed.
|
|
26
|
+
* - `options.displayValue`: `any`\
|
|
27
|
+
* The question's display value. You can modify this parameter to change the output.
|
|
16
28
|
*/
|
|
17
29
|
onGetQuestionValue?: (options: {
|
|
18
30
|
question: Question;
|
|
@@ -100,6 +112,7 @@ export declare abstract class Table {
|
|
|
100
112
|
getCreatedRows(): TableRow[];
|
|
101
113
|
clearCreatedRows(): void;
|
|
102
114
|
get useNamesAsTitles(): boolean;
|
|
115
|
+
get itemsDelimiter(): string;
|
|
103
116
|
protected buildColumns: (survey: SurveyModel) => IColumn[];
|
|
104
117
|
private isNonValueQuestion;
|
|
105
118
|
isColumnVisible(column: IColumn): boolean;
|
|
@@ -27,6 +27,7 @@ export * from "../visualizationPanelDynamic";
|
|
|
27
27
|
export * from "../visualizationMatrixDynamic";
|
|
28
28
|
export * from "../visualizationMatrixDropdown";
|
|
29
29
|
export * from "../alternativeVizualizersWrapper";
|
|
30
|
+
export * from "../visualizationComposite";
|
|
30
31
|
export * from "../wordcloud/wordcloud";
|
|
31
32
|
export * from "../wordcloud/stopwords/index";
|
|
32
33
|
export * from "../text";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Question } from "survey-core";
|
|
2
|
+
import { VisualizationPanelDynamic } from "./visualizationPanelDynamic";
|
|
3
|
+
export declare class VisualizationComposite extends VisualizationPanelDynamic {
|
|
4
|
+
constructor(question: Question, data: Array<{
|
|
5
|
+
[index: string]: any;
|
|
6
|
+
}>, options?: Object, name?: string);
|
|
7
|
+
getQuestions(): any[];
|
|
8
|
+
}
|
|
@@ -3,7 +3,6 @@ import { VisualizationPanelDynamic } from "./visualizationPanelDynamic";
|
|
|
3
3
|
export declare class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
|
|
4
4
|
constructor(question: Question, data: Array<{
|
|
5
5
|
[index: string]: any;
|
|
6
|
-
}>, options?: Object);
|
|
7
|
-
get type(): string;
|
|
6
|
+
}>, options?: Object, name?: string);
|
|
8
7
|
getQuestions(): Question[];
|
|
9
8
|
}
|
|
@@ -236,6 +236,12 @@ export interface IVisualizationPanelOptions {
|
|
|
236
236
|
* Default value: `true`
|
|
237
237
|
*/
|
|
238
238
|
stripHtmlFromTitles?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Allows users to switch between different visualizer types.
|
|
241
|
+
*
|
|
242
|
+
* Default value: `true`
|
|
243
|
+
*/
|
|
244
|
+
allowChangeVisualizerType?: boolean;
|
|
239
245
|
}
|
|
240
246
|
/**
|
|
241
247
|
* An object that visualizes survey results and allows users to analyze them.
|
|
@@ -8,10 +8,9 @@ export declare class VisualizationPanelDynamic extends VisualizerBase {
|
|
|
8
8
|
}>, options?: {
|
|
9
9
|
[index: string]: any;
|
|
10
10
|
}, name?: string);
|
|
11
|
+
get contentVisualizer(): VisualizationPanel;
|
|
11
12
|
protected setLocale(newLocale: string): void;
|
|
12
13
|
private onAfterRenderPanelCallback;
|
|
13
|
-
get type(): string;
|
|
14
|
-
private updatePanelVisualizerData;
|
|
15
14
|
updateData(data: Array<{
|
|
16
15
|
[index: string]: any;
|
|
17
16
|
}>): void;
|
|
@@ -218,6 +218,11 @@ export declare class VisualizerBase implements IDataInfo {
|
|
|
218
218
|
* @see registerToolbarItem
|
|
219
219
|
*/
|
|
220
220
|
unregisterToolbarItem(name: string): (toolbar?: HTMLDivElement) => HTMLElement;
|
|
221
|
+
/**
|
|
222
|
+
* Returns the visualizer's title.
|
|
223
|
+
*/
|
|
224
|
+
get title(): string;
|
|
225
|
+
protected getTitle(question: Question): string;
|
|
221
226
|
/**
|
|
222
227
|
* Returns the visualizer's type.
|
|
223
228
|
*/
|
|
@@ -239,7 +244,7 @@ export declare class VisualizerBase implements IDataInfo {
|
|
|
239
244
|
*/
|
|
240
245
|
updateData(data: Array<{
|
|
241
246
|
[index: string]: any;
|
|
242
|
-
}>): void;
|
|
247
|
+
}> | GetDataFn): void;
|
|
243
248
|
onUpdate: () => void;
|
|
244
249
|
invokeOnUpdate(): void;
|
|
245
250
|
/**
|
package/survey.analytics.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.3.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.3.8
|
|
3
3
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -6859,7 +6859,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6859
6859
|
var AlternativeVisualizersWrapper = /** @class */ (function (_super) {
|
|
6860
6860
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(AlternativeVisualizersWrapper, _super);
|
|
6861
6861
|
function AlternativeVisualizersWrapper(visualizers, question, data, options) {
|
|
6862
|
-
var _this = _super.call(this, question, data, options) || this;
|
|
6862
|
+
var _this = _super.call(this, question, data, options, "alternative") || this;
|
|
6863
6863
|
_this.visualizers = visualizers;
|
|
6864
6864
|
_this.visualizersWithSelection = [];
|
|
6865
6865
|
_this.onAfterVisualizerRenderCallback = function () {
|
|
@@ -6885,14 +6885,16 @@ var AlternativeVisualizersWrapper = /** @class */ (function (_super) {
|
|
|
6885
6885
|
_this.visualizersWithSelection.push(visualizer);
|
|
6886
6886
|
}
|
|
6887
6887
|
});
|
|
6888
|
-
_this.
|
|
6889
|
-
|
|
6890
|
-
return {
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6888
|
+
if (_this.options.allowChangeVisualizerType !== false) {
|
|
6889
|
+
_this.registerToolbarItem("changeVisualizer", function () {
|
|
6890
|
+
return _this.visualizerSelector = _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.visualizers.map(function (visualizer) {
|
|
6891
|
+
return {
|
|
6892
|
+
value: visualizer.type,
|
|
6893
|
+
text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("visualizer_" + visualizer.type),
|
|
6894
|
+
};
|
|
6895
|
+
}), function (option) { return _this.visualizer.type === option.value; }, function (e) { return _this.setVisualizer(e.target.value); });
|
|
6896
|
+
}, 0);
|
|
6897
|
+
}
|
|
6896
6898
|
_this.visualizer = visualizers[0];
|
|
6897
6899
|
_this.visualizer.onAfterRender.add(_this.onAfterVisualizerRenderCallback);
|
|
6898
6900
|
_this.visualizer.onStateChanged.add(_this.onVisualizerStateChangedCallback);
|
|
@@ -10944,19 +10946,21 @@ var NumberModel = /** @class */ (function (_super) {
|
|
|
10944
10946
|
_this.chartTypes = _this._chartAdapter.getChartTypes();
|
|
10945
10947
|
_this.chartType = _this.chartTypes[0];
|
|
10946
10948
|
}
|
|
10947
|
-
_this.
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
return {
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
_this.
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10949
|
+
if (_this.options.allowChangeVisualizerType !== false) {
|
|
10950
|
+
_this.registerToolbarItem("changeChartType", function () {
|
|
10951
|
+
if (_this.chartTypes.length > 1) {
|
|
10952
|
+
return _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
|
|
10953
|
+
return {
|
|
10954
|
+
value: chartType,
|
|
10955
|
+
text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("chartType_" + chartType),
|
|
10956
|
+
};
|
|
10957
|
+
}), function (option) { return _this.chartType === option.value; }, function (e) {
|
|
10958
|
+
_this.setChartType(e.target.value);
|
|
10959
|
+
});
|
|
10960
|
+
}
|
|
10961
|
+
return null;
|
|
10962
|
+
});
|
|
10963
|
+
}
|
|
10960
10964
|
return _this;
|
|
10961
10965
|
}
|
|
10962
10966
|
NumberModel.prototype.onDataChanged = function () {
|
|
@@ -11723,19 +11727,21 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
11723
11727
|
_this._chartType = _this.options.defaultChartType;
|
|
11724
11728
|
}
|
|
11725
11729
|
}
|
|
11726
|
-
_this.
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
return {
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
_this.
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11730
|
+
if (_this.options.allowChangeVisualizerType !== false) {
|
|
11731
|
+
_this.registerToolbarItem("changeChartType", function () {
|
|
11732
|
+
if (_this.chartTypes.length > 1) {
|
|
11733
|
+
return _utils_index__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
|
|
11734
|
+
return {
|
|
11735
|
+
value: chartType,
|
|
11736
|
+
text: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("chartType_" + chartType),
|
|
11737
|
+
};
|
|
11738
|
+
}), function (option) { return _this.chartType === option.value; }, function (e) {
|
|
11739
|
+
_this.setChartType(e.target.value);
|
|
11740
|
+
});
|
|
11741
|
+
}
|
|
11742
|
+
return null;
|
|
11743
|
+
});
|
|
11744
|
+
}
|
|
11739
11745
|
_this.registerToolbarItem("changeAnswersOrder", function () {
|
|
11740
11746
|
if (_this.isSupportAnswersOrder()) {
|
|
11741
11747
|
_this.choicesOrderSelector = _utils_index__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createSelector([
|
|
@@ -13276,6 +13282,42 @@ function toPrecision(value, precision) {
|
|
|
13276
13282
|
}
|
|
13277
13283
|
|
|
13278
13284
|
|
|
13285
|
+
/***/ }),
|
|
13286
|
+
|
|
13287
|
+
/***/ "./src/visualizationComposite.ts":
|
|
13288
|
+
/*!***************************************!*\
|
|
13289
|
+
!*** ./src/visualizationComposite.ts ***!
|
|
13290
|
+
\***************************************/
|
|
13291
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
13292
|
+
|
|
13293
|
+
"use strict";
|
|
13294
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13295
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13296
|
+
/* harmony export */ VisualizationComposite: () => (/* binding */ VisualizationComposite)
|
|
13297
|
+
/* harmony export */ });
|
|
13298
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
13299
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
13300
|
+
/* harmony import */ var _visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visualizationPanelDynamic */ "./src/visualizationPanelDynamic.ts");
|
|
13301
|
+
|
|
13302
|
+
|
|
13303
|
+
|
|
13304
|
+
var VisualizationComposite = /** @class */ (function (_super) {
|
|
13305
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationComposite, _super);
|
|
13306
|
+
function VisualizationComposite(question, data, options, name) {
|
|
13307
|
+
return _super.call(this, question, data, options, name || "composite") || this;
|
|
13308
|
+
}
|
|
13309
|
+
VisualizationComposite.prototype.getQuestions = function () {
|
|
13310
|
+
var matrixdynamic = this.question;
|
|
13311
|
+
var innerQuestions = [];
|
|
13312
|
+
matrixdynamic.contentPanel.addQuestionsToList(innerQuestions);
|
|
13313
|
+
return innerQuestions;
|
|
13314
|
+
};
|
|
13315
|
+
return VisualizationComposite;
|
|
13316
|
+
}(_visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_2__.VisualizationPanelDynamic));
|
|
13317
|
+
|
|
13318
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.registerVisualizer("composite", VisualizationComposite);
|
|
13319
|
+
|
|
13320
|
+
|
|
13279
13321
|
/***/ }),
|
|
13280
13322
|
|
|
13281
13323
|
/***/ "./src/visualizationManager.ts":
|
|
@@ -13557,16 +13599,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13557
13599
|
|
|
13558
13600
|
var VisualizationMatrixDynamic = /** @class */ (function (_super) {
|
|
13559
13601
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationMatrixDynamic, _super);
|
|
13560
|
-
function VisualizationMatrixDynamic(question, data, options) {
|
|
13561
|
-
return _super.call(this, question, data, options) || this;
|
|
13602
|
+
function VisualizationMatrixDynamic(question, data, options, name) {
|
|
13603
|
+
return _super.call(this, question, data, options, name || "matrixDynamic") || this;
|
|
13562
13604
|
}
|
|
13563
|
-
Object.defineProperty(VisualizationMatrixDynamic.prototype, "type", {
|
|
13564
|
-
get: function () {
|
|
13565
|
-
return "matrixDynamic";
|
|
13566
|
-
},
|
|
13567
|
-
enumerable: false,
|
|
13568
|
-
configurable: true
|
|
13569
|
-
});
|
|
13570
13605
|
VisualizationMatrixDynamic.prototype.getQuestions = function () {
|
|
13571
13606
|
var matrixdynamic = this.question;
|
|
13572
13607
|
var visibleRows = matrixdynamic.visibleRows;
|
|
@@ -13617,8 +13652,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13617
13652
|
/* harmony import */ var _filterInfo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./filterInfo */ "./src/filterInfo.ts");
|
|
13618
13653
|
/* harmony import */ var _layoutEngine__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layoutEngine */ "./src/layoutEngine.ts");
|
|
13619
13654
|
/* harmony import */ var _svgbundle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./svgbundle */ "./src/svgbundle.ts");
|
|
13620
|
-
/* harmony import */ var
|
|
13621
|
-
/* harmony import */ var
|
|
13655
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
13656
|
+
/* harmony import */ var _visualizationPanel_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./visualizationPanel.scss */ "./src/visualizationPanel.scss");
|
|
13622
13657
|
|
|
13623
13658
|
|
|
13624
13659
|
|
|
@@ -13749,7 +13784,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13749
13784
|
_this._layoutEngine.onMoveCallback = function (order) {
|
|
13750
13785
|
return _this.reorderVisibleElements(order);
|
|
13751
13786
|
};
|
|
13752
|
-
_this.showToolbar =
|
|
13787
|
+
_this.showToolbar = isRoot;
|
|
13753
13788
|
if (_this.options.survey) {
|
|
13754
13789
|
_localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale = _this.options.survey.locale;
|
|
13755
13790
|
}
|
|
@@ -13757,6 +13792,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13757
13792
|
_this._elements = _this.buildElements(questions);
|
|
13758
13793
|
}
|
|
13759
13794
|
_this.buildVisualizers(questions);
|
|
13795
|
+
_this.updateData(_this.surveyData);
|
|
13760
13796
|
if (!_this.haveCommercialLicense && _this.isRoot) {
|
|
13761
13797
|
_this.registerToolbarItem("commercialLicense", function () {
|
|
13762
13798
|
return (0,_utils_index__WEBPACK_IMPORTED_MODULE_5__.createCommercialLicenseLink)();
|
|
@@ -13944,7 +13980,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13944
13980
|
var visualizerData = _this.surveyData;
|
|
13945
13981
|
var visualizer;
|
|
13946
13982
|
if (Array.isArray(question)) {
|
|
13947
|
-
visualizer = new (
|
|
13983
|
+
visualizer = new (_visualizationManager__WEBPACK_IMPORTED_MODULE_10__.VisualizationManager.getPivotVisualizerConstructor())(question, visualizerData, visualizerOptions, undefined, false);
|
|
13948
13984
|
}
|
|
13949
13985
|
else {
|
|
13950
13986
|
visualizer = _this.createVisualizer(question, visualizerOptions, visualizerData);
|
|
@@ -14020,7 +14056,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
14020
14056
|
question = Array.isArray(question) ? question[0] : question;
|
|
14021
14057
|
var element = _this.getElement(question.name);
|
|
14022
14058
|
if (!!element) {
|
|
14023
|
-
element.displayName = _this.
|
|
14059
|
+
element.displayName = _this.getTitle(question);
|
|
14024
14060
|
}
|
|
14025
14061
|
});
|
|
14026
14062
|
this.visualizers.forEach(function (v) {
|
|
@@ -14088,7 +14124,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
14088
14124
|
question = Array.isArray(question) ? question[0] : question;
|
|
14089
14125
|
return {
|
|
14090
14126
|
name: question.name,
|
|
14091
|
-
displayName: _this.
|
|
14127
|
+
displayName: _this.getTitle(question),
|
|
14092
14128
|
isVisible: true,
|
|
14093
14129
|
isPublic: true,
|
|
14094
14130
|
};
|
|
@@ -14411,40 +14447,32 @@ var VisualizationPanelDynamic = /** @class */ (function (_super) {
|
|
|
14411
14447
|
};
|
|
14412
14448
|
_this.loadingData = false;
|
|
14413
14449
|
var options = Object.assign({}, options);
|
|
14450
|
+
options.allowHideQuestions = false;
|
|
14414
14451
|
options.allowDynamicLayout = false;
|
|
14415
14452
|
options.dataProvider = undefined;
|
|
14453
|
+
options.dataPath = _this.dataNames[0];
|
|
14416
14454
|
_this._panelVisualizer = new _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__.VisualizationPanel(_this.getQuestions(), [], options, undefined, false);
|
|
14417
14455
|
_this._panelVisualizer.onAfterRender.add(_this.onAfterRenderPanelCallback);
|
|
14418
14456
|
_this.updateData(data);
|
|
14419
14457
|
return _this;
|
|
14420
14458
|
}
|
|
14421
|
-
VisualizationPanelDynamic.prototype
|
|
14422
|
-
_super.prototype.setLocale.call(this, newLocale);
|
|
14423
|
-
this._panelVisualizer.locale = newLocale;
|
|
14424
|
-
};
|
|
14425
|
-
Object.defineProperty(VisualizationPanelDynamic.prototype, "type", {
|
|
14459
|
+
Object.defineProperty(VisualizationPanelDynamic.prototype, "contentVisualizer", {
|
|
14426
14460
|
get: function () {
|
|
14427
|
-
return
|
|
14461
|
+
return this._panelVisualizer;
|
|
14428
14462
|
},
|
|
14429
14463
|
enumerable: false,
|
|
14430
14464
|
configurable: true
|
|
14431
14465
|
});
|
|
14432
|
-
VisualizationPanelDynamic.prototype.
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
this.data.forEach(function (dataItem) {
|
|
14436
|
-
if (dataItem[_this.question.name] !== undefined) {
|
|
14437
|
-
panelData = panelData.concat(dataItem[_this.question.name]);
|
|
14438
|
-
}
|
|
14439
|
-
});
|
|
14440
|
-
this._panelVisualizer.updateData(panelData);
|
|
14466
|
+
VisualizationPanelDynamic.prototype.setLocale = function (newLocale) {
|
|
14467
|
+
_super.prototype.setLocale.call(this, newLocale);
|
|
14468
|
+
this._panelVisualizer.locale = newLocale;
|
|
14441
14469
|
};
|
|
14442
14470
|
VisualizationPanelDynamic.prototype.updateData = function (data) {
|
|
14443
14471
|
_super.prototype.updateData.call(this, data);
|
|
14444
|
-
this.
|
|
14472
|
+
this._panelVisualizer.updateData(data);
|
|
14445
14473
|
};
|
|
14446
14474
|
VisualizationPanelDynamic.prototype.onDataChanged = function () {
|
|
14447
|
-
this.
|
|
14475
|
+
this._panelVisualizer.updateData(this.dataProvider.filteredData);
|
|
14448
14476
|
_super.prototype.onDataChanged.call(this);
|
|
14449
14477
|
};
|
|
14450
14478
|
VisualizationPanelDynamic.prototype.getQuestions = function () {
|
|
@@ -14829,6 +14857,22 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14829
14857
|
}
|
|
14830
14858
|
return undefined;
|
|
14831
14859
|
};
|
|
14860
|
+
Object.defineProperty(VisualizerBase.prototype, "title", {
|
|
14861
|
+
/**
|
|
14862
|
+
* Returns the visualizer's title.
|
|
14863
|
+
*/
|
|
14864
|
+
get: function () {
|
|
14865
|
+
return this.getTitle(this.question);
|
|
14866
|
+
},
|
|
14867
|
+
enumerable: false,
|
|
14868
|
+
configurable: true
|
|
14869
|
+
});
|
|
14870
|
+
VisualizerBase.prototype.getTitle = function (question) {
|
|
14871
|
+
var _a;
|
|
14872
|
+
if (question === undefined)
|
|
14873
|
+
return "";
|
|
14874
|
+
return this.processText(((_a = question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) ? question.locTitle.renderedHtml : question.title);
|
|
14875
|
+
};
|
|
14832
14876
|
Object.defineProperty(VisualizerBase.prototype, "type", {
|
|
14833
14877
|
/**
|
|
14834
14878
|
* Returns the visualizer's type.
|
|
@@ -14873,11 +14917,26 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14873
14917
|
* @param data A data array with survey results to be visualized.
|
|
14874
14918
|
*/
|
|
14875
14919
|
VisualizerBase.prototype.updateData = function (data) {
|
|
14920
|
+
var dataPath = this.options.dataPath;
|
|
14921
|
+
var dataToAssign = data;
|
|
14922
|
+
if (!!dataPath && Array.isArray(data)) {
|
|
14923
|
+
dataToAssign = [];
|
|
14924
|
+
data.forEach(function (dataItem) {
|
|
14925
|
+
if (!!dataItem && dataItem[dataPath] !== undefined) {
|
|
14926
|
+
if (Array.isArray(dataItem[dataPath])) {
|
|
14927
|
+
dataToAssign = dataToAssign.concat(dataItem[dataPath]);
|
|
14928
|
+
}
|
|
14929
|
+
else {
|
|
14930
|
+
dataToAssign.push(dataItem[dataPath]);
|
|
14931
|
+
}
|
|
14932
|
+
}
|
|
14933
|
+
});
|
|
14934
|
+
}
|
|
14876
14935
|
if (!this.options.dataProvider) {
|
|
14877
|
-
this.dataProvider.data =
|
|
14936
|
+
this.dataProvider.data = dataToAssign;
|
|
14878
14937
|
}
|
|
14879
14938
|
if (this.hasFooter) {
|
|
14880
|
-
this.footerVisualizer.updateData(
|
|
14939
|
+
this.footerVisualizer.updateData(dataToAssign);
|
|
14881
14940
|
}
|
|
14882
14941
|
};
|
|
14883
14942
|
VisualizerBase.prototype.invokeOnUpdate = function () {
|
|
@@ -15367,7 +15426,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15367
15426
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15368
15427
|
/* harmony export */ VisualizerFactory: () => (/* binding */ VisualizerFactory)
|
|
15369
15428
|
/* harmony export */ });
|
|
15370
|
-
/* harmony import */ var
|
|
15429
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
15430
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
15431
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
15432
|
+
|
|
15371
15433
|
|
|
15372
15434
|
/**
|
|
15373
15435
|
* An object that allows you to create individual visualizers without creating a [visualization panel](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel).
|
|
@@ -15398,16 +15460,26 @@ var VisualizerFactory = /** @class */ (function () {
|
|
|
15398
15460
|
VisualizerFactory.createVisualizer = function (question, data, options) {
|
|
15399
15461
|
var type = question.getType();
|
|
15400
15462
|
var creators = [];
|
|
15463
|
+
var questionForCreator = question;
|
|
15464
|
+
var optionsForCreator = Object.assign({}, options);
|
|
15401
15465
|
if (type === "text" && question.inputType) {
|
|
15402
|
-
creators =
|
|
15466
|
+
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getVisualizersByType(question.inputType, type);
|
|
15403
15467
|
}
|
|
15404
15468
|
else {
|
|
15405
|
-
|
|
15469
|
+
var fallbackType = undefined;
|
|
15470
|
+
if (question instanceof survey_core__WEBPACK_IMPORTED_MODULE_0__.QuestionCustomModel) {
|
|
15471
|
+
fallbackType = question.getDynamicType();
|
|
15472
|
+
// questionForCreator = question.contentQuestion;
|
|
15473
|
+
}
|
|
15474
|
+
else if (question instanceof survey_core__WEBPACK_IMPORTED_MODULE_0__.QuestionCompositeModel) {
|
|
15475
|
+
fallbackType = "composite";
|
|
15476
|
+
}
|
|
15477
|
+
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getVisualizersByType(type, fallbackType);
|
|
15406
15478
|
}
|
|
15407
|
-
var visualizers = creators.map(function (creator) { return new creator(
|
|
15479
|
+
var visualizers = creators.map(function (creator) { return new creator(questionForCreator, data, optionsForCreator); });
|
|
15408
15480
|
if (visualizers.length > 1) {
|
|
15409
|
-
var alternativesVisualizerConstructor =
|
|
15410
|
-
var visualizer = new alternativesVisualizerConstructor(visualizers,
|
|
15481
|
+
var alternativesVisualizerConstructor = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getAltVisualizerSelector();
|
|
15482
|
+
var visualizer = new alternativesVisualizerConstructor(visualizers, questionForCreator, data, optionsForCreator);
|
|
15411
15483
|
return visualizer;
|
|
15412
15484
|
}
|
|
15413
15485
|
return visualizers[0];
|
|
@@ -17323,22 +17395,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17323
17395
|
/* harmony export */ AlternativeVisualizersWrapper: () => (/* reexport safe */ _alternativeVizualizersWrapper__WEBPACK_IMPORTED_MODULE_28__.AlternativeVisualizersWrapper),
|
|
17324
17396
|
/* harmony export */ BooleanModel: () => (/* reexport safe */ _boolean__WEBPACK_IMPORTED_MODULE_19__.BooleanModel),
|
|
17325
17397
|
/* harmony export */ DataProvider: () => (/* reexport safe */ _dataProvider__WEBPACK_IMPORTED_MODULE_15__.DataProvider),
|
|
17326
|
-
/* harmony export */ DocumentHelper: () => (/* reexport safe */
|
|
17398
|
+
/* harmony export */ DocumentHelper: () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_37__.DocumentHelper),
|
|
17327
17399
|
/* harmony export */ HistogramModel: () => (/* reexport safe */ _histogram__WEBPACK_IMPORTED_MODULE_20__.HistogramModel),
|
|
17328
17400
|
/* harmony export */ Matrix: () => (/* reexport safe */ _matrix__WEBPACK_IMPORTED_MODULE_18__.Matrix),
|
|
17329
|
-
/* harmony export */ NpsAdapter: () => (/* reexport safe */
|
|
17330
|
-
/* harmony export */ NpsVisualizer: () => (/* reexport safe */
|
|
17331
|
-
/* harmony export */ NpsVisualizerWidget: () => (/* reexport safe */
|
|
17401
|
+
/* harmony export */ NpsAdapter: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsAdapter),
|
|
17402
|
+
/* harmony export */ NpsVisualizer: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsVisualizer),
|
|
17403
|
+
/* harmony export */ NpsVisualizerWidget: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsVisualizerWidget),
|
|
17332
17404
|
/* harmony export */ NumberModel: () => (/* reexport safe */ _number__WEBPACK_IMPORTED_MODULE_21__.NumberModel),
|
|
17333
|
-
/* harmony export */ PivotModel: () => (/* reexport safe */
|
|
17405
|
+
/* harmony export */ PivotModel: () => (/* reexport safe */ _pivot__WEBPACK_IMPORTED_MODULE_36__.PivotModel),
|
|
17334
17406
|
/* harmony export */ PostponeHelper: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_22__.PostponeHelper),
|
|
17335
|
-
/* harmony export */ RankingModel: () => (/* reexport safe */
|
|
17407
|
+
/* harmony export */ RankingModel: () => (/* reexport safe */ _ranking__WEBPACK_IMPORTED_MODULE_35__.RankingModel),
|
|
17336
17408
|
/* harmony export */ SelectBase: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_17__.SelectBase),
|
|
17337
|
-
/* harmony export */ StatisticsTable: () => (/* reexport safe */
|
|
17338
|
-
/* harmony export */ StatisticsTableAdapter: () => (/* reexport safe */
|
|
17339
|
-
/* harmony export */ StatisticsTableBoolean: () => (/* reexport safe */
|
|
17340
|
-
/* harmony export */ Text: () => (/* reexport safe */
|
|
17341
|
-
/* harmony export */ TextTableAdapter: () => (/* reexport safe */
|
|
17409
|
+
/* harmony export */ StatisticsTable: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTable),
|
|
17410
|
+
/* harmony export */ StatisticsTableAdapter: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTableAdapter),
|
|
17411
|
+
/* harmony export */ StatisticsTableBoolean: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTableBoolean),
|
|
17412
|
+
/* harmony export */ Text: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_32__.Text),
|
|
17413
|
+
/* harmony export */ TextTableAdapter: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_32__.TextTableAdapter),
|
|
17414
|
+
/* harmony export */ VisualizationComposite: () => (/* reexport safe */ _visualizationComposite__WEBPACK_IMPORTED_MODULE_29__.VisualizationComposite),
|
|
17342
17415
|
/* harmony export */ VisualizationManager: () => (/* reexport safe */ _visualizationManager__WEBPACK_IMPORTED_MODULE_23__.VisualizationManager),
|
|
17343
17416
|
/* harmony export */ VisualizationMatrixDropdown: () => (/* reexport safe */ _visualizationMatrixDropdown__WEBPACK_IMPORTED_MODULE_27__.VisualizationMatrixDropdown),
|
|
17344
17417
|
/* harmony export */ VisualizationMatrixDynamic: () => (/* reexport safe */ _visualizationMatrixDynamic__WEBPACK_IMPORTED_MODULE_26__.VisualizationMatrixDynamic),
|
|
@@ -17346,13 +17419,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17346
17419
|
/* harmony export */ VisualizationPanelDynamic: () => (/* reexport safe */ _visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_25__.VisualizationPanelDynamic),
|
|
17347
17420
|
/* harmony export */ VisualizerBase: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_22__.VisualizerBase),
|
|
17348
17421
|
/* harmony export */ VisualizerFactory: () => (/* reexport safe */ _visualizerFactory__WEBPACK_IMPORTED_MODULE_16__.VisualizerFactory),
|
|
17349
|
-
/* harmony export */ WordCloud: () => (/* reexport safe */
|
|
17350
|
-
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */
|
|
17422
|
+
/* harmony export */ WordCloud: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__.WordCloud),
|
|
17423
|
+
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__.WordCloudAdapter),
|
|
17351
17424
|
/* harmony export */ hideEmptyAnswersInData: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_17__.hideEmptyAnswersInData),
|
|
17352
17425
|
/* harmony export */ localization: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.localization),
|
|
17353
17426
|
/* harmony export */ setupLocale: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.setupLocale),
|
|
17354
17427
|
/* harmony export */ surveyStrings: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.surveyStrings),
|
|
17355
|
-
/* harmony export */ textHelper: () => (/* reexport safe */
|
|
17428
|
+
/* harmony export */ textHelper: () => (/* reexport safe */ _wordcloud_stopwords_index__WEBPACK_IMPORTED_MODULE_31__.textHelper)
|
|
17356
17429
|
/* harmony export */ });
|
|
17357
17430
|
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../localizationManager */ "./src/localizationManager.ts");
|
|
17358
17431
|
/* harmony import */ var _analytics_localization_farsi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../analytics-localization/farsi */ "./src/analytics-localization/farsi.ts");
|
|
@@ -17383,14 +17456,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17383
17456
|
/* harmony import */ var _visualizationMatrixDynamic__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../visualizationMatrixDynamic */ "./src/visualizationMatrixDynamic.ts");
|
|
17384
17457
|
/* harmony import */ var _visualizationMatrixDropdown__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../visualizationMatrixDropdown */ "./src/visualizationMatrixDropdown.ts");
|
|
17385
17458
|
/* harmony import */ var _alternativeVizualizersWrapper__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../alternativeVizualizersWrapper */ "./src/alternativeVizualizersWrapper.ts");
|
|
17386
|
-
/* harmony import */ var
|
|
17387
|
-
/* harmony import */ var
|
|
17388
|
-
/* harmony import */ var
|
|
17389
|
-
/* harmony import */ var
|
|
17390
|
-
/* harmony import */ var
|
|
17391
|
-
/* harmony import */ var
|
|
17392
|
-
/* harmony import */ var
|
|
17393
|
-
/* harmony import */ var
|
|
17459
|
+
/* harmony import */ var _visualizationComposite__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../visualizationComposite */ "./src/visualizationComposite.ts");
|
|
17460
|
+
/* harmony import */ var _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../wordcloud/wordcloud */ "./src/wordcloud/wordcloud.ts");
|
|
17461
|
+
/* harmony import */ var _wordcloud_stopwords_index__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../wordcloud/stopwords/index */ "./src/wordcloud/stopwords/index.ts");
|
|
17462
|
+
/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../text */ "./src/text.ts");
|
|
17463
|
+
/* harmony import */ var _statistics_table__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../statistics-table */ "./src/statistics-table.ts");
|
|
17464
|
+
/* harmony import */ var _nps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../nps */ "./src/nps.ts");
|
|
17465
|
+
/* harmony import */ var _ranking__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../ranking */ "./src/ranking.ts");
|
|
17466
|
+
/* harmony import */ var _pivot__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../pivot */ "./src/pivot.ts");
|
|
17467
|
+
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../utils/index */ "./src/utils/index.ts");
|
|
17394
17468
|
|
|
17395
17469
|
//localization
|
|
17396
17470
|
|
|
@@ -17428,6 +17502,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17428
17502
|
|
|
17429
17503
|
|
|
17430
17504
|
|
|
17505
|
+
|
|
17431
17506
|
|
|
17432
17507
|
|
|
17433
17508
|
})();
|