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.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",
|
|
@@ -8696,7 +8697,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8696
8697
|
/* harmony export */ VisualizerFactory: () => (/* reexport safe */ _visualizerFactory__WEBPACK_IMPORTED_MODULE_15__.VisualizerFactory),
|
|
8697
8698
|
/* harmony export */ WordCloud: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_28__.WordCloud),
|
|
8698
8699
|
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */ _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_28__.WordCloudAdapter),
|
|
8699
|
-
/* harmony export */ defaultStatisticsCalculator: () => (/* reexport safe */ _visualizerBase__WEBPACK_IMPORTED_MODULE_21__.defaultStatisticsCalculator),
|
|
8700
8700
|
/* harmony export */ hideEmptyAnswersInData: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_16__.hideEmptyAnswersInData),
|
|
8701
8701
|
/* harmony export */ localization: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.localization),
|
|
8702
8702
|
/* harmony export */ surveyStrings: () => (/* reexport safe */ _localizationManager__WEBPACK_IMPORTED_MODULE_0__.surveyStrings),
|
|
@@ -8847,6 +8847,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8847
8847
|
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
8848
8848
|
/* harmony import */ var _selectBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectBase */ "./src/selectBase.ts");
|
|
8849
8849
|
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
8850
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
8851
|
+
|
|
8850
8852
|
|
|
8851
8853
|
|
|
8852
8854
|
|
|
@@ -9020,24 +9022,7 @@ var HistogramModel = /** @class */ (function (_super) {
|
|
|
9020
9022
|
};
|
|
9021
9023
|
HistogramModel.prototype.getCalculatedValuesCore = function () {
|
|
9022
9024
|
var continiousValues = this.getContiniousValues();
|
|
9023
|
-
|
|
9024
|
-
var statistics = [];
|
|
9025
|
-
var series = this.getSeriesValues();
|
|
9026
|
-
if (series.length === 0) {
|
|
9027
|
-
series.push("");
|
|
9028
|
-
}
|
|
9029
|
-
for (var i = 0; i < series.length; ++i) {
|
|
9030
|
-
statistics.push(intervals.map(function (i) { return 0; }));
|
|
9031
|
-
this._continiousData[series[i]].forEach(function (dataValue) {
|
|
9032
|
-
for (var j = 0; j < intervals.length; ++j) {
|
|
9033
|
-
if (intervals[j].start <= dataValue && (dataValue < intervals[j].end || j == intervals.length - 1)) {
|
|
9034
|
-
statistics[i][j]++;
|
|
9035
|
-
break;
|
|
9036
|
-
}
|
|
9037
|
-
}
|
|
9038
|
-
});
|
|
9039
|
-
}
|
|
9040
|
-
return statistics;
|
|
9025
|
+
return (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_5__.histogramStatisticsCalculator)(this._continiousData, this.intervals, this.getSeriesValues());
|
|
9041
9026
|
};
|
|
9042
9027
|
HistogramModel.prototype.getValueType = function () {
|
|
9043
9028
|
return this.valueType;
|
|
@@ -9523,7 +9508,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9523
9508
|
/* harmony export */ });
|
|
9524
9509
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
9525
9510
|
/* harmony import */ var _selectBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectBase */ "./src/selectBase.ts");
|
|
9526
|
-
/* harmony import */ var
|
|
9511
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
9527
9512
|
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
9528
9513
|
|
|
9529
9514
|
|
|
@@ -9569,7 +9554,7 @@ var MatrixDropdownGrouped = /** @class */ (function (_super) {
|
|
|
9569
9554
|
var values = this.getValues();
|
|
9570
9555
|
var series = this.getSeriesValues();
|
|
9571
9556
|
var rows = this.matrixQuestion.rows.map(function (row) { return row.value; });
|
|
9572
|
-
var statistics = (0,
|
|
9557
|
+
var statistics = (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_2__.defaultStatisticsCalculator)(this.surveyData, {
|
|
9573
9558
|
name: this.name,
|
|
9574
9559
|
dataNames: series,
|
|
9575
9560
|
getValues: function () { return values; },
|
|
@@ -9813,6 +9798,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9813
9798
|
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
|
|
9814
9799
|
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/index */ "./src/utils/index.ts");
|
|
9815
9800
|
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
9801
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
9802
|
+
|
|
9816
9803
|
|
|
9817
9804
|
|
|
9818
9805
|
|
|
@@ -9912,31 +9899,11 @@ var NumberModel = /** @class */ (function (_super) {
|
|
|
9912
9899
|
return [externalCalculatedData.value || 0, externalCalculatedData.minValue || 0, externalCalculatedData.maxValue || 0];
|
|
9913
9900
|
};
|
|
9914
9901
|
NumberModel.prototype.getCalculatedValuesCore = function () {
|
|
9915
|
-
var
|
|
9902
|
+
var _a;
|
|
9916
9903
|
if (this._resultAverage === undefined ||
|
|
9917
9904
|
this._resultMin === undefined ||
|
|
9918
9905
|
this._resultMax === undefined) {
|
|
9919
|
-
this._resultMin =
|
|
9920
|
-
this._resultMax = -Number.MAX_VALUE;
|
|
9921
|
-
this._resultAverage = 0;
|
|
9922
|
-
var actualAnswerCount_1 = 0;
|
|
9923
|
-
this.data.forEach(function (rowData) {
|
|
9924
|
-
if (rowData[_this.question.name] !== undefined) {
|
|
9925
|
-
var questionValue = +rowData[_this.question.name];
|
|
9926
|
-
actualAnswerCount_1++;
|
|
9927
|
-
_this._resultAverage += questionValue;
|
|
9928
|
-
if (_this._resultMin > questionValue) {
|
|
9929
|
-
_this._resultMin = questionValue;
|
|
9930
|
-
}
|
|
9931
|
-
if (_this._resultMax < questionValue) {
|
|
9932
|
-
_this._resultMax = questionValue;
|
|
9933
|
-
}
|
|
9934
|
-
}
|
|
9935
|
-
});
|
|
9936
|
-
if (actualAnswerCount_1 > 0) {
|
|
9937
|
-
this._resultAverage = this._resultAverage / actualAnswerCount_1;
|
|
9938
|
-
}
|
|
9939
|
-
this._resultAverage = Math.ceil(this._resultAverage * 100) / 100;
|
|
9906
|
+
_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];
|
|
9940
9907
|
}
|
|
9941
9908
|
return [this._resultAverage, this._resultMin, this._resultMax];
|
|
9942
9909
|
};
|
|
@@ -10380,7 +10347,8 @@ _visualizationManager__WEBPACK_IMPORTED_MODULE_6__.VisualizationManager.register
|
|
|
10380
10347
|
"use strict";
|
|
10381
10348
|
__webpack_require__.r(__webpack_exports__);
|
|
10382
10349
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10383
|
-
/* harmony export */ PlotlyChartAdapter: () => (/* binding */ PlotlyChartAdapter)
|
|
10350
|
+
/* harmony export */ PlotlyChartAdapter: () => (/* binding */ PlotlyChartAdapter),
|
|
10351
|
+
/* harmony export */ plotlyChartTypes: () => (/* binding */ plotlyChartTypes)
|
|
10384
10352
|
/* harmony export */ });
|
|
10385
10353
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
10386
10354
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
@@ -10402,6 +10370,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10402
10370
|
|
|
10403
10371
|
|
|
10404
10372
|
|
|
10373
|
+
var plotlyChartTypes = {
|
|
10374
|
+
"boolean": _legacy__WEBPACK_IMPORTED_MODULE_8__.BooleanPlotly.types,
|
|
10375
|
+
"number": _legacy__WEBPACK_IMPORTED_MODULE_8__.GaugePlotly.types,
|
|
10376
|
+
"selectBase": _legacy__WEBPACK_IMPORTED_MODULE_8__.SelectBasePlotly.types,
|
|
10377
|
+
"histogram": _legacy__WEBPACK_IMPORTED_MODULE_8__.HistogramPlotly.types,
|
|
10378
|
+
"matrix": _legacy__WEBPACK_IMPORTED_MODULE_8__.MatrixPlotly.types,
|
|
10379
|
+
"matrixDropdownGrouped": _legacy__WEBPACK_IMPORTED_MODULE_8__.MatrixDropdownGroupedPlotly.types,
|
|
10380
|
+
"pivot": _legacy__WEBPACK_IMPORTED_MODULE_8__.PivotPlotly.types,
|
|
10381
|
+
};
|
|
10405
10382
|
var PlotlyChartAdapter = /** @class */ (function () {
|
|
10406
10383
|
function PlotlyChartAdapter(model) {
|
|
10407
10384
|
this.model = model;
|
|
@@ -10442,28 +10419,8 @@ var PlotlyChartAdapter = /** @class */ (function () {
|
|
|
10442
10419
|
});
|
|
10443
10420
|
PlotlyChartAdapter.prototype.getChartTypes = function () {
|
|
10444
10421
|
var visualizerType = this.model.type;
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
}
|
|
10448
|
-
else if (visualizerType === "number") {
|
|
10449
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.GaugePlotly.types;
|
|
10450
|
-
}
|
|
10451
|
-
else if (visualizerType === "selectBase") {
|
|
10452
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.SelectBasePlotly.types;
|
|
10453
|
-
}
|
|
10454
|
-
else if (visualizerType === "histogram") {
|
|
10455
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.HistogramPlotly.types;
|
|
10456
|
-
}
|
|
10457
|
-
else if (visualizerType === "matrix") {
|
|
10458
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.MatrixPlotly.types;
|
|
10459
|
-
}
|
|
10460
|
-
else if (visualizerType === "matrixDropdownGrouped") {
|
|
10461
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.MatrixDropdownGroupedPlotly.types;
|
|
10462
|
-
}
|
|
10463
|
-
else if (visualizerType === "pivot") {
|
|
10464
|
-
return _legacy__WEBPACK_IMPORTED_MODULE_8__.PivotPlotly.types;
|
|
10465
|
-
}
|
|
10466
|
-
return [];
|
|
10422
|
+
var chartCtypes = plotlyChartTypes[visualizerType];
|
|
10423
|
+
return chartCtypes || [];
|
|
10467
10424
|
};
|
|
10468
10425
|
PlotlyChartAdapter.prototype.create = function (chartNode) {
|
|
10469
10426
|
return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
|
|
@@ -10574,6 +10531,7 @@ var PlotlyChartAdapter = /** @class */ (function () {
|
|
|
10574
10531
|
options = {
|
|
10575
10532
|
traces: plotlyOptions.traces,
|
|
10576
10533
|
layout: plotlyOptions.layout,
|
|
10534
|
+
data: answersData,
|
|
10577
10535
|
config: config,
|
|
10578
10536
|
};
|
|
10579
10537
|
_setup__WEBPACK_IMPORTED_MODULE_5__.PlotlySetup.onPlotCreating.fire(this.model, options);
|
|
@@ -10615,7 +10573,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10615
10573
|
/* harmony export */ PlotlyChartAdapter: () => (/* reexport safe */ _chart_adapter__WEBPACK_IMPORTED_MODULE_1__.PlotlyChartAdapter),
|
|
10616
10574
|
/* harmony export */ PlotlySetup: () => (/* reexport safe */ _setup__WEBPACK_IMPORTED_MODULE_0__.PlotlySetup),
|
|
10617
10575
|
/* harmony export */ RankingPlotly: () => (/* reexport safe */ _legacy__WEBPACK_IMPORTED_MODULE_2__.RankingPlotly),
|
|
10618
|
-
/* harmony export */ SelectBasePlotly: () => (/* reexport safe */ _legacy__WEBPACK_IMPORTED_MODULE_2__.SelectBasePlotly)
|
|
10576
|
+
/* harmony export */ SelectBasePlotly: () => (/* reexport safe */ _legacy__WEBPACK_IMPORTED_MODULE_2__.SelectBasePlotly),
|
|
10577
|
+
/* harmony export */ plotlyChartTypes: () => (/* reexport safe */ _chart_adapter__WEBPACK_IMPORTED_MODULE_1__.plotlyChartTypes)
|
|
10619
10578
|
/* harmony export */ });
|
|
10620
10579
|
/* harmony import */ var _setup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setup */ "./src/plotly/setup.ts");
|
|
10621
10580
|
/* harmony import */ var _chart_adapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chart-adapter */ "./src/plotly/chart-adapter.ts");
|
|
@@ -11969,6 +11928,122 @@ _visualizationManager__WEBPACK_IMPORTED_MODULE_5__.VisualizationManager.register
|
|
|
11969
11928
|
_visualizationManager__WEBPACK_IMPORTED_MODULE_5__.VisualizationManager.registerVisualizer("tagbox", SelectBase);
|
|
11970
11929
|
|
|
11971
11930
|
|
|
11931
|
+
/***/ }),
|
|
11932
|
+
|
|
11933
|
+
/***/ "./src/statisticCalculators.ts":
|
|
11934
|
+
/*!*************************************!*\
|
|
11935
|
+
!*** ./src/statisticCalculators.ts ***!
|
|
11936
|
+
\*************************************/
|
|
11937
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11938
|
+
|
|
11939
|
+
"use strict";
|
|
11940
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11941
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11942
|
+
/* harmony export */ defaultStatisticsCalculator: () => (/* binding */ defaultStatisticsCalculator),
|
|
11943
|
+
/* harmony export */ histogramStatisticsCalculator: () => (/* binding */ histogramStatisticsCalculator),
|
|
11944
|
+
/* harmony export */ mathStatisticsCalculator: () => (/* binding */ mathStatisticsCalculator)
|
|
11945
|
+
/* harmony export */ });
|
|
11946
|
+
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
11947
|
+
|
|
11948
|
+
function defaultStatisticsCalculator(data, dataInfo) {
|
|
11949
|
+
var dataNames = dataInfo.dataNames;
|
|
11950
|
+
var statistics = [];
|
|
11951
|
+
var values = dataInfo.getValues();
|
|
11952
|
+
var valuesIndex = {};
|
|
11953
|
+
values.forEach(function (val, index) {
|
|
11954
|
+
valuesIndex[val] = index;
|
|
11955
|
+
});
|
|
11956
|
+
var processMissingAnswers = values.indexOf(undefined) !== -1;
|
|
11957
|
+
var series = dataInfo.getSeriesValues();
|
|
11958
|
+
var seriesIndex = {};
|
|
11959
|
+
series.forEach(function (val, index) {
|
|
11960
|
+
seriesIndex[val] = index;
|
|
11961
|
+
});
|
|
11962
|
+
var seriesLength = series.length || 1;
|
|
11963
|
+
for (var i = 0; i < dataNames.length; ++i) {
|
|
11964
|
+
var dataNameStatistics = new Array();
|
|
11965
|
+
for (var j = 0; j < seriesLength; ++j) {
|
|
11966
|
+
dataNameStatistics.push(new Array(values.length).fill(0));
|
|
11967
|
+
}
|
|
11968
|
+
statistics.push(dataNameStatistics);
|
|
11969
|
+
}
|
|
11970
|
+
data.forEach(function (row) {
|
|
11971
|
+
dataNames.forEach(function (dataName, index) {
|
|
11972
|
+
var rowValue = row[dataName];
|
|
11973
|
+
if (rowValue !== undefined || processMissingAnswers) {
|
|
11974
|
+
var rowValues = Array.isArray(rowValue) ? rowValue : [rowValue];
|
|
11975
|
+
if (series.length > 0) {
|
|
11976
|
+
if (row[_dataProvider__WEBPACK_IMPORTED_MODULE_0__.DataProvider.seriesMarkerKey] !== undefined) {
|
|
11977
|
+
// Series are labelled by seriesMarkerKey in row data
|
|
11978
|
+
var seriesNo_1 = seriesIndex[row[_dataProvider__WEBPACK_IMPORTED_MODULE_0__.DataProvider.seriesMarkerKey]] || 0;
|
|
11979
|
+
rowValues.forEach(function (val) {
|
|
11980
|
+
statistics[index][seriesNo_1][valuesIndex[val]]++;
|
|
11981
|
+
});
|
|
11982
|
+
}
|
|
11983
|
+
else {
|
|
11984
|
+
// Series are the keys in question value (matrix question)
|
|
11985
|
+
// TODO: think about the de-normalization and combine with the previous case
|
|
11986
|
+
rowValues.forEach(function (val) {
|
|
11987
|
+
series.forEach(function (seriesName) {
|
|
11988
|
+
if (val[seriesName] !== undefined) {
|
|
11989
|
+
var seriesNo = seriesIndex[seriesName] || 0;
|
|
11990
|
+
statistics[index][seriesNo][valuesIndex[val[seriesName]]]++;
|
|
11991
|
+
}
|
|
11992
|
+
});
|
|
11993
|
+
});
|
|
11994
|
+
}
|
|
11995
|
+
}
|
|
11996
|
+
else {
|
|
11997
|
+
// No series
|
|
11998
|
+
rowValues.forEach(function (val) { return statistics[0][0][valuesIndex[val]]++; });
|
|
11999
|
+
}
|
|
12000
|
+
}
|
|
12001
|
+
});
|
|
12002
|
+
});
|
|
12003
|
+
return dataInfo.dataNames.length > 1 ? statistics : statistics[0];
|
|
12004
|
+
}
|
|
12005
|
+
function histogramStatisticsCalculator(data, intervals, seriesValues) {
|
|
12006
|
+
var statistics = [];
|
|
12007
|
+
if (seriesValues.length === 0) {
|
|
12008
|
+
seriesValues.push("");
|
|
12009
|
+
}
|
|
12010
|
+
for (var i = 0; i < seriesValues.length; ++i) {
|
|
12011
|
+
statistics.push(intervals.map(function (i) { return 0; }));
|
|
12012
|
+
data[seriesValues[i]].forEach(function (dataValue) {
|
|
12013
|
+
for (var j = 0; j < intervals.length; ++j) {
|
|
12014
|
+
if (intervals[j].start <= dataValue && (dataValue < intervals[j].end || j == intervals.length - 1)) {
|
|
12015
|
+
statistics[i][j]++;
|
|
12016
|
+
break;
|
|
12017
|
+
}
|
|
12018
|
+
}
|
|
12019
|
+
});
|
|
12020
|
+
}
|
|
12021
|
+
return statistics;
|
|
12022
|
+
}
|
|
12023
|
+
function mathStatisticsCalculator(data, dataName) {
|
|
12024
|
+
var resultMin = Number.MAX_VALUE, resultMax = -Number.MAX_VALUE, resultAverage = 0;
|
|
12025
|
+
var actualAnswerCount = 0;
|
|
12026
|
+
data.forEach(function (rowData) {
|
|
12027
|
+
if (rowData[dataName] !== undefined) {
|
|
12028
|
+
var questionValue = +rowData[dataName];
|
|
12029
|
+
actualAnswerCount++;
|
|
12030
|
+
resultAverage += questionValue;
|
|
12031
|
+
if (resultMin > questionValue) {
|
|
12032
|
+
resultMin = questionValue;
|
|
12033
|
+
}
|
|
12034
|
+
if (resultMax < questionValue) {
|
|
12035
|
+
resultMax = questionValue;
|
|
12036
|
+
}
|
|
12037
|
+
}
|
|
12038
|
+
});
|
|
12039
|
+
if (actualAnswerCount > 0) {
|
|
12040
|
+
resultAverage = resultAverage / actualAnswerCount;
|
|
12041
|
+
}
|
|
12042
|
+
resultAverage = Math.ceil(resultAverage * 100) / 100;
|
|
12043
|
+
return [resultAverage, resultMin, resultMax];
|
|
12044
|
+
}
|
|
12045
|
+
|
|
12046
|
+
|
|
11972
12047
|
/***/ }),
|
|
11973
12048
|
|
|
11974
12049
|
/***/ "./src/statistics-table.scss":
|
|
@@ -12359,7 +12434,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12359
12434
|
/* harmony export */ __decorate: () => (/* binding */ __decorate),
|
|
12360
12435
|
/* harmony export */ __extends: () => (/* binding */ __extends),
|
|
12361
12436
|
/* harmony export */ __generator: () => (/* binding */ __generator),
|
|
12362
|
-
/* harmony export */ __rest: () => (/* binding */ __rest)
|
|
12437
|
+
/* harmony export */ __rest: () => (/* binding */ __rest),
|
|
12438
|
+
/* harmony export */ __spreadArray: () => (/* binding */ __spreadArray),
|
|
12439
|
+
/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays)
|
|
12363
12440
|
/* harmony export */ });
|
|
12364
12441
|
var __assign = Object["assign"] ||
|
|
12365
12442
|
function (target) {
|
|
@@ -12498,6 +12575,25 @@ function __generator(thisArg, body) {
|
|
|
12498
12575
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
12499
12576
|
}
|
|
12500
12577
|
}
|
|
12578
|
+
var __spreadArrays = function () {
|
|
12579
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
12580
|
+
s += arguments[i].length;
|
|
12581
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
12582
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
12583
|
+
r[k] = a[j];
|
|
12584
|
+
return r;
|
|
12585
|
+
};
|
|
12586
|
+
function __spreadArray(to, from, pack) {
|
|
12587
|
+
if (pack || arguments.length === 2)
|
|
12588
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
12589
|
+
if (ar || !(i in from)) {
|
|
12590
|
+
if (!ar)
|
|
12591
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
12592
|
+
ar[i] = from[i];
|
|
12593
|
+
}
|
|
12594
|
+
}
|
|
12595
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
12596
|
+
}
|
|
12501
12597
|
|
|
12502
12598
|
|
|
12503
12599
|
/***/ }),
|
|
@@ -12744,8 +12840,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12744
12840
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12745
12841
|
/* harmony export */ VisualizationManager: () => (/* binding */ VisualizationManager)
|
|
12746
12842
|
/* harmony export */ });
|
|
12747
|
-
/* harmony import */ var _visualizerBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./visualizerBase */ "./src/visualizerBase.ts");
|
|
12748
|
-
|
|
12749
12843
|
/**
|
|
12750
12844
|
* An object with methods used to register and unregister visualizers for individual question types.
|
|
12751
12845
|
*
|
|
@@ -12815,10 +12909,10 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
12815
12909
|
VisualizationManager.getVisualizersByType = function (questionType) {
|
|
12816
12910
|
var vDescrs = VisualizationManager.vizualizers[questionType];
|
|
12817
12911
|
if (!vDescrs) {
|
|
12818
|
-
if (
|
|
12912
|
+
if (VisualizationManager.defaultVisualizer.suppressVisualizerStubRendering) {
|
|
12819
12913
|
return [];
|
|
12820
12914
|
}
|
|
12821
|
-
return [
|
|
12915
|
+
return [VisualizationManager.defaultVisualizer];
|
|
12822
12916
|
}
|
|
12823
12917
|
vDescrs = [].concat(vDescrs);
|
|
12824
12918
|
vDescrs.sort(function (v1, v2) { return v1.index - v2.index; });
|
|
@@ -12829,7 +12923,7 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
12829
12923
|
* @see registerAltVisualizerSelector
|
|
12830
12924
|
*/
|
|
12831
12925
|
VisualizationManager.getAltVisualizerSelector = function () {
|
|
12832
|
-
return VisualizationManager.alternativesVisualizer ||
|
|
12926
|
+
return VisualizationManager.alternativesVisualizer || VisualizationManager.defaultVisualizer;
|
|
12833
12927
|
};
|
|
12834
12928
|
/**
|
|
12835
12929
|
* Registers an alternative visualizer selector.
|
|
@@ -12839,11 +12933,12 @@ var VisualizationManager = /** @class */ (function () {
|
|
|
12839
12933
|
VisualizationManager.alternativesVisualizer = constructor;
|
|
12840
12934
|
};
|
|
12841
12935
|
VisualizationManager.getPivotVisualizerConstructor = function () {
|
|
12842
|
-
return VisualizationManager.pivotVisualizer ||
|
|
12936
|
+
return VisualizationManager.pivotVisualizer || VisualizationManager.defaultVisualizer;
|
|
12843
12937
|
};
|
|
12844
12938
|
VisualizationManager.registerPivotVisualizer = function (constructor) {
|
|
12845
12939
|
VisualizationManager.pivotVisualizer = constructor;
|
|
12846
12940
|
};
|
|
12941
|
+
VisualizationManager.defaultVisualizer = undefined;
|
|
12847
12942
|
VisualizationManager.alternativesVisualizer = undefined;
|
|
12848
12943
|
VisualizationManager.pivotVisualizer = undefined;
|
|
12849
12944
|
VisualizationManager.vizualizers = {};
|
|
@@ -12866,18 +12961,26 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12866
12961
|
/* harmony export */ VisualizationMatrixDropdown: () => (/* binding */ VisualizationMatrixDropdown)
|
|
12867
12962
|
/* harmony export */ });
|
|
12868
12963
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
12869
|
-
/* harmony import */ var
|
|
12870
|
-
/* harmony import */ var
|
|
12871
|
-
/* harmony import */ var
|
|
12872
|
-
/* harmony import */ var
|
|
12873
|
-
/* harmony import */ var _visualizationPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationPanel */ "./src/visualizationPanel.ts");
|
|
12874
|
-
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
12875
|
-
|
|
12964
|
+
/* harmony import */ var _visualizerBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./visualizerBase */ "./src/visualizerBase.ts");
|
|
12965
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
12966
|
+
/* harmony import */ var _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizationPanel */ "./src/visualizationPanel.ts");
|
|
12967
|
+
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
12876
12968
|
|
|
12877
12969
|
|
|
12878
12970
|
|
|
12879
12971
|
|
|
12880
12972
|
|
|
12973
|
+
function isChoicesArraysEqual(choices1, choices2) {
|
|
12974
|
+
if (choices1.length !== choices2.length)
|
|
12975
|
+
return false;
|
|
12976
|
+
for (var i = 0; i < choices1.length; i++) {
|
|
12977
|
+
if (choices1[i].value !== choices2[i].value ||
|
|
12978
|
+
choices1[i].text !== choices2[i].text) {
|
|
12979
|
+
return false;
|
|
12980
|
+
}
|
|
12981
|
+
}
|
|
12982
|
+
return true;
|
|
12983
|
+
}
|
|
12881
12984
|
var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
12882
12985
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VisualizationMatrixDropdown, _super);
|
|
12883
12986
|
function VisualizationMatrixDropdown(question, data, options, name) {
|
|
@@ -12896,18 +12999,27 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
12896
12999
|
_this._childOptions.seriesValues = question.rows.map(function (row) { return row.value; });
|
|
12897
13000
|
_this._childOptions.seriesLabels = question.rows.map(function (row) { return row.text; });
|
|
12898
13001
|
var innerQuestions = _this.getQuestions();
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
var creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_3__.VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
|
|
13002
|
+
if (_this.canGroupColumns) {
|
|
13003
|
+
var creators = _visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
|
|
12902
13004
|
_this._matrixDropdownVisualizer = new creators[0](_this.question, [], _this._childOptions);
|
|
12903
13005
|
}
|
|
12904
13006
|
else {
|
|
12905
|
-
_this._matrixDropdownVisualizer = new
|
|
13007
|
+
_this._matrixDropdownVisualizer = new _visualizationPanel__WEBPACK_IMPORTED_MODULE_3__.VisualizationPanel(innerQuestions, [], _this._childOptions);
|
|
12906
13008
|
}
|
|
12907
13009
|
_this._matrixDropdownVisualizer.onAfterRender.add(_this.onPanelAfterRenderCallback);
|
|
12908
13010
|
_this.updateData(data);
|
|
12909
13011
|
return _this;
|
|
12910
13012
|
}
|
|
13013
|
+
Object.defineProperty(VisualizationMatrixDropdown.prototype, "canGroupColumns", {
|
|
13014
|
+
get: function () {
|
|
13015
|
+
var _this = this;
|
|
13016
|
+
var innerQuestions = this.getQuestions();
|
|
13017
|
+
var canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(function (innerQuestion) { return isChoicesArraysEqual(innerQuestion.choices, _this.question.choices); });
|
|
13018
|
+
return canGroupColumns;
|
|
13019
|
+
},
|
|
13020
|
+
enumerable: false,
|
|
13021
|
+
configurable: true
|
|
13022
|
+
});
|
|
12911
13023
|
VisualizationMatrixDropdown.prototype.setLocale = function (newLocale) {
|
|
12912
13024
|
_super.prototype.setLocale.call(this, newLocale);
|
|
12913
13025
|
this._childOptions.seriesLabels = this.question.rows.map(function (row) { return row.text; });
|
|
@@ -12928,7 +13040,7 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
12928
13040
|
if (!!rawDataItem) {
|
|
12929
13041
|
Object.keys(rawDataItem).forEach(function (key) {
|
|
12930
13042
|
var nestedDataItem = Object.assign({}, rawDataItem[key]);
|
|
12931
|
-
nestedDataItem[
|
|
13043
|
+
nestedDataItem[_dataProvider__WEBPACK_IMPORTED_MODULE_4__.DataProvider.seriesMarkerKey] = key;
|
|
12932
13044
|
panelData.push(nestedDataItem);
|
|
12933
13045
|
});
|
|
12934
13046
|
}
|
|
@@ -12965,9 +13077,9 @@ var VisualizationMatrixDropdown = /** @class */ (function (_super) {
|
|
|
12965
13077
|
this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback);
|
|
12966
13078
|
};
|
|
12967
13079
|
return VisualizationMatrixDropdown;
|
|
12968
|
-
}(
|
|
13080
|
+
}(_visualizerBase__WEBPACK_IMPORTED_MODULE_1__.VisualizerBase));
|
|
12969
13081
|
|
|
12970
|
-
|
|
13082
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.registerVisualizer("matrixdropdown", VisualizationMatrixDropdown);
|
|
12971
13083
|
|
|
12972
13084
|
|
|
12973
13085
|
/***/ }),
|
|
@@ -13917,17 +14029,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13917
14029
|
__webpack_require__.r(__webpack_exports__);
|
|
13918
14030
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13919
14031
|
/* harmony export */ PostponeHelper: () => (/* binding */ PostponeHelper),
|
|
13920
|
-
/* harmony export */ VisualizerBase: () => (/* binding */ VisualizerBase)
|
|
13921
|
-
/* harmony export */ defaultStatisticsCalculator: () => (/* binding */ defaultStatisticsCalculator)
|
|
14032
|
+
/* harmony export */ VisualizerBase: () => (/* binding */ VisualizerBase)
|
|
13922
14033
|
/* harmony export */ });
|
|
13923
14034
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
|
|
13924
14035
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
13925
14036
|
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
13926
14037
|
/* harmony import */ var _dataProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataProvider */ "./src/dataProvider.ts");
|
|
13927
14038
|
/* harmony import */ var _visualizerFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualizerFactory */ "./src/visualizerFactory.ts");
|
|
13928
|
-
/* harmony import */ var
|
|
13929
|
-
/* harmony import */ var
|
|
13930
|
-
/* harmony import */ var
|
|
14039
|
+
/* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
|
|
14040
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./src/utils/index.ts");
|
|
14041
|
+
/* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
|
|
14042
|
+
/* harmony import */ var _statisticCalculators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./statisticCalculators */ "./src/statisticCalculators.ts");
|
|
14043
|
+
/* harmony import */ var _visualizerBase_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visualizerBase.scss */ "./src/visualizerBase.scss");
|
|
14044
|
+
|
|
13931
14045
|
|
|
13932
14046
|
|
|
13933
14047
|
|
|
@@ -14351,7 +14465,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14351
14465
|
};
|
|
14352
14466
|
VisualizerBase.prototype.renderToolbar = function (container) {
|
|
14353
14467
|
if (this.showToolbar) {
|
|
14354
|
-
var toolbar_1 = (
|
|
14468
|
+
var toolbar_1 = (_utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-toolbar"));
|
|
14355
14469
|
this.createToolbarItems(toolbar_1);
|
|
14356
14470
|
container.appendChild(toolbar_1);
|
|
14357
14471
|
}
|
|
@@ -14378,8 +14492,8 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14378
14492
|
this.options.renderHeader(container, this);
|
|
14379
14493
|
}
|
|
14380
14494
|
else {
|
|
14381
|
-
var correctAnswerElement =
|
|
14382
|
-
correctAnswerElement.innerText =
|
|
14495
|
+
var correctAnswerElement = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__correct-answer");
|
|
14496
|
+
correctAnswerElement.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("correctAnswer") + this.getCorrectAnswerText();
|
|
14383
14497
|
container.appendChild(correctAnswerElement);
|
|
14384
14498
|
}
|
|
14385
14499
|
};
|
|
@@ -14390,7 +14504,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14390
14504
|
switch (_a.label) {
|
|
14391
14505
|
case 0:
|
|
14392
14506
|
if (!this._chartAdapter) return [3 /*break*/, 2];
|
|
14393
|
-
chartNode =
|
|
14507
|
+
chartNode = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div");
|
|
14394
14508
|
container.innerHTML = "";
|
|
14395
14509
|
container.appendChild(chartNode);
|
|
14396
14510
|
return [4 /*yield*/, this._chartAdapter.create(chartNode)];
|
|
@@ -14398,7 +14512,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14398
14512
|
_a.sent();
|
|
14399
14513
|
return [3 /*break*/, 3];
|
|
14400
14514
|
case 2:
|
|
14401
|
-
container.innerText =
|
|
14515
|
+
container.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("noVisualizerForQuestion");
|
|
14402
14516
|
_a.label = 3;
|
|
14403
14517
|
case 3: return [2 /*return*/, container];
|
|
14404
14518
|
}
|
|
@@ -14438,23 +14552,23 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14438
14552
|
var _this = this;
|
|
14439
14553
|
container.innerHTML = "";
|
|
14440
14554
|
if (this.hasFooter) {
|
|
14441
|
-
var footerTitleElement =
|
|
14555
|
+
var footerTitleElement = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("h4", "sa-visualizer__footer-title", { innerText: _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("otherCommentTitle") });
|
|
14442
14556
|
container.appendChild(footerTitleElement);
|
|
14443
|
-
var footerContentElement_1 =
|
|
14557
|
+
var footerContentElement_1 = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__footer-content");
|
|
14444
14558
|
footerContentElement_1.style.display = VisualizerBase.otherCommentCollapsed
|
|
14445
14559
|
? "none"
|
|
14446
14560
|
: "block";
|
|
14447
|
-
var visibilityButton_1 =
|
|
14561
|
+
var visibilityButton_1 = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createButton(function () {
|
|
14448
14562
|
if (footerContentElement_1.style.display === "none") {
|
|
14449
14563
|
footerContentElement_1.style.display = "block";
|
|
14450
|
-
visibilityButton_1.innerText =
|
|
14564
|
+
visibilityButton_1.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("hideButton");
|
|
14451
14565
|
}
|
|
14452
14566
|
else {
|
|
14453
14567
|
footerContentElement_1.style.display = "none";
|
|
14454
|
-
visibilityButton_1.innerText =
|
|
14568
|
+
visibilityButton_1.innerText = _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString(VisualizerBase.otherCommentCollapsed ? "showButton" : "hideButton");
|
|
14455
14569
|
}
|
|
14456
14570
|
_this.footerVisualizer.invokeOnUpdate();
|
|
14457
|
-
},
|
|
14571
|
+
}, _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("showButton") /*, "sa-toolbar__button--right"*/);
|
|
14458
14572
|
container.appendChild(visibilityButton_1);
|
|
14459
14573
|
container.appendChild(footerContentElement_1);
|
|
14460
14574
|
this.footerVisualizer.render(footerContentElement_1);
|
|
@@ -14469,18 +14583,18 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14469
14583
|
targetElement = document.getElementById(targetElement);
|
|
14470
14584
|
}
|
|
14471
14585
|
this.renderResult = targetElement;
|
|
14472
|
-
this.toolbarContainer =
|
|
14586
|
+
this.toolbarContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__toolbar");
|
|
14473
14587
|
targetElement.appendChild(this.toolbarContainer);
|
|
14474
14588
|
this.renderToolbar(this.toolbarContainer);
|
|
14475
14589
|
if (this.hasHeader) {
|
|
14476
|
-
this.headerContainer =
|
|
14590
|
+
this.headerContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__header");
|
|
14477
14591
|
targetElement.appendChild(this.headerContainer);
|
|
14478
14592
|
this.renderHeader(this.headerContainer);
|
|
14479
14593
|
}
|
|
14480
|
-
this.contentContainer =
|
|
14594
|
+
this.contentContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__content");
|
|
14481
14595
|
targetElement.appendChild(this.contentContainer);
|
|
14482
14596
|
this.renderContent(this.contentContainer);
|
|
14483
|
-
this.footerContainer =
|
|
14597
|
+
this.footerContainer = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("div", "sa-visualizer__footer");
|
|
14484
14598
|
targetElement.appendChild(this.footerContainer);
|
|
14485
14599
|
this.renderFooter(this.footerContainer);
|
|
14486
14600
|
};
|
|
@@ -14605,10 +14719,10 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14605
14719
|
if (!!this._getDataCore) {
|
|
14606
14720
|
return this._getDataCore(this);
|
|
14607
14721
|
}
|
|
14608
|
-
return defaultStatisticsCalculator(this.surveyData, this);
|
|
14722
|
+
return (0,_statisticCalculators__WEBPACK_IMPORTED_MODULE_7__.defaultStatisticsCalculator)(this.surveyData, this);
|
|
14609
14723
|
};
|
|
14610
14724
|
VisualizerBase.prototype.renderLoadingIndicator = function (contentContainer) {
|
|
14611
|
-
contentContainer.appendChild((0,
|
|
14725
|
+
contentContainer.appendChild((0,_utils__WEBPACK_IMPORTED_MODULE_5__.createLoadingIndicator)());
|
|
14612
14726
|
};
|
|
14613
14727
|
VisualizerBase.prototype.convertFromExternalData = function (externalCalculatedData) {
|
|
14614
14728
|
return externalCalculatedData;
|
|
@@ -14696,7 +14810,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14696
14810
|
if (!!survey) {
|
|
14697
14811
|
return survey.locale;
|
|
14698
14812
|
}
|
|
14699
|
-
return
|
|
14813
|
+
return _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale;
|
|
14700
14814
|
},
|
|
14701
14815
|
set: function (newLocale) {
|
|
14702
14816
|
this.setLocale(newLocale);
|
|
@@ -14707,7 +14821,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14707
14821
|
configurable: true
|
|
14708
14822
|
});
|
|
14709
14823
|
VisualizerBase.prototype.setLocale = function (newLocale) {
|
|
14710
|
-
|
|
14824
|
+
_localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.currentLocale = newLocale;
|
|
14711
14825
|
var survey = this.options.survey;
|
|
14712
14826
|
if (!!survey && survey.locale !== newLocale) {
|
|
14713
14827
|
survey.locale = newLocale;
|
|
@@ -14733,63 +14847,7 @@ var VisualizerBase = /** @class */ (function () {
|
|
|
14733
14847
|
return VisualizerBase;
|
|
14734
14848
|
}());
|
|
14735
14849
|
|
|
14736
|
-
|
|
14737
|
-
var dataNames = dataInfo.dataNames;
|
|
14738
|
-
var statistics = [];
|
|
14739
|
-
var values = dataInfo.getValues();
|
|
14740
|
-
var valuesIndex = {};
|
|
14741
|
-
values.forEach(function (val, index) {
|
|
14742
|
-
valuesIndex[val] = index;
|
|
14743
|
-
});
|
|
14744
|
-
var processMissingAnswers = values.indexOf(undefined) !== -1;
|
|
14745
|
-
var series = dataInfo.getSeriesValues();
|
|
14746
|
-
var seriesIndex = {};
|
|
14747
|
-
series.forEach(function (val, index) {
|
|
14748
|
-
seriesIndex[val] = index;
|
|
14749
|
-
});
|
|
14750
|
-
var seriesLength = series.length || 1;
|
|
14751
|
-
for (var i = 0; i < dataNames.length; ++i) {
|
|
14752
|
-
var dataNameStatistics = new Array();
|
|
14753
|
-
for (var j = 0; j < seriesLength; ++j) {
|
|
14754
|
-
dataNameStatistics.push(new Array(values.length).fill(0));
|
|
14755
|
-
}
|
|
14756
|
-
statistics.push(dataNameStatistics);
|
|
14757
|
-
}
|
|
14758
|
-
data.forEach(function (row) {
|
|
14759
|
-
dataNames.forEach(function (dataName, index) {
|
|
14760
|
-
var rowValue = row[dataName];
|
|
14761
|
-
if (rowValue !== undefined || processMissingAnswers) {
|
|
14762
|
-
var rowValues = Array.isArray(rowValue) ? rowValue : [rowValue];
|
|
14763
|
-
if (series.length > 0) {
|
|
14764
|
-
if (row[_dataProvider__WEBPACK_IMPORTED_MODULE_2__.DataProvider.seriesMarkerKey] !== undefined) {
|
|
14765
|
-
// Series are labelled by seriesMarkerKey in row data
|
|
14766
|
-
var seriesNo_1 = seriesIndex[row[_dataProvider__WEBPACK_IMPORTED_MODULE_2__.DataProvider.seriesMarkerKey]] || 0;
|
|
14767
|
-
rowValues.forEach(function (val) {
|
|
14768
|
-
statistics[index][seriesNo_1][valuesIndex[val]]++;
|
|
14769
|
-
});
|
|
14770
|
-
}
|
|
14771
|
-
else {
|
|
14772
|
-
// Series are the keys in question value (matrix question)
|
|
14773
|
-
// TODO: think about the de-normalization and combine with the previous case
|
|
14774
|
-
rowValues.forEach(function (val) {
|
|
14775
|
-
series.forEach(function (seriesName) {
|
|
14776
|
-
if (val[seriesName] !== undefined) {
|
|
14777
|
-
var seriesNo = seriesIndex[seriesName] || 0;
|
|
14778
|
-
statistics[index][seriesNo][valuesIndex[val[seriesName]]]++;
|
|
14779
|
-
}
|
|
14780
|
-
});
|
|
14781
|
-
});
|
|
14782
|
-
}
|
|
14783
|
-
}
|
|
14784
|
-
else {
|
|
14785
|
-
// No series
|
|
14786
|
-
rowValues.forEach(function (val) { return statistics[0][0][valuesIndex[val]]++; });
|
|
14787
|
-
}
|
|
14788
|
-
}
|
|
14789
|
-
});
|
|
14790
|
-
});
|
|
14791
|
-
return dataInfo.dataNames.length > 1 ? statistics : statistics[0];
|
|
14792
|
-
}
|
|
14850
|
+
_visualizationManager__WEBPACK_IMPORTED_MODULE_4__.VisualizationManager.defaultVisualizer = VisualizerBase;
|
|
14793
14851
|
|
|
14794
14852
|
|
|
14795
14853
|
/***/ }),
|
|
@@ -16806,9 +16864,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16806
16864
|
/* harmony export */ VisualizerFactory: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.VisualizerFactory),
|
|
16807
16865
|
/* harmony export */ WordCloud: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.WordCloud),
|
|
16808
16866
|
/* harmony export */ WordCloudAdapter: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.WordCloudAdapter),
|
|
16809
|
-
/* harmony export */ defaultStatisticsCalculator: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.defaultStatisticsCalculator),
|
|
16810
16867
|
/* harmony export */ hideEmptyAnswersInData: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.hideEmptyAnswersInData),
|
|
16811
16868
|
/* harmony export */ localization: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.localization),
|
|
16869
|
+
/* harmony export */ plotlyChartTypes: () => (/* reexport safe */ _plotly_index__WEBPACK_IMPORTED_MODULE_0__.plotlyChartTypes),
|
|
16812
16870
|
/* harmony export */ surveyStrings: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.surveyStrings),
|
|
16813
16871
|
/* harmony export */ textHelper: () => (/* reexport safe */ _summary_core__WEBPACK_IMPORTED_MODULE_1__.textHelper)
|
|
16814
16872
|
/* harmony export */ });
|