survey-analytics 2.2.4 → 2.2.6
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 +2 -1
- package/fesm/shared.mjs.map +1 -1
- package/fesm/shared2.mjs +126 -105
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +2 -2
- package/fesm/survey.analytics.mjs +16 -26
- package/fesm/survey.analytics.mjs.map +1 -1
- package/fesm/survey.analytics.tabulator.mjs +16 -4
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +6 -5
- package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +1 -0
- package/survey-analytics-tabulator.types/localizationManager.d.ts +1 -0
- package/survey-analytics-tabulator.types/tables/extensions/tableextensions.d.ts +1 -0
- package/survey-analytics.types/analytics-localization/english.d.ts +1 -0
- package/survey-analytics.types/localizationManager.d.ts +1 -0
- package/survey-analytics.types/plotly/chart-adapter.d.ts +9 -0
- package/survey-analytics.types/statisticCalculators.d.ts +4 -0
- package/survey-analytics.types/visualizationManager.d.ts +1 -0
- package/survey-analytics.types/visualizationMatrixDropdown.d.ts +1 -0
- package/survey-analytics.types/visualizerBase.d.ts +1 -3
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +210 -144
- 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 +229 -171
- 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 +39 -5
- 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/survey.analytics.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.2.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.2.6
|
|
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
|
*/
|
|
@@ -7289,6 +7289,7 @@ var englishStrings = {
|
|
|
7289
7289
|
ascOrder: "Ascending",
|
|
7290
7290
|
descOrder: "Descending",
|
|
7291
7291
|
showMinorColumns: "Show minor columns",
|
|
7292
|
+
actionsColumn: "Actions",
|
|
7292
7293
|
otherCommentTitle: "Other items and comments",
|
|
7293
7294
|
showPercentages: "Show percentages",
|
|
7294
7295
|
hidePercentages: "Hide percentages",
|
|
@@ -8728,6 +8729,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8728
8729
|
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
8729
8730
|
/* harmony import */ var _selectBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectBase */ "./src/selectBase.ts");
|
|
8730
8731
|
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
8732
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
8733
|
+
|
|
8731
8734
|
|
|
8732
8735
|
|
|
8733
8736
|
|
|
@@ -8901,24 +8904,7 @@ var HistogramModel = /** @class */ (function (_super) {
|
|
|
8901
8904
|
};
|
|
8902
8905
|
HistogramModel.prototype.getCalculatedValuesCore = function () {
|
|
8903
8906
|
var continiousValues = this.getContiniousValues();
|
|
8904
|
-
|
|
8905
|
-
var statistics = [];
|
|
8906
|
-
var series = this.getSeriesValues();
|
|
8907
|
-
if (series.length === 0) {
|
|
8908
|
-
series.push("");
|
|
8909
|
-
}
|
|
8910
|
-
for (var i = 0; i < series.length; ++i) {
|
|
8911
|
-
statistics.push(intervals.map(function (i) { return 0; }));
|
|
8912
|
-
this._continiousData[series[i]].forEach(function (dataValue) {
|
|
8913
|
-
for (var j = 0; j < intervals.length; ++j) {
|
|
8914
|
-
if (intervals[j].start <= dataValue && (dataValue < intervals[j].end || j == intervals.length - 1)) {
|
|
8915
|
-
statistics[i][j]++;
|
|
8916
|
-
break;
|
|
8917
|
-
}
|
|
8918
|
-
}
|
|
8919
|
-
});
|
|
8920
|
-
}
|
|
8921
|
-
return statistics;
|
|
8907
|
+
return (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_5__.histogramStatisticsCalculator)(this._continiousData, this.intervals, this.getSeriesValues());
|
|
8922
8908
|
};
|
|
8923
8909
|
HistogramModel.prototype.getValueType = function () {
|
|
8924
8910
|
return this.valueType;
|
|
@@ -9617,6 +9603,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9617
9603
|
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
|
|
9618
9604
|
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/index */ "./src/utils/index.ts");
|
|
9619
9605
|
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
9606
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
9607
|
+
|
|
9620
9608
|
|
|
9621
9609
|
|
|
9622
9610
|
|
|
@@ -9716,31 +9704,11 @@ var NumberModel = /** @class */ (function (_super) {
|
|
|
9716
9704
|
return [externalCalculatedData.value || 0, externalCalculatedData.minValue || 0, externalCalculatedData.maxValue || 0];
|
|
9717
9705
|
};
|
|
9718
9706
|
NumberModel.prototype.getCalculatedValuesCore = function () {
|
|
9719
|
-
var
|
|
9707
|
+
var _a;
|
|
9720
9708
|
if (this._resultAverage === undefined ||
|
|
9721
9709
|
this._resultMin === undefined ||
|
|
9722
9710
|
this._resultMax === undefined) {
|
|
9723
|
-
this._resultMin =
|
|
9724
|
-
this._resultMax = -Number.MAX_VALUE;
|
|
9725
|
-
this._resultAverage = 0;
|
|
9726
|
-
var actualAnswerCount_1 = 0;
|
|
9727
|
-
this.data.forEach(function (rowData) {
|
|
9728
|
-
if (rowData[_this.question.name] !== undefined) {
|
|
9729
|
-
var questionValue = +rowData[_this.question.name];
|
|
9730
|
-
actualAnswerCount_1++;
|
|
9731
|
-
_this._resultAverage += questionValue;
|
|
9732
|
-
if (_this._resultMin > questionValue) {
|
|
9733
|
-
_this._resultMin = questionValue;
|
|
9734
|
-
}
|
|
9735
|
-
if (_this._resultMax < questionValue) {
|
|
9736
|
-
_this._resultMax = questionValue;
|
|
9737
|
-
}
|
|
9738
|
-
}
|
|
9739
|
-
});
|
|
9740
|
-
if (actualAnswerCount_1 > 0) {
|
|
9741
|
-
this._resultAverage = this._resultAverage / actualAnswerCount_1;
|
|
9742
|
-
}
|
|
9743
|
-
this._resultAverage = Math.ceil(this._resultAverage * 100) / 100;
|
|
9711
|
+
_a = (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_5__.mathStatisticsCalculator)(this.surveyData, this.dataNames[0]), this._resultAverage = _a[0], this._resultMin = _a[1], this._resultMax = _a[2];
|
|
9744
9712
|
}
|
|
9745
9713
|
return [this._resultAverage, this._resultMin, this._resultMax];
|
|
9746
9714
|
};
|
|
@@ -10939,6 +10907,122 @@ _visualizationManager__WEBPACK_IMPORTED_MODULE_5__.VisualizationManager.register
|
|
|
10939
10907
|
_visualizationManager__WEBPACK_IMPORTED_MODULE_5__.VisualizationManager.registerVisualizer("tagbox", SelectBase);
|
|
10940
10908
|
|
|
10941
10909
|
|
|
10910
|
+
/***/ }),
|
|
10911
|
+
|
|
10912
|
+
/***/ "./src/statisticCalculators.ts":
|
|
10913
|
+
/*!*************************************!*\
|
|
10914
|
+
!*** ./src/statisticCalculators.ts ***!
|
|
10915
|
+
\*************************************/
|
|
10916
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
10917
|
+
|
|
10918
|
+
"use strict";
|
|
10919
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10920
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10921
|
+
/* harmony export */ defaultStatisticsCalculator: () => (/* binding */ defaultStatisticsCalculator),
|
|
10922
|
+
/* harmony export */ histogramStatisticsCalculator: () => (/* binding */ histogramStatisticsCalculator),
|
|
10923
|
+
/* harmony export */ mathStatisticsCalculator: () => (/* binding */ mathStatisticsCalculator)
|
|
10924
|
+
/* harmony export */ });
|
|
10925
|
+
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
10926
|
+
|
|
10927
|
+
function defaultStatisticsCalculator(data, dataInfo) {
|
|
10928
|
+
var dataNames = dataInfo.dataNames;
|
|
10929
|
+
var statistics = [];
|
|
10930
|
+
var values = dataInfo.getValues();
|
|
10931
|
+
var valuesIndex = {};
|
|
10932
|
+
values.forEach(function (val, index) {
|
|
10933
|
+
valuesIndex[val] = index;
|
|
10934
|
+
});
|
|
10935
|
+
var processMissingAnswers = values.indexOf(undefined) !== -1;
|
|
10936
|
+
var series = dataInfo.getSeriesValues();
|
|
10937
|
+
var seriesIndex = {};
|
|
10938
|
+
series.forEach(function (val, index) {
|
|
10939
|
+
seriesIndex[val] = index;
|
|
10940
|
+
});
|
|
10941
|
+
var seriesLength = series.length || 1;
|
|
10942
|
+
for (var i = 0; i < dataNames.length; ++i) {
|
|
10943
|
+
var dataNameStatistics = new Array();
|
|
10944
|
+
for (var j = 0; j < seriesLength; ++j) {
|
|
10945
|
+
dataNameStatistics.push(new Array(values.length).fill(0));
|
|
10946
|
+
}
|
|
10947
|
+
statistics.push(dataNameStatistics);
|
|
10948
|
+
}
|
|
10949
|
+
data.forEach(function (row) {
|
|
10950
|
+
dataNames.forEach(function (dataName, index) {
|
|
10951
|
+
var rowValue = row[dataName];
|
|
10952
|
+
if (rowValue !== undefined || processMissingAnswers) {
|
|
10953
|
+
var rowValues = Array.isArray(rowValue) ? rowValue : [rowValue];
|
|
10954
|
+
if (series.length > 0) {
|
|
10955
|
+
if (row[_dataProvider__WEBPACK_IMPORTED_MODULE_0__.DataProvider.seriesMarkerKey] !== undefined) {
|
|
10956
|
+
// Series are labelled by seriesMarkerKey in row data
|
|
10957
|
+
var seriesNo_1 = seriesIndex[row[_dataProvider__WEBPACK_IMPORTED_MODULE_0__.DataProvider.seriesMarkerKey]] || 0;
|
|
10958
|
+
rowValues.forEach(function (val) {
|
|
10959
|
+
statistics[index][seriesNo_1][valuesIndex[val]]++;
|
|
10960
|
+
});
|
|
10961
|
+
}
|
|
10962
|
+
else {
|
|
10963
|
+
// Series are the keys in question value (matrix question)
|
|
10964
|
+
// TODO: think about the de-normalization and combine with the previous case
|
|
10965
|
+
rowValues.forEach(function (val) {
|
|
10966
|
+
series.forEach(function (seriesName) {
|
|
10967
|
+
if (val[seriesName] !== undefined) {
|
|
10968
|
+
var seriesNo = seriesIndex[seriesName] || 0;
|
|
10969
|
+
statistics[index][seriesNo][valuesIndex[val[seriesName]]]++;
|
|
10970
|
+
}
|
|
10971
|
+
});
|
|
10972
|
+
});
|
|
10973
|
+
}
|
|
10974
|
+
}
|
|
10975
|
+
else {
|
|
10976
|
+
// No series
|
|
10977
|
+
rowValues.forEach(function (val) { return statistics[0][0][valuesIndex[val]]++; });
|
|
10978
|
+
}
|
|
10979
|
+
}
|
|
10980
|
+
});
|
|
10981
|
+
});
|
|
10982
|
+
return dataInfo.dataNames.length > 1 ? statistics : statistics[0];
|
|
10983
|
+
}
|
|
10984
|
+
function histogramStatisticsCalculator(data, intervals, seriesValues) {
|
|
10985
|
+
var statistics = [];
|
|
10986
|
+
if (seriesValues.length === 0) {
|
|
10987
|
+
seriesValues.push("");
|
|
10988
|
+
}
|
|
10989
|
+
for (var i = 0; i < seriesValues.length; ++i) {
|
|
10990
|
+
statistics.push(intervals.map(function (i) { return 0; }));
|
|
10991
|
+
data[seriesValues[i]].forEach(function (dataValue) {
|
|
10992
|
+
for (var j = 0; j < intervals.length; ++j) {
|
|
10993
|
+
if (intervals[j].start <= dataValue && (dataValue < intervals[j].end || j == intervals.length - 1)) {
|
|
10994
|
+
statistics[i][j]++;
|
|
10995
|
+
break;
|
|
10996
|
+
}
|
|
10997
|
+
}
|
|
10998
|
+
});
|
|
10999
|
+
}
|
|
11000
|
+
return statistics;
|
|
11001
|
+
}
|
|
11002
|
+
function mathStatisticsCalculator(data, dataName) {
|
|
11003
|
+
var resultMin = Number.MAX_VALUE, resultMax = -Number.MAX_VALUE, resultAverage = 0;
|
|
11004
|
+
var actualAnswerCount = 0;
|
|
11005
|
+
data.forEach(function (rowData) {
|
|
11006
|
+
if (rowData[dataName] !== undefined) {
|
|
11007
|
+
var questionValue = +rowData[dataName];
|
|
11008
|
+
actualAnswerCount++;
|
|
11009
|
+
resultAverage += questionValue;
|
|
11010
|
+
if (resultMin > questionValue) {
|
|
11011
|
+
resultMin = questionValue;
|
|
11012
|
+
}
|
|
11013
|
+
if (resultMax < questionValue) {
|
|
11014
|
+
resultMax = questionValue;
|
|
11015
|
+
}
|
|
11016
|
+
}
|
|
11017
|
+
});
|
|
11018
|
+
if (actualAnswerCount > 0) {
|
|
11019
|
+
resultAverage = resultAverage / actualAnswerCount;
|
|
11020
|
+
}
|
|
11021
|
+
resultAverage = Math.ceil(resultAverage * 100) / 100;
|
|
11022
|
+
return [resultAverage, resultMin, resultMax];
|
|
11023
|
+
}
|
|
11024
|
+
|
|
11025
|
+
|
|
10942
11026
|
/***/ }),
|
|
10943
11027
|
|
|
10944
11028
|
/***/ "./src/statistics-table.scss":
|
|
@@ -11329,7 +11413,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11329
11413
|
/* harmony export */ __decorate: () => (/* binding */ __decorate),
|
|
11330
11414
|
/* harmony export */ __extends: () => (/* binding */ __extends),
|
|
11331
11415
|
/* harmony export */ __generator: () => (/* binding */ __generator),
|
|
11332
|
-
/* harmony export */ __rest: () => (/* binding */ __rest)
|
|
11416
|
+
/* harmony export */ __rest: () => (/* binding */ __rest),
|
|
11417
|
+
/* harmony export */ __spreadArray: () => (/* binding */ __spreadArray),
|
|
11418
|
+
/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays)
|
|
11333
11419
|
/* harmony export */ });
|
|
11334
11420
|
var __assign = Object["assign"] ||
|
|
11335
11421
|
function (target) {
|
|
@@ -11468,6 +11554,25 @@ function __generator(thisArg, body) {
|
|
|
11468
11554
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
11469
11555
|
}
|
|
11470
11556
|
}
|
|
11557
|
+
var __spreadArrays = function () {
|
|
11558
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
11559
|
+
s += arguments[i].length;
|
|
11560
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
11561
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
11562
|
+
r[k] = a[j];
|
|
11563
|
+
return r;
|
|
11564
|
+
};
|
|
11565
|
+
function __spreadArray(to, from, pack) {
|
|
11566
|
+
if (pack || arguments.length === 2)
|
|
11567
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
11568
|
+
if (ar || !(i in from)) {
|
|
11569
|
+
if (!ar)
|
|
11570
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
11571
|
+
ar[i] = from[i];
|
|
11572
|
+
}
|
|
11573
|
+
}
|
|
11574
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
11575
|
+
}
|
|
11471
11576
|
|
|
11472
11577
|
|
|
11473
11578
|
/***/ }),
|
|
@@ -11714,8 +11819,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11714
11819
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11715
11820
|
/* harmony export */ VisualizationManager: () => (/* binding */ VisualizationManager)
|
|
11716
11821
|
/* harmony export */ });
|
|
11717
|
-
/* harmony import */ var _visualizerBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./visualizerBase */ "./src/visualizerBase.ts");
|
|
11718
|
-
|
|
11719
11822
|
/**
|
|
11720
11823
|
* An object with methods used to register and unregister visualizers for individual question types.
|
|
11721
11824
|
*
|
|
@@ -11785,10 +11888,10 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
11785
11888
|
VisualizationManager.getVisualizersByType = function (questionType) {
|
|
11786
11889
|
var vDescrs = VisualizationManager.vizualizers[questionType];
|
|
11787
11890
|
if (!vDescrs) {
|
|
11788
|
-
if (
|
|
11891
|
+
if (VisualizationManager.defaultVisualizer.suppressVisualizerStubRendering) {
|
|
11789
11892
|
return [];
|
|
11790
11893
|
}
|
|
11791
|
-
return [
|
|
11894
|
+
return [VisualizationManager.defaultVisualizer];
|
|
11792
11895
|
}
|
|
11793
11896
|
vDescrs = [].concat(vDescrs);
|
|
11794
11897
|
vDescrs.sort(function (v1, v2) { return v1.index - v2.index; });
|
|
@@ -11799,7 +11902,7 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
11799
11902
|
* @see registerAltVisualizerSelector
|
|
11800
11903
|
*/
|
|
11801
11904
|
VisualizationManager.getAltVisualizerSelector = function () {
|
|
11802
|
-
return VisualizationManager.alternativesVisualizer ||
|
|
11905
|
+
return VisualizationManager.alternativesVisualizer || VisualizationManager.defaultVisualizer;
|
|
11803
11906
|
};
|
|
11804
11907
|
/**
|
|
11805
11908
|
* Registers an alternative visualizer selector.
|
|
@@ -11809,11 +11912,12 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
11809
11912
|
VisualizationManager.alternativesVisualizer = constructor;
|
|
11810
11913
|
};
|
|
11811
11914
|
VisualizationManager.getPivotVisualizerConstructor = function () {
|
|
11812
|
-
return VisualizationManager.pivotVisualizer ||
|
|
11915
|
+
return VisualizationManager.pivotVisualizer || VisualizationManager.defaultVisualizer;
|
|
11813
11916
|
};
|
|
11814
11917
|
VisualizationManager.registerPivotVisualizer = function (constructor) {
|
|
11815
11918
|
VisualizationManager.pivotVisualizer = constructor;
|
|
11816
11919
|
};
|
|
11920
|
+
VisualizationManager.defaultVisualizer = undefined;
|
|
11817
11921
|
VisualizationManager.alternativesVisualizer = undefined;
|
|
11818
11922
|
VisualizationManager.pivotVisualizer = undefined;
|
|
11819
11923
|
VisualizationManager.vizualizers = {};
|
|
@@ -11836,18 +11940,26 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11836
11940
|
/* harmony export */ VisualizationMatrixDropdown: () => (/* binding */ VisualizationMatrixDropdown)
|
|
11837
11941
|
/* harmony export */ });
|
|
11838
11942
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
11839
|
-
/* harmony import */ var
|
|
11840
|
-
/* harmony import */ var
|
|
11841
|
-
/* harmony import */ var
|
|
11842
|
-
/* harmony import */ var
|
|
11843
|
-
/* harmony import */ var _visualizationPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationPanel */ "./src/visualizationPanel.ts");
|
|
11844
|
-
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
11845
|
-
|
|
11943
|
+
/* harmony import */ var _visualizerBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizerBase */ "./src/visualizerBase.ts");
|
|
11944
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
11945
|
+
/* harmony import */ var _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizationPanel */ "./src/visualizationPanel.ts");
|
|
11946
|
+
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
11846
11947
|
|
|
11847
11948
|
|
|
11848
11949
|
|
|
11849
11950
|
|
|
11850
11951
|
|
|
11952
|
+
function isChoicesArraysEqual(choices1, choices2) {
|
|
11953
|
+
if (choices1.length !== choices2.length)
|
|
11954
|
+
return false;
|
|
11955
|
+
for (var i = 0; i < choices1.length; i++) {
|
|
11956
|
+
if (choices1[i].value !== choices2[i].value ||
|
|
11957
|
+
choices1[i].text !== choices2[i].text) {
|
|
11958
|
+
return false;
|
|
11959
|
+
}
|
|
11960
|
+
}
|
|
11961
|
+
return true;
|
|
11962
|
+
}
|
|
11851
11963
|
var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
11852
11964
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationMatrixDropdown, _super);
|
|
11853
11965
|
function VisualizationMatrixDropdown(question, data, options, name) {
|
|
@@ -11866,18 +11978,27 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
11866
11978
|
_this._childOptions.seriesValues = question.rows.map(function (row) { return row.value; });
|
|
11867
11979
|
_this._childOptions.seriesLabels = question.rows.map(function (row) { return row.text; });
|
|
11868
11980
|
var innerQuestions = _this.getQuestions();
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
var creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_3__.VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
|
|
11981
|
+
if (_this.canGroupColumns) {
|
|
11982
|
+
var creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
|
|
11872
11983
|
_this._matrixDropdownVisualizer = new creators[0](_this.question, [], _this._childOptions);
|
|
11873
11984
|
}
|
|
11874
11985
|
else {
|
|
11875
|
-
_this._matrixDropdownVisualizer = new
|
|
11986
|
+
_this._matrixDropdownVisualizer = new _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__.VisualizationPanel(innerQuestions, [], _this._childOptions);
|
|
11876
11987
|
}
|
|
11877
11988
|
_this._matrixDropdownVisualizer.onAfterRender.add(_this.onPanelAfterRenderCallback);
|
|
11878
11989
|
_this.updateData(data);
|
|
11879
11990
|
return _this;
|
|
11880
11991
|
}
|
|
11992
|
+
Object.defineProperty(VisualizationMatrixDropdown.prototype, "canGroupColumns", {
|
|
11993
|
+
get: function () {
|
|
11994
|
+
var _this = this;
|
|
11995
|
+
var innerQuestions = this.getQuestions();
|
|
11996
|
+
var canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(function (innerQuestion) { return isChoicesArraysEqual(innerQuestion.choices, _this.question.choices); });
|
|
11997
|
+
return canGroupColumns;
|
|
11998
|
+
},
|
|
11999
|
+
enumerable: false,
|
|
12000
|
+
configurable: true
|
|
12001
|
+
});
|
|
11881
12002
|
VisualizationMatrixDropdown.prototype.setLocale = function (newLocale) {
|
|
11882
12003
|
_super.prototype.setLocale.call(this, newLocale);
|
|
11883
12004
|
this._childOptions.seriesLabels = this.question.rows.map(function (row) { return row.text; });
|
|
@@ -11898,7 +12019,7 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
11898
12019
|
if (!!rawDataItem) {
|
|
11899
12020
|
Object.keys(rawDataItem).forEach(function (key) {
|
|
11900
12021
|
var nestedDataItem = Object.assign({}, rawDataItem[key]);
|
|
11901
|
-
nestedDataItem[
|
|
12022
|
+
nestedDataItem[_dataProvider__WEBPACK_IMPORTED_MODULE_4__.DataProvider.seriesMarkerKey] = key;
|
|
11902
12023
|
panelData.push(nestedDataItem);
|
|
11903
12024
|
});
|
|
11904
12025
|
}
|
|
@@ -11935,9 +12056,9 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
11935
12056
|
this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback);
|
|
11936
12057
|
};
|
|
11937
12058
|
return VisualizationMatrixDropdown;
|
|
11938
|
-
}(
|
|
12059
|
+
}(_visualizerBase__WEBPACK_IMPORTED_MODULE_1__.VisualizerBase));
|
|
11939
12060
|
|
|
11940
|
-
|
|
12061
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.registerVisualizer("matrixdropdown", VisualizationMatrixDropdown);
|
|
11941
12062
|
|
|
11942
12063
|
|
|
11943
12064
|
/***/ }),
|
|
@@ -12887,17 +13008,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12887
13008
|
__webpack_require__.r(__webpack_exports__);
|
|
12888
13009
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12889
13010
|
/* harmony export */ PostponeHelper: () => (/* binding */ PostponeHelper),
|
|
12890
|
-
/* harmony export */ VisualizerBase: () => (/* binding */ VisualizerBase)
|
|
12891
|
-
/* harmony export */ defaultStatisticsCalculator: () => (/* binding */ defaultStatisticsCalculator)
|
|
13011
|
+
/* harmony export */ VisualizerBase: () => (/* binding */ VisualizerBase)
|
|
12892
13012
|
/* harmony export */ });
|
|
12893
13013
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
12894
13014
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
12895
13015
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
12896
13016
|
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
12897
13017
|
/* harmony import */ var _visualizerFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizerFactory */ "./src/visualizerFactory.ts");
|
|
12898
|
-
/* harmony import */ var
|
|
12899
|
-
/* harmony import */ var
|
|
12900
|
-
/* harmony import */ var
|
|
13018
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
13019
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./src/utils/index.ts");
|
|
13020
|
+
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
|
|
13021
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
13022
|
+
/* harmony import */ var _visualizerBase_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualizerBase.scss */ "./src/visualizerBase.scss");
|
|
13023
|
+
|
|
12901
13024
|
|
|
12902
13025
|
|
|
12903
13026
|
|
|
@@ -13321,7 +13444,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13321
13444
|
};
|
|
13322
13445
|
VisualizerBase.prototype.renderToolbar = function (container) {
|
|
13323
13446
|
if (this.showToolbar) {
|
|
13324
|
-
var toolbar_1 = (
|
|
13447
|
+
var toolbar_1 = (_utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-toolbar"));
|
|
13325
13448
|
this.createToolbarItems(toolbar_1);
|
|
13326
13449
|
container.appendChild(toolbar_1);
|
|
13327
13450
|
}
|
|
@@ -13348,8 +13471,8 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13348
13471
|
this.options.renderHeader(container, this);
|
|
13349
13472
|
}
|
|
13350
13473
|
else {
|
|
13351
|
-
var correctAnswerElement =
|
|
13352
|
-
correctAnswerElement.innerText =
|
|
13474
|
+
var correctAnswerElement = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__correct-answer");
|
|
13475
|
+
correctAnswerElement.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("correctAnswer") + this.getCorrectAnswerText();
|
|
13353
13476
|
container.appendChild(correctAnswerElement);
|
|
13354
13477
|
}
|
|
13355
13478
|
};
|
|
@@ -13360,7 +13483,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13360
13483
|
switch (_a.label) {
|
|
13361
13484
|
case 0:
|
|
13362
13485
|
if (!this._chartAdapter) return [3 /*break*/, 2];
|
|
13363
|
-
chartNode =
|
|
13486
|
+
chartNode = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div");
|
|
13364
13487
|
container.innerHTML = "";
|
|
13365
13488
|
container.appendChild(chartNode);
|
|
13366
13489
|
return [4 /*yield*/, this._chartAdapter.create(chartNode)];
|
|
@@ -13368,7 +13491,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13368
13491
|
_a.sent();
|
|
13369
13492
|
return [3 /*break*/, 3];
|
|
13370
13493
|
case 2:
|
|
13371
|
-
container.innerText =
|
|
13494
|
+
container.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("noVisualizerForQuestion");
|
|
13372
13495
|
_a.label = 3;
|
|
13373
13496
|
case 3: return [2 /*return*/, container];
|
|
13374
13497
|
}
|
|
@@ -13408,23 +13531,23 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13408
13531
|
var _this = this;
|
|
13409
13532
|
container.innerHTML = "";
|
|
13410
13533
|
if (this.hasFooter) {
|
|
13411
|
-
var footerTitleElement =
|
|
13534
|
+
var footerTitleElement = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("h4", "sa-visualizer__footer-title", { innerText: _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("otherCommentTitle") });
|
|
13412
13535
|
container.appendChild(footerTitleElement);
|
|
13413
|
-
var footerContentElement_1 =
|
|
13536
|
+
var footerContentElement_1 = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__footer-content");
|
|
13414
13537
|
footerContentElement_1.style.display = VisualizerBase.otherCommentCollapsed
|
|
13415
13538
|
? "none"
|
|
13416
13539
|
: "block";
|
|
13417
|
-
var visibilityButton_1 =
|
|
13540
|
+
var visibilityButton_1 = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createButton(function () {
|
|
13418
13541
|
if (footerContentElement_1.style.display === "none") {
|
|
13419
13542
|
footerContentElement_1.style.display = "block";
|
|
13420
|
-
visibilityButton_1.innerText =
|
|
13543
|
+
visibilityButton_1.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("hideButton");
|
|
13421
13544
|
}
|
|
13422
13545
|
else {
|
|
13423
13546
|
footerContentElement_1.style.display = "none";
|
|
13424
|
-
visibilityButton_1.innerText =
|
|
13547
|
+
visibilityButton_1.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString(VisualizerBase.otherCommentCollapsed ? "showButton" : "hideButton");
|
|
13425
13548
|
}
|
|
13426
13549
|
_this.footerVisualizer.invokeOnUpdate();
|
|
13427
|
-
},
|
|
13550
|
+
}, _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("showButton") /*, "sa-toolbar__button--right"*/);
|
|
13428
13551
|
container.appendChild(visibilityButton_1);
|
|
13429
13552
|
container.appendChild(footerContentElement_1);
|
|
13430
13553
|
this.footerVisualizer.render(footerContentElement_1);
|
|
@@ -13439,18 +13562,18 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13439
13562
|
targetElement = document.getElementById(targetElement);
|
|
13440
13563
|
}
|
|
13441
13564
|
this.renderResult = targetElement;
|
|
13442
|
-
this.toolbarContainer =
|
|
13565
|
+
this.toolbarContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__toolbar");
|
|
13443
13566
|
targetElement.appendChild(this.toolbarContainer);
|
|
13444
13567
|
this.renderToolbar(this.toolbarContainer);
|
|
13445
13568
|
if (this.hasHeader) {
|
|
13446
|
-
this.headerContainer =
|
|
13569
|
+
this.headerContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__header");
|
|
13447
13570
|
targetElement.appendChild(this.headerContainer);
|
|
13448
13571
|
this.renderHeader(this.headerContainer);
|
|
13449
13572
|
}
|
|
13450
|
-
this.contentContainer =
|
|
13573
|
+
this.contentContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__content");
|
|
13451
13574
|
targetElement.appendChild(this.contentContainer);
|
|
13452
13575
|
this.renderContent(this.contentContainer);
|
|
13453
|
-
this.footerContainer =
|
|
13576
|
+
this.footerContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__footer");
|
|
13454
13577
|
targetElement.appendChild(this.footerContainer);
|
|
13455
13578
|
this.renderFooter(this.footerContainer);
|
|
13456
13579
|
};
|
|
@@ -13575,10 +13698,10 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13575
13698
|
if (!!this._getDataCore) {
|
|
13576
13699
|
return this._getDataCore(this);
|
|
13577
13700
|
}
|
|
13578
|
-
return defaultStatisticsCalculator(this.surveyData, this);
|
|
13701
|
+
return (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_7__.defaultStatisticsCalculator)(this.surveyData, this);
|
|
13579
13702
|
};
|
|
13580
13703
|
VisualizerBase.prototype.renderLoadingIndicator = function (contentContainer) {
|
|
13581
|
-
contentContainer.appendChild((0,
|
|
13704
|
+
contentContainer.appendChild((0,_utils__WEBPACK_IMPORTED_MODULE_5__.createLoadingIndicator)());
|
|
13582
13705
|
};
|
|
13583
13706
|
VisualizerBase.prototype.convertFromExternalData = function (externalCalculatedData) {
|
|
13584
13707
|
return externalCalculatedData;
|
|
@@ -13666,7 +13789,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13666
13789
|
if (!!survey) {
|
|
13667
13790
|
return survey.locale;
|
|
13668
13791
|
}
|
|
13669
|
-
return
|
|
13792
|
+
return _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale;
|
|
13670
13793
|
},
|
|
13671
13794
|
set: function (newLocale) {
|
|
13672
13795
|
this.setLocale(newLocale);
|
|
@@ -13677,7 +13800,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13677
13800
|
configurable: true
|
|
13678
13801
|
});
|
|
13679
13802
|
VisualizerBase.prototype.setLocale = function (newLocale) {
|
|
13680
|
-
|
|
13803
|
+
_localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale = newLocale;
|
|
13681
13804
|
var survey = this.options.survey;
|
|
13682
13805
|
if (!!survey && survey.locale !== newLocale) {
|
|
13683
13806
|
survey.locale = newLocale;
|
|
@@ -13703,63 +13826,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
13703
13826
|
return VisualizerBase;
|
|
13704
13827
|
}());
|
|
13705
13828
|
|
|
13706
|
-
|
|
13707
|
-
var dataNames = dataInfo.dataNames;
|
|
13708
|
-
var statistics = [];
|
|
13709
|
-
var values = dataInfo.getValues();
|
|
13710
|
-
var valuesIndex = {};
|
|
13711
|
-
values.forEach(function (val, index) {
|
|
13712
|
-
valuesIndex[val] = index;
|
|
13713
|
-
});
|
|
13714
|
-
var processMissingAnswers = values.indexOf(undefined) !== -1;
|
|
13715
|
-
var series = dataInfo.getSeriesValues();
|
|
13716
|
-
var seriesIndex = {};
|
|
13717
|
-
series.forEach(function (val, index) {
|
|
13718
|
-
seriesIndex[val] = index;
|
|
13719
|
-
});
|
|
13720
|
-
var seriesLength = series.length || 1;
|
|
13721
|
-
for (var i = 0; i < dataNames.length; ++i) {
|
|
13722
|
-
var dataNameStatistics = new Array();
|
|
13723
|
-
for (var j = 0; j < seriesLength; ++j) {
|
|
13724
|
-
dataNameStatistics.push(new Array(values.length).fill(0));
|
|
13725
|
-
}
|
|
13726
|
-
statistics.push(dataNameStatistics);
|
|
13727
|
-
}
|
|
13728
|
-
data.forEach(function (row) {
|
|
13729
|
-
dataNames.forEach(function (dataName, index) {
|
|
13730
|
-
var rowValue = row[dataName];
|
|
13731
|
-
if (rowValue !== undefined || processMissingAnswers) {
|
|
13732
|
-
var rowValues = Array.isArray(rowValue) ? rowValue : [rowValue];
|
|
13733
|
-
if (series.length > 0) {
|
|
13734
|
-
if (row[_dataProvider__WEBPACK_IMPORTED_MODULE_2__.DataProvider.seriesMarkerKey] !== undefined) {
|
|
13735
|
-
// Series are labelled by seriesMarkerKey in row data
|
|
13736
|
-
var seriesNo_1 = seriesIndex[row[_dataProvider__WEBPACK_IMPORTED_MODULE_2__.DataProvider.seriesMarkerKey]] || 0;
|
|
13737
|
-
rowValues.forEach(function (val) {
|
|
13738
|
-
statistics[index][seriesNo_1][valuesIndex[val]]++;
|
|
13739
|
-
});
|
|
13740
|
-
}
|
|
13741
|
-
else {
|
|
13742
|
-
// Series are the keys in question value (matrix question)
|
|
13743
|
-
// TODO: think about the de-normalization and combine with the previous case
|
|
13744
|
-
rowValues.forEach(function (val) {
|
|
13745
|
-
series.forEach(function (seriesName) {
|
|
13746
|
-
if (val[seriesName] !== undefined) {
|
|
13747
|
-
var seriesNo = seriesIndex[seriesName] || 0;
|
|
13748
|
-
statistics[index][seriesNo][valuesIndex[val[seriesName]]]++;
|
|
13749
|
-
}
|
|
13750
|
-
});
|
|
13751
|
-
});
|
|
13752
|
-
}
|
|
13753
|
-
}
|
|
13754
|
-
else {
|
|
13755
|
-
// No series
|
|
13756
|
-
rowValues.forEach(function (val) { return statistics[0][0][valuesIndex[val]]++; });
|
|
13757
|
-
}
|
|
13758
|
-
}
|
|
13759
|
-
});
|
|
13760
|
-
});
|
|
13761
|
-
return dataInfo.dataNames.length > 1 ? statistics : statistics[0];
|
|
13762
|
-
}
|
|
13829
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_4__.VisualizationManager.defaultVisualizer = VisualizerBase;
|
|
13763
13830
|
|
|
13764
13831
|
|
|
13765
13832
|
/***/ }),
|
|
@@ -15755,7 +15822,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15755
15822
|
/* harmony export */ VisualizerFactory: () => (/* reexport safe */ _visualizerFactory__WEBPACK_IMPORTED_MODULE_15__.VisualizerFactory),
|
|
15756
15823
|
/* harmony export */ WordCloud: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_28__.WordCloud),
|
|
15757
15824
|
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_28__.WordCloudAdapter),
|
|
15758
|
-
/* harmony export */ defaultStatisticsCalculator: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_21__.defaultStatisticsCalculator),
|
|
15759
15825
|
/* harmony export */ hideEmptyAnswersInData: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_16__.hideEmptyAnswersInData),
|
|
15760
15826
|
/* harmony export */ localization: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.localization),
|
|
15761
15827
|
/* harmony export */ surveyStrings: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.surveyStrings),
|