survey-analytics 2.3.5 → 2.3.7
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 +84 -51
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +2 -2
- package/fesm/survey.analytics.mjs +11 -4
- package/fesm/survey.analytics.mjs.map +1 -1
- package/fesm/survey.analytics.tabulator.mjs +6 -3
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +2 -2
- 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/selectBase.d.ts +1 -0
- package/survey-analytics.types/visualizationComposite.d.ts +8 -0
- package/survey-analytics.types/visualizationManager.d.ts +2 -2
- package/survey-analytics.types/visualizationMatrixDynamic.d.ts +1 -2
- package/survey-analytics.types/visualizationPanel.d.ts +1 -1
- package/survey-analytics.types/visualizationPanelDynamic.d.ts +1 -2
- package/survey-analytics.types/visualizerBase.d.ts +1 -1
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +141 -84
- 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 +150 -85
- 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.7",
|
|
22
22
|
"name": "survey-analytics",
|
|
23
23
|
"description": "SurveyJS analytics Library.",
|
|
24
24
|
"main": "survey.analytics.js",
|
|
@@ -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.7"
|
|
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";
|
|
@@ -60,6 +60,7 @@ export declare class SelectBase extends VisualizerBase implements IVisualizerWit
|
|
|
60
60
|
*/
|
|
61
61
|
get showOnlyPercentages(): boolean;
|
|
62
62
|
set showOnlyPercentages(val: boolean);
|
|
63
|
+
protected getShowPercentagesDefault(): boolean;
|
|
63
64
|
/**
|
|
64
65
|
* Gets and sets whether chart should show values and percentages.
|
|
65
66
|
*/
|
|
@@ -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
|
+
}
|
|
@@ -41,9 +41,9 @@ export declare class VisualizationManager {
|
|
|
41
41
|
static unregisterVisualizerForAll(constructor: VisualizerConstructor): void;
|
|
42
42
|
/**
|
|
43
43
|
* Returns all visualizer constructors for a specified question type.
|
|
44
|
-
* @param
|
|
44
|
+
* @param visualizerType A question [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
45
45
|
*/
|
|
46
|
-
static getVisualizersByType(
|
|
46
|
+
static getVisualizersByType(visualizerType: string, fallbackVisualizerType?: string): VisualizerConstructor[];
|
|
47
47
|
/**
|
|
48
48
|
* Returns a constructor for an alternative visualizer selector.
|
|
49
49
|
* @see registerAltVisualizerSelector
|
|
@@ -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
|
}
|
|
@@ -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;
|
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.7
|
|
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 () {
|
|
@@ -11676,9 +11676,8 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
11676
11676
|
_this.emptyAnswersBtn = undefined;
|
|
11677
11677
|
_this.transposeDataBtn = undefined;
|
|
11678
11678
|
_this.topNSelector = undefined;
|
|
11679
|
-
_this._showPercentages = false;
|
|
11680
11679
|
_this._showOnlyPercentages = false;
|
|
11681
|
-
_this._percentagePrecision =
|
|
11680
|
+
_this._percentagePrecision = 2;
|
|
11682
11681
|
_this._answersOrder = "default";
|
|
11683
11682
|
_this._hideEmptyAnswers = false;
|
|
11684
11683
|
_this._topN = -1;
|
|
@@ -11700,7 +11699,6 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
11700
11699
|
};
|
|
11701
11700
|
}
|
|
11702
11701
|
_this._supportSelection = true;
|
|
11703
|
-
_this._showPercentages = _this.options.showPercentages === true;
|
|
11704
11702
|
_this._showOnlyPercentages = _this.options.showOnlyPercentages === true;
|
|
11705
11703
|
if (_this.options.percentagePrecision) {
|
|
11706
11704
|
_this._percentagePrecision = _this.options.percentagePrecision;
|
|
@@ -11958,12 +11956,23 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
11958
11956
|
enumerable: false,
|
|
11959
11957
|
configurable: true
|
|
11960
11958
|
});
|
|
11959
|
+
SelectBase.prototype.getShowPercentagesDefault = function () {
|
|
11960
|
+
if (this.options.showPercentages === undefined) {
|
|
11961
|
+
return ["pie", "doughnut"].indexOf(this.chartType) !== -1;
|
|
11962
|
+
}
|
|
11963
|
+
return this.options.showPercentages === true;
|
|
11964
|
+
};
|
|
11961
11965
|
Object.defineProperty(SelectBase.prototype, "showPercentages", {
|
|
11962
11966
|
/**
|
|
11963
11967
|
* Gets and sets whether chart should show values and percentages.
|
|
11964
11968
|
*/
|
|
11965
11969
|
get: function () {
|
|
11966
|
-
|
|
11970
|
+
if (this._showPercentages !== undefined) {
|
|
11971
|
+
return this._showPercentages;
|
|
11972
|
+
}
|
|
11973
|
+
else {
|
|
11974
|
+
return this.getShowPercentagesDefault();
|
|
11975
|
+
}
|
|
11967
11976
|
},
|
|
11968
11977
|
set: function (val) {
|
|
11969
11978
|
this._showPercentages = val;
|
|
@@ -12125,12 +12134,10 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
12125
12134
|
var percentages = [];
|
|
12126
12135
|
var percentagePrecision = this._percentagePrecision;
|
|
12127
12136
|
if (data.length < 2) {
|
|
12128
|
-
data.
|
|
12129
|
-
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
return sum && (value / 100);
|
|
12133
|
-
});
|
|
12137
|
+
var sum = data[0].reduce(function (sum, val) { return sum + val; }, 0);
|
|
12138
|
+
percentages[0] = data[0].map(function (val) {
|
|
12139
|
+
var value = percentagePrecision ? +(val / sum * 100).toFixed(percentagePrecision) : Math.round(val / sum * 100);
|
|
12140
|
+
return sum && value;
|
|
12134
12141
|
});
|
|
12135
12142
|
}
|
|
12136
12143
|
else {
|
|
@@ -12142,7 +12149,7 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
12142
12149
|
for (var j = 0; j < data.length; j++) {
|
|
12143
12150
|
if (!Array.isArray(percentages[j]))
|
|
12144
12151
|
percentages[j] = [];
|
|
12145
|
-
var value = percentagePrecision ? +(
|
|
12152
|
+
var value = percentagePrecision ? +(data[j][i] / sum * 100).toFixed(percentagePrecision) : Math.round(data[j][i] / sum * 100);
|
|
12146
12153
|
percentages[j][i] = sum && value;
|
|
12147
12154
|
}
|
|
12148
12155
|
}
|
|
@@ -12170,7 +12177,7 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
12170
12177
|
*/
|
|
12171
12178
|
SelectBase.prototype.getAnswersData = function () {
|
|
12172
12179
|
return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
|
|
12173
|
-
var seriesLabels, datasets, labels, colors,
|
|
12180
|
+
var seriesLabels, datasets, labels, colors, temp, texts, zippedArray, dict, unzippedArray, answersData;
|
|
12174
12181
|
return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
|
|
12175
12182
|
switch (_a.label) {
|
|
12176
12183
|
case 0:
|
|
@@ -12180,14 +12187,13 @@ var SelectBase = /** @class */ (function (_super) {
|
|
|
12180
12187
|
datasets = (_a.sent());
|
|
12181
12188
|
labels = this.getLabels();
|
|
12182
12189
|
colors = this.getColors();
|
|
12183
|
-
texts = this.showPercentages ? this.getPercentages(datasets) : datasets;
|
|
12184
12190
|
if (this.transposeData) {
|
|
12185
12191
|
datasets = this.transpose(datasets);
|
|
12186
|
-
texts = this.transpose(texts);
|
|
12187
12192
|
temp = seriesLabels;
|
|
12188
12193
|
seriesLabels = labels;
|
|
12189
12194
|
labels = temp;
|
|
12190
12195
|
}
|
|
12196
|
+
texts = this.showPercentages ? this.getPercentages(datasets) : datasets;
|
|
12191
12197
|
if (this.answersOrder == "asc" || this.answersOrder == "desc") {
|
|
12192
12198
|
zippedArray = this.showPercentages
|
|
12193
12199
|
? _utils_index__WEBPACK_IMPORTED_MODULE_4__.DataHelper.zipArrays(labels, colors, texts[0])
|
|
@@ -13270,6 +13276,42 @@ function toPrecision(value, precision) {
|
|
|
13270
13276
|
}
|
|
13271
13277
|
|
|
13272
13278
|
|
|
13279
|
+
/***/ }),
|
|
13280
|
+
|
|
13281
|
+
/***/ "./src/visualizationComposite.ts":
|
|
13282
|
+
/*!***************************************!*\
|
|
13283
|
+
!*** ./src/visualizationComposite.ts ***!
|
|
13284
|
+
\***************************************/
|
|
13285
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
13286
|
+
|
|
13287
|
+
"use strict";
|
|
13288
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13289
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13290
|
+
/* harmony export */ VisualizationComposite: () => (/* binding */ VisualizationComposite)
|
|
13291
|
+
/* harmony export */ });
|
|
13292
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
13293
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
13294
|
+
/* harmony import */ var _visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visualizationPanelDynamic */ "./src/visualizationPanelDynamic.ts");
|
|
13295
|
+
|
|
13296
|
+
|
|
13297
|
+
|
|
13298
|
+
var VisualizationComposite = /** @class */ (function (_super) {
|
|
13299
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationComposite, _super);
|
|
13300
|
+
function VisualizationComposite(question, data, options, name) {
|
|
13301
|
+
return _super.call(this, question, data, options, name || "composite") || this;
|
|
13302
|
+
}
|
|
13303
|
+
VisualizationComposite.prototype.getQuestions = function () {
|
|
13304
|
+
var matrixdynamic = this.question;
|
|
13305
|
+
var innerQuestions = [];
|
|
13306
|
+
matrixdynamic.contentPanel.addQuestionsToList(innerQuestions);
|
|
13307
|
+
return innerQuestions;
|
|
13308
|
+
};
|
|
13309
|
+
return VisualizationComposite;
|
|
13310
|
+
}(_visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_2__.VisualizationPanelDynamic));
|
|
13311
|
+
|
|
13312
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.registerVisualizer("composite", VisualizationComposite);
|
|
13313
|
+
|
|
13314
|
+
|
|
13273
13315
|
/***/ }),
|
|
13274
13316
|
|
|
13275
13317
|
/***/ "./src/visualizationManager.ts":
|
|
@@ -13347,10 +13389,13 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
13347
13389
|
};
|
|
13348
13390
|
/**
|
|
13349
13391
|
* Returns all visualizer constructors for a specified question type.
|
|
13350
|
-
* @param
|
|
13392
|
+
* @param visualizerType A question [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
13351
13393
|
*/
|
|
13352
|
-
VisualizationManager.getVisualizersByType = function (
|
|
13353
|
-
var vDescrs = VisualizationManager.vizualizers[
|
|
13394
|
+
VisualizationManager.getVisualizersByType = function (visualizerType, fallbackVisualizerType) {
|
|
13395
|
+
var vDescrs = VisualizationManager.vizualizers[visualizerType];
|
|
13396
|
+
if (!!fallbackVisualizerType && (!vDescrs || vDescrs.length == 0)) {
|
|
13397
|
+
vDescrs = VisualizationManager.vizualizers[fallbackVisualizerType];
|
|
13398
|
+
}
|
|
13354
13399
|
if (!vDescrs) {
|
|
13355
13400
|
if (VisualizationManager.defaultVisualizer.suppressVisualizerStubRendering) {
|
|
13356
13401
|
return [];
|
|
@@ -13548,16 +13593,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13548
13593
|
|
|
13549
13594
|
var VisualizationMatrixDynamic = /** @class */ (function (_super) {
|
|
13550
13595
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationMatrixDynamic, _super);
|
|
13551
|
-
function VisualizationMatrixDynamic(question, data, options) {
|
|
13552
|
-
return _super.call(this, question, data, options) || this;
|
|
13596
|
+
function VisualizationMatrixDynamic(question, data, options, name) {
|
|
13597
|
+
return _super.call(this, question, data, options, name || "matrixDynamic") || this;
|
|
13553
13598
|
}
|
|
13554
|
-
Object.defineProperty(VisualizationMatrixDynamic.prototype, "type", {
|
|
13555
|
-
get: function () {
|
|
13556
|
-
return "matrixDynamic";
|
|
13557
|
-
},
|
|
13558
|
-
enumerable: false,
|
|
13559
|
-
configurable: true
|
|
13560
|
-
});
|
|
13561
13599
|
VisualizationMatrixDynamic.prototype.getQuestions = function () {
|
|
13562
13600
|
var matrixdynamic = this.question;
|
|
13563
13601
|
var visibleRows = matrixdynamic.visibleRows;
|
|
@@ -13608,8 +13646,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13608
13646
|
/* harmony import */ var _filterInfo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./filterInfo */ "./src/filterInfo.ts");
|
|
13609
13647
|
/* harmony import */ var _layoutEngine__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layoutEngine */ "./src/layoutEngine.ts");
|
|
13610
13648
|
/* harmony import */ var _svgbundle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./svgbundle */ "./src/svgbundle.ts");
|
|
13611
|
-
/* harmony import */ var
|
|
13612
|
-
/* harmony import */ var
|
|
13649
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
13650
|
+
/* harmony import */ var _visualizationPanel_scss__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./visualizationPanel.scss */ "./src/visualizationPanel.scss");
|
|
13613
13651
|
|
|
13614
13652
|
|
|
13615
13653
|
|
|
@@ -13740,7 +13778,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13740
13778
|
_this._layoutEngine.onMoveCallback = function (order) {
|
|
13741
13779
|
return _this.reorderVisibleElements(order);
|
|
13742
13780
|
};
|
|
13743
|
-
_this.showToolbar =
|
|
13781
|
+
_this.showToolbar = isRoot;
|
|
13744
13782
|
if (_this.options.survey) {
|
|
13745
13783
|
_localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale = _this.options.survey.locale;
|
|
13746
13784
|
}
|
|
@@ -13748,6 +13786,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13748
13786
|
_this._elements = _this.buildElements(questions);
|
|
13749
13787
|
}
|
|
13750
13788
|
_this.buildVisualizers(questions);
|
|
13789
|
+
_this.updateData(_this.surveyData);
|
|
13751
13790
|
if (!_this.haveCommercialLicense && _this.isRoot) {
|
|
13752
13791
|
_this.registerToolbarItem("commercialLicense", function () {
|
|
13753
13792
|
return (0,_utils_index__WEBPACK_IMPORTED_MODULE_5__.createCommercialLicenseLink)();
|
|
@@ -13935,7 +13974,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
|
|
|
13935
13974
|
var visualizerData = _this.surveyData;
|
|
13936
13975
|
var visualizer;
|
|
13937
13976
|
if (Array.isArray(question)) {
|
|
13938
|
-
visualizer = new (
|
|
13977
|
+
visualizer = new (_visualizationManager__WEBPACK_IMPORTED_MODULE_10__.VisualizationManager.getPivotVisualizerConstructor())(question, visualizerData, visualizerOptions, undefined, false);
|
|
13939
13978
|
}
|
|
13940
13979
|
else {
|
|
13941
13980
|
visualizer = _this.createVisualizer(question, visualizerOptions, visualizerData);
|
|
@@ -14402,40 +14441,32 @@ var VisualizationPanelDynamic = /** @class */ (function (_super) {
|
|
|
14402
14441
|
};
|
|
14403
14442
|
_this.loadingData = false;
|
|
14404
14443
|
var options = Object.assign({}, options);
|
|
14444
|
+
options.allowHideQuestions = false;
|
|
14405
14445
|
options.allowDynamicLayout = false;
|
|
14406
14446
|
options.dataProvider = undefined;
|
|
14447
|
+
options.dataPath = _this.dataNames[0];
|
|
14407
14448
|
_this._panelVisualizer = new _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__.VisualizationPanel(_this.getQuestions(), [], options, undefined, false);
|
|
14408
14449
|
_this._panelVisualizer.onAfterRender.add(_this.onAfterRenderPanelCallback);
|
|
14409
14450
|
_this.updateData(data);
|
|
14410
14451
|
return _this;
|
|
14411
14452
|
}
|
|
14412
|
-
VisualizationPanelDynamic.prototype
|
|
14413
|
-
_super.prototype.setLocale.call(this, newLocale);
|
|
14414
|
-
this._panelVisualizer.locale = newLocale;
|
|
14415
|
-
};
|
|
14416
|
-
Object.defineProperty(VisualizationPanelDynamic.prototype, "type", {
|
|
14453
|
+
Object.defineProperty(VisualizationPanelDynamic.prototype, "contentVisualizer", {
|
|
14417
14454
|
get: function () {
|
|
14418
|
-
return
|
|
14455
|
+
return this._panelVisualizer;
|
|
14419
14456
|
},
|
|
14420
14457
|
enumerable: false,
|
|
14421
14458
|
configurable: true
|
|
14422
14459
|
});
|
|
14423
|
-
VisualizationPanelDynamic.prototype.
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
this.data.forEach(function (dataItem) {
|
|
14427
|
-
if (dataItem[_this.question.name] !== undefined) {
|
|
14428
|
-
panelData = panelData.concat(dataItem[_this.question.name]);
|
|
14429
|
-
}
|
|
14430
|
-
});
|
|
14431
|
-
this._panelVisualizer.updateData(panelData);
|
|
14460
|
+
VisualizationPanelDynamic.prototype.setLocale = function (newLocale) {
|
|
14461
|
+
_super.prototype.setLocale.call(this, newLocale);
|
|
14462
|
+
this._panelVisualizer.locale = newLocale;
|
|
14432
14463
|
};
|
|
14433
14464
|
VisualizationPanelDynamic.prototype.updateData = function (data) {
|
|
14434
14465
|
_super.prototype.updateData.call(this, data);
|
|
14435
|
-
this.
|
|
14466
|
+
this._panelVisualizer.updateData(data);
|
|
14436
14467
|
};
|
|
14437
14468
|
VisualizationPanelDynamic.prototype.onDataChanged = function () {
|
|
14438
|
-
this.
|
|
14469
|
+
this._panelVisualizer.updateData(this.dataProvider.filteredData);
|
|
14439
14470
|
_super.prototype.onDataChanged.call(this);
|
|
14440
14471
|
};
|
|
14441
14472
|
VisualizationPanelDynamic.prototype.getQuestions = function () {
|
|
@@ -14864,11 +14895,26 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14864
14895
|
* @param data A data array with survey results to be visualized.
|
|
14865
14896
|
*/
|
|
14866
14897
|
VisualizerBase.prototype.updateData = function (data) {
|
|
14898
|
+
var dataPath = this.options.dataPath;
|
|
14899
|
+
var dataToAssign = data;
|
|
14900
|
+
if (!!dataPath && Array.isArray(data)) {
|
|
14901
|
+
dataToAssign = [];
|
|
14902
|
+
data.forEach(function (dataItem) {
|
|
14903
|
+
if (!!dataItem && dataItem[dataPath] !== undefined) {
|
|
14904
|
+
if (Array.isArray(dataItem[dataPath])) {
|
|
14905
|
+
dataToAssign = dataToAssign.concat(dataItem[dataPath]);
|
|
14906
|
+
}
|
|
14907
|
+
else {
|
|
14908
|
+
dataToAssign.push(dataItem[dataPath]);
|
|
14909
|
+
}
|
|
14910
|
+
}
|
|
14911
|
+
});
|
|
14912
|
+
}
|
|
14867
14913
|
if (!this.options.dataProvider) {
|
|
14868
|
-
this.dataProvider.data =
|
|
14914
|
+
this.dataProvider.data = dataToAssign;
|
|
14869
14915
|
}
|
|
14870
14916
|
if (this.hasFooter) {
|
|
14871
|
-
this.footerVisualizer.updateData(
|
|
14917
|
+
this.footerVisualizer.updateData(dataToAssign);
|
|
14872
14918
|
}
|
|
14873
14919
|
};
|
|
14874
14920
|
VisualizerBase.prototype.invokeOnUpdate = function () {
|
|
@@ -15358,7 +15404,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15358
15404
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15359
15405
|
/* harmony export */ VisualizerFactory: () => (/* binding */ VisualizerFactory)
|
|
15360
15406
|
/* harmony export */ });
|
|
15361
|
-
/* harmony import */ var
|
|
15407
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
15408
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
15409
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
15410
|
+
|
|
15362
15411
|
|
|
15363
15412
|
/**
|
|
15364
15413
|
* An object that allows you to create individual visualizers without creating a [visualization panel](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel).
|
|
@@ -15389,21 +15438,26 @@ var VisualizerFactory = /** @class */ (function () {
|
|
|
15389
15438
|
VisualizerFactory.createVisualizer = function (question, data, options) {
|
|
15390
15439
|
var type = question.getType();
|
|
15391
15440
|
var creators = [];
|
|
15441
|
+
var questionForCreator = question;
|
|
15442
|
+
var optionsForCreator = Object.assign({}, options);
|
|
15392
15443
|
if (type === "text" && question.inputType) {
|
|
15393
|
-
|
|
15394
|
-
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_0__.VisualizationManager.getVisualizersByType(type);
|
|
15395
|
-
if (creators === undefined || creators.length == 0) {
|
|
15396
|
-
type = "text";
|
|
15397
|
-
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_0__.VisualizationManager.getVisualizersByType(type);
|
|
15398
|
-
}
|
|
15444
|
+
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getVisualizersByType(question.inputType, type);
|
|
15399
15445
|
}
|
|
15400
15446
|
else {
|
|
15401
|
-
|
|
15447
|
+
var fallbackType = undefined;
|
|
15448
|
+
if (question instanceof survey_core__WEBPACK_IMPORTED_MODULE_0__.QuestionCustomModel) {
|
|
15449
|
+
fallbackType = question.getDynamicType();
|
|
15450
|
+
// questionForCreator = question.contentQuestion;
|
|
15451
|
+
}
|
|
15452
|
+
else if (question instanceof survey_core__WEBPACK_IMPORTED_MODULE_0__.QuestionCompositeModel) {
|
|
15453
|
+
fallbackType = "composite";
|
|
15454
|
+
}
|
|
15455
|
+
creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getVisualizersByType(type, fallbackType);
|
|
15402
15456
|
}
|
|
15403
|
-
var visualizers = creators.map(function (creator) { return new creator(
|
|
15457
|
+
var visualizers = creators.map(function (creator) { return new creator(questionForCreator, data, optionsForCreator); });
|
|
15404
15458
|
if (visualizers.length > 1) {
|
|
15405
|
-
var alternativesVisualizerConstructor =
|
|
15406
|
-
var visualizer = new alternativesVisualizerConstructor(visualizers,
|
|
15459
|
+
var alternativesVisualizerConstructor = _visualizationManager__WEBPACK_IMPORTED_MODULE_1__.VisualizationManager.getAltVisualizerSelector();
|
|
15460
|
+
var visualizer = new alternativesVisualizerConstructor(visualizers, questionForCreator, data, optionsForCreator);
|
|
15407
15461
|
return visualizer;
|
|
15408
15462
|
}
|
|
15409
15463
|
return visualizers[0];
|
|
@@ -17319,22 +17373,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17319
17373
|
/* harmony export */ AlternativeVisualizersWrapper: () => (/* reexport safe */ _alternativeVizualizersWrapper__WEBPACK_IMPORTED_MODULE_28__.AlternativeVisualizersWrapper),
|
|
17320
17374
|
/* harmony export */ BooleanModel: () => (/* reexport safe */ _boolean__WEBPACK_IMPORTED_MODULE_19__.BooleanModel),
|
|
17321
17375
|
/* harmony export */ DataProvider: () => (/* reexport safe */ _dataProvider__WEBPACK_IMPORTED_MODULE_15__.DataProvider),
|
|
17322
|
-
/* harmony export */ DocumentHelper: () => (/* reexport safe */
|
|
17376
|
+
/* harmony export */ DocumentHelper: () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_37__.DocumentHelper),
|
|
17323
17377
|
/* harmony export */ HistogramModel: () => (/* reexport safe */ _histogram__WEBPACK_IMPORTED_MODULE_20__.HistogramModel),
|
|
17324
17378
|
/* harmony export */ Matrix: () => (/* reexport safe */ _matrix__WEBPACK_IMPORTED_MODULE_18__.Matrix),
|
|
17325
|
-
/* harmony export */ NpsAdapter: () => (/* reexport safe */
|
|
17326
|
-
/* harmony export */ NpsVisualizer: () => (/* reexport safe */
|
|
17327
|
-
/* harmony export */ NpsVisualizerWidget: () => (/* reexport safe */
|
|
17379
|
+
/* harmony export */ NpsAdapter: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsAdapter),
|
|
17380
|
+
/* harmony export */ NpsVisualizer: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsVisualizer),
|
|
17381
|
+
/* harmony export */ NpsVisualizerWidget: () => (/* reexport safe */ _nps__WEBPACK_IMPORTED_MODULE_34__.NpsVisualizerWidget),
|
|
17328
17382
|
/* harmony export */ NumberModel: () => (/* reexport safe */ _number__WEBPACK_IMPORTED_MODULE_21__.NumberModel),
|
|
17329
|
-
/* harmony export */ PivotModel: () => (/* reexport safe */
|
|
17383
|
+
/* harmony export */ PivotModel: () => (/* reexport safe */ _pivot__WEBPACK_IMPORTED_MODULE_36__.PivotModel),
|
|
17330
17384
|
/* harmony export */ PostponeHelper: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_22__.PostponeHelper),
|
|
17331
|
-
/* harmony export */ RankingModel: () => (/* reexport safe */
|
|
17385
|
+
/* harmony export */ RankingModel: () => (/* reexport safe */ _ranking__WEBPACK_IMPORTED_MODULE_35__.RankingModel),
|
|
17332
17386
|
/* harmony export */ SelectBase: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_17__.SelectBase),
|
|
17333
|
-
/* harmony export */ StatisticsTable: () => (/* reexport safe */
|
|
17334
|
-
/* harmony export */ StatisticsTableAdapter: () => (/* reexport safe */
|
|
17335
|
-
/* harmony export */ StatisticsTableBoolean: () => (/* reexport safe */
|
|
17336
|
-
/* harmony export */ Text: () => (/* reexport safe */
|
|
17337
|
-
/* harmony export */ TextTableAdapter: () => (/* reexport safe */
|
|
17387
|
+
/* harmony export */ StatisticsTable: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTable),
|
|
17388
|
+
/* harmony export */ StatisticsTableAdapter: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTableAdapter),
|
|
17389
|
+
/* harmony export */ StatisticsTableBoolean: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_33__.StatisticsTableBoolean),
|
|
17390
|
+
/* harmony export */ Text: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_32__.Text),
|
|
17391
|
+
/* harmony export */ TextTableAdapter: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_32__.TextTableAdapter),
|
|
17392
|
+
/* harmony export */ VisualizationComposite: () => (/* reexport safe */ _visualizationComposite__WEBPACK_IMPORTED_MODULE_29__.VisualizationComposite),
|
|
17338
17393
|
/* harmony export */ VisualizationManager: () => (/* reexport safe */ _visualizationManager__WEBPACK_IMPORTED_MODULE_23__.VisualizationManager),
|
|
17339
17394
|
/* harmony export */ VisualizationMatrixDropdown: () => (/* reexport safe */ _visualizationMatrixDropdown__WEBPACK_IMPORTED_MODULE_27__.VisualizationMatrixDropdown),
|
|
17340
17395
|
/* harmony export */ VisualizationMatrixDynamic: () => (/* reexport safe */ _visualizationMatrixDynamic__WEBPACK_IMPORTED_MODULE_26__.VisualizationMatrixDynamic),
|
|
@@ -17342,13 +17397,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17342
17397
|
/* harmony export */ VisualizationPanelDynamic: () => (/* reexport safe */ _visualizationPanelDynamic__WEBPACK_IMPORTED_MODULE_25__.VisualizationPanelDynamic),
|
|
17343
17398
|
/* harmony export */ VisualizerBase: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_22__.VisualizerBase),
|
|
17344
17399
|
/* harmony export */ VisualizerFactory: () => (/* reexport safe */ _visualizerFactory__WEBPACK_IMPORTED_MODULE_16__.VisualizerFactory),
|
|
17345
|
-
/* harmony export */ WordCloud: () => (/* reexport safe */
|
|
17346
|
-
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */
|
|
17400
|
+
/* harmony export */ WordCloud: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__.WordCloud),
|
|
17401
|
+
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__.WordCloudAdapter),
|
|
17347
17402
|
/* harmony export */ hideEmptyAnswersInData: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_17__.hideEmptyAnswersInData),
|
|
17348
17403
|
/* harmony export */ localization: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.localization),
|
|
17349
17404
|
/* harmony export */ setupLocale: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.setupLocale),
|
|
17350
17405
|
/* harmony export */ surveyStrings: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.surveyStrings),
|
|
17351
|
-
/* harmony export */ textHelper: () => (/* reexport safe */
|
|
17406
|
+
/* harmony export */ textHelper: () => (/* reexport safe */ _wordcloud_stopwords_index__WEBPACK_IMPORTED_MODULE_31__.textHelper)
|
|
17352
17407
|
/* harmony export */ });
|
|
17353
17408
|
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../localizationManager */ "./src/localizationManager.ts");
|
|
17354
17409
|
/* harmony import */ var _analytics_localization_farsi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../analytics-localization/farsi */ "./src/analytics-localization/farsi.ts");
|
|
@@ -17379,14 +17434,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17379
17434
|
/* harmony import */ var _visualizationMatrixDynamic__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../visualizationMatrixDynamic */ "./src/visualizationMatrixDynamic.ts");
|
|
17380
17435
|
/* harmony import */ var _visualizationMatrixDropdown__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../visualizationMatrixDropdown */ "./src/visualizationMatrixDropdown.ts");
|
|
17381
17436
|
/* harmony import */ var _alternativeVizualizersWrapper__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../alternativeVizualizersWrapper */ "./src/alternativeVizualizersWrapper.ts");
|
|
17382
|
-
/* harmony import */ var
|
|
17383
|
-
/* harmony import */ var
|
|
17384
|
-
/* harmony import */ var
|
|
17385
|
-
/* harmony import */ var
|
|
17386
|
-
/* harmony import */ var
|
|
17387
|
-
/* harmony import */ var
|
|
17388
|
-
/* harmony import */ var
|
|
17389
|
-
/* harmony import */ var
|
|
17437
|
+
/* harmony import */ var _visualizationComposite__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../visualizationComposite */ "./src/visualizationComposite.ts");
|
|
17438
|
+
/* harmony import */ var _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../wordcloud/wordcloud */ "./src/wordcloud/wordcloud.ts");
|
|
17439
|
+
/* harmony import */ var _wordcloud_stopwords_index__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../wordcloud/stopwords/index */ "./src/wordcloud/stopwords/index.ts");
|
|
17440
|
+
/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../text */ "./src/text.ts");
|
|
17441
|
+
/* harmony import */ var _statistics_table__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../statistics-table */ "./src/statistics-table.ts");
|
|
17442
|
+
/* harmony import */ var _nps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../nps */ "./src/nps.ts");
|
|
17443
|
+
/* harmony import */ var _ranking__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../ranking */ "./src/ranking.ts");
|
|
17444
|
+
/* harmony import */ var _pivot__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../pivot */ "./src/pivot.ts");
|
|
17445
|
+
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../utils/index */ "./src/utils/index.ts");
|
|
17390
17446
|
|
|
17391
17447
|
//localization
|
|
17392
17448
|
|
|
@@ -17424,6 +17480,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17424
17480
|
|
|
17425
17481
|
|
|
17426
17482
|
|
|
17483
|
+
|
|
17427
17484
|
|
|
17428
17485
|
|
|
17429
17486
|
})();
|