survey-analytics 1.11.13 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +0 -2
  2. package/package.json +3 -5
  3. package/survey-analytics-datatables.types/analytics-localization/english.d.ts +3 -0
  4. package/survey-analytics-datatables.types/localizationManager.d.ts +3 -0
  5. package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +3 -0
  6. package/survey-analytics-tabulator.types/localizationManager.d.ts +3 -0
  7. package/survey-analytics.types/analytics-localization/english.d.ts +3 -0
  8. package/survey-analytics.types/choices-table.d.ts +17 -17
  9. package/survey-analytics.types/config.d.ts +2 -3
  10. package/survey-analytics.types/entries/summary.d.ts +1 -1
  11. package/survey-analytics.types/localizationManager.d.ts +3 -0
  12. package/survey-analytics.types/statistics-table.d.ts +17 -0
  13. package/survey-analytics.types/visualizationPanel.d.ts +11 -11
  14. package/survey-analytics.types/wordcloud/wordcloud.d.ts +0 -1
  15. package/survey.analytics.css +9 -9
  16. package/survey.analytics.css.map +1 -1
  17. package/survey.analytics.datatables.css +1 -1
  18. package/survey.analytics.datatables.js +4 -1
  19. package/survey.analytics.datatables.js.map +1 -1
  20. package/survey.analytics.datatables.min.css +1 -1
  21. package/survey.analytics.datatables.min.js +1 -1
  22. package/survey.analytics.datatables.min.js.LICENSE.txt +1 -1
  23. package/survey.analytics.js +216 -233
  24. package/survey.analytics.js.map +1 -1
  25. package/survey.analytics.min.css +2 -2
  26. package/survey.analytics.min.js +1 -1
  27. package/survey.analytics.min.js.LICENSE.txt +1 -1
  28. package/survey.analytics.tabulator.css +1 -1
  29. package/survey.analytics.tabulator.js +4 -1
  30. package/survey.analytics.tabulator.js.map +1 -1
  31. package/survey.analytics.tabulator.min.css +1 -1
  32. package/survey.analytics.tabulator.min.js +1 -1
  33. package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v1.11.13
2
+ * surveyjs - SurveyJS Dashboard library v1.12.1
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -34,10 +34,10 @@ var code = "<svg style=\"display:none;\"><symbol viewBox=\"0 0 16 16\" id=\"sa-s
34
34
 
35
35
  /***/ }),
36
36
 
37
- /***/ "./src/choices-table.scss":
38
- /*!********************************!*\
39
- !*** ./src/choices-table.scss ***!
40
- \********************************/
37
+ /***/ "./src/nps.scss":
38
+ /*!**********************!*\
39
+ !*** ./src/nps.scss ***!
40
+ \**********************/
41
41
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
42
42
 
43
43
  "use strict";
@@ -47,10 +47,10 @@ __webpack_require__.r(__webpack_exports__);
47
47
 
48
48
  /***/ }),
49
49
 
50
- /***/ "./src/nps.scss":
51
- /*!**********************!*\
52
- !*** ./src/nps.scss ***!
53
- \**********************/
50
+ /***/ "./src/statistics-table.scss":
51
+ /*!***********************************!*\
52
+ !*** ./src/statistics-table.scss ***!
53
+ \***********************************/
54
54
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
55
55
 
56
56
  "use strict";
@@ -7349,6 +7349,7 @@ var englishStrings = {
7349
7349
  chartType_scatter: "Scatter",
7350
7350
  chartType_gauge: "Gauge",
7351
7351
  chartType_bullet: "Bullet",
7352
+ chartType_line: "Line",
7352
7353
  hideButton: "Hide",
7353
7354
  makePrivateButton: "Make private",
7354
7355
  makePublicButton: "Make public",
@@ -7385,6 +7386,8 @@ var englishStrings = {
7385
7386
  answer: "Answer",
7386
7387
  correctAnswer: "Correct answer: ",
7387
7388
  percent: "Percent",
7389
+ percentage: "Percentage",
7390
+ statistics_chart: "Chart",
7388
7391
  responses: "Responses",
7389
7392
  visualizer_nps: "NPS",
7390
7393
  npsScore: "NPS",
@@ -8390,151 +8393,6 @@ var BooleanModel = /** @class */ (function (_super) {
8390
8393
 
8391
8394
 
8392
8395
 
8393
- /***/ }),
8394
-
8395
- /***/ "./src/choices-table.ts":
8396
- /*!******************************!*\
8397
- !*** ./src/choices-table.ts ***!
8398
- \******************************/
8399
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8400
-
8401
- "use strict";
8402
- __webpack_require__.r(__webpack_exports__);
8403
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8404
- /* harmony export */ ChoicesTable: () => (/* binding */ ChoicesTable),
8405
- /* harmony export */ ChoicesTableAdapter: () => (/* binding */ ChoicesTableAdapter)
8406
- /* harmony export */ });
8407
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
8408
- /* harmony import */ var _selectBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectBase */ "./src/selectBase.ts");
8409
- /* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
8410
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./src/utils/index.ts");
8411
-
8412
-
8413
-
8414
-
8415
- var styles = __webpack_require__(/*! ./choices-table.scss */ "./src/choices-table.scss");
8416
- var ChoicesTableAdapter = /** @class */ (function () {
8417
- function ChoicesTableAdapter(model) {
8418
- this.model = model;
8419
- }
8420
- ChoicesTableAdapter.prototype.create = function (container) {
8421
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
8422
- var _a, datasets, labels, colors, texts, seriesLabels, hasSeries, emptyTextNode;
8423
- var _this = this;
8424
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_b) {
8425
- switch (_b.label) {
8426
- case 0: return [4 /*yield*/, this.model.getAnswersData()];
8427
- case 1:
8428
- _a = _b.sent(), datasets = _a.datasets, labels = _a.labels, colors = _a.colors, texts = _a.texts, seriesLabels = _a.seriesLabels;
8429
- hasSeries = seriesLabels.length > 1;
8430
- emptyTextNode = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("p", "", {
8431
- innerText: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("noResults"),
8432
- });
8433
- if (datasets.length === 0 || datasets[0].length === 0) {
8434
- container.appendChild(emptyTextNode);
8435
- return [2 /*return*/];
8436
- }
8437
- datasets.forEach(function (data, idx) {
8438
- var tableNode = (_utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("table", "sa-choices-table"));
8439
- tableNode.style.backgroundColor = _this.model.backgroundColor;
8440
- container.appendChild(tableNode);
8441
- var headerRow = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("tr");
8442
- var labelCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("th", "sa-choices-table__cell-header", {
8443
- textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("answer"),
8444
- });
8445
- headerRow.appendChild(labelCell);
8446
- var sparklineCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("th", "sa-choices-table__cell-header", {
8447
- textContent: "",
8448
- });
8449
- headerRow.appendChild(sparklineCell);
8450
- var percentCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("th", "sa-choices-table__cell-header", {
8451
- textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("percent"),
8452
- });
8453
- headerRow.appendChild(percentCell);
8454
- var valueCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("th", "sa-choices-table__cell-header", {
8455
- textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("responses"),
8456
- });
8457
- headerRow.appendChild(valueCell);
8458
- tableNode.appendChild(headerRow);
8459
- data.forEach(function (rowData, index) {
8460
- var row = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("tr");
8461
- var labelCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("td", "sa-choices-table__cell", {
8462
- textContent: labels[index],
8463
- });
8464
- row.appendChild(labelCell);
8465
- var sparklineCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("td", "sa-choices-table__cell");
8466
- var outerBar = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("div", "sa-choices-sparkline");
8467
- var innerBar = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("div", "sa-choices-sparkline-value");
8468
- innerBar.style.width = texts[idx][index] + "%";
8469
- outerBar.appendChild(innerBar);
8470
- sparklineCell.appendChild(outerBar);
8471
- row.appendChild(sparklineCell);
8472
- var percentCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("td", "sa-choices-table__cell sa-choices-table__cell-value", {
8473
- textContent: "" + texts[idx][index] + "%",
8474
- });
8475
- row.appendChild(percentCell);
8476
- var valueCell = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("td", "sa-choices-table__cell sa-choices-table__cell-value", {
8477
- textContent: rowData,
8478
- });
8479
- row.appendChild(valueCell);
8480
- tableNode.appendChild(row);
8481
- });
8482
- container.className = "sa-choices-table__container";
8483
- container.appendChild(tableNode);
8484
- });
8485
- return [2 /*return*/];
8486
- }
8487
- });
8488
- });
8489
- };
8490
- ChoicesTableAdapter.prototype.destroy = function (node) {
8491
- node.innerHTML = "";
8492
- };
8493
- return ChoicesTableAdapter;
8494
- }());
8495
-
8496
- var ChoicesTable = /** @class */ (function (_super) {
8497
- (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ChoicesTable, _super);
8498
- function ChoicesTable(question, data, options, name) {
8499
- var _this = _super.call(this, question, data, options, name || "choices") || this;
8500
- _this._choicesTableAdapter = new ChoicesTableAdapter(_this);
8501
- _this.answersOrder = "asc";
8502
- _this.showPercentages = true;
8503
- return _this;
8504
- }
8505
- ChoicesTable.prototype.destroyContent = function (container) {
8506
- this._choicesTableAdapter.destroy(container);
8507
- _super.prototype.destroyContent.call(this, container);
8508
- };
8509
- ChoicesTable.prototype.renderContentAsync = function (container) {
8510
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
8511
- var tableNode;
8512
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
8513
- switch (_a.label) {
8514
- case 0:
8515
- tableNode = _utils__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("div");
8516
- return [4 /*yield*/, this._choicesTableAdapter.create(tableNode)];
8517
- case 1:
8518
- _a.sent();
8519
- container.innerHTML = "";
8520
- container.appendChild(tableNode);
8521
- return [2 /*return*/, container];
8522
- }
8523
- });
8524
- });
8525
- };
8526
- ChoicesTable.prototype.destroy = function () {
8527
- this._choicesTableAdapter.destroy(this.contentContainer);
8528
- _super.prototype.destroy.call(this);
8529
- };
8530
- return ChoicesTable;
8531
- }(_selectBase__WEBPACK_IMPORTED_MODULE_1__.SelectBase));
8532
-
8533
- // VisualizationManager.registerVisualizer("radiogroup", ChoicesTable);
8534
- // VisualizationManager.registerVisualizer("dropdown", ChoicesTable);
8535
- // VisualizationManager.registerVisualizer("checkbox", ChoicesTable);
8536
-
8537
-
8538
8396
  /***/ }),
8539
8397
 
8540
8398
  /***/ "./src/dataProvider.ts":
@@ -9816,11 +9674,11 @@ var HistogramPlotly = /** @class */ (function (_super) {
9816
9674
  switch (_a.label) {
9817
9675
  case 0:
9818
9676
  chartNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div");
9677
+ container.innerHTML = "";
9678
+ container.appendChild(chartNode);
9819
9679
  return [4 /*yield*/, this._chartAdapter.create(chartNode)];
9820
9680
  case 1:
9821
9681
  _a.sent();
9822
- container.innerHTML = "";
9823
- container.appendChild(chartNode);
9824
9682
  return [2 /*return*/, container];
9825
9683
  }
9826
9684
  });
@@ -9843,7 +9701,7 @@ var HistogramPlotly = /** @class */ (function (_super) {
9843
9701
  HistogramPlotly.prototype.getValueType = function () {
9844
9702
  return this.valueType;
9845
9703
  };
9846
- HistogramPlotly.types = ["vbar", "bar", "scatter"];
9704
+ HistogramPlotly.types = ["vbar", "bar"];
9847
9705
  return HistogramPlotly;
9848
9706
  }(_histogram__WEBPACK_IMPORTED_MODULE_2__.HistogramModel));
9849
9707
 
@@ -9936,11 +9794,11 @@ var MatrixPlotly = /** @class */ (function (_super) {
9936
9794
  switch (_a.label) {
9937
9795
  case 0:
9938
9796
  chartNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div");
9797
+ container.innerHTML = "";
9798
+ container.appendChild(chartNode);
9939
9799
  return [4 /*yield*/, this._chartAdapter.create(chartNode)];
9940
9800
  case 1:
9941
9801
  _a.sent();
9942
- container.innerHTML = "";
9943
- container.appendChild(chartNode);
9944
9802
  return [2 /*return*/, container];
9945
9803
  }
9946
9804
  });
@@ -9996,11 +9854,11 @@ var MatrixDropdownGroupedPlotly = /** @class */ (function (_super) {
9996
9854
  switch (_a.label) {
9997
9855
  case 0:
9998
9856
  chartNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div");
9857
+ container.innerHTML = "";
9858
+ container.appendChild(chartNode);
9999
9859
  return [4 /*yield*/, this._chartAdapter.create(chartNode)];
10000
9860
  case 1:
10001
9861
  _a.sent();
10002
- container.innerHTML = "";
10003
- container.appendChild(chartNode);
10004
9862
  return [2 /*return*/, container];
10005
9863
  }
10006
9864
  });
@@ -10116,7 +9974,7 @@ var PlotlyGaugeAdapter = /** @class */ (function () {
10116
9974
  });
10117
9975
  PlotlyGaugeAdapter.prototype.create = function (chartNode) {
10118
9976
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
10119
- var question, _a, level, minValue, maxValue, rateValues, colors, data, chartMargin, layout, config, options;
9977
+ var question, _a, level, minValue, maxValue, rateValues, colors, data, chartMargin, layout, config, options, plot;
10120
9978
  var _this = this;
10121
9979
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_b) {
10122
9980
  switch (_b.label) {
@@ -10197,7 +10055,9 @@ var PlotlyGaugeAdapter = /** @class */ (function () {
10197
10055
  config: config,
10198
10056
  };
10199
10057
  _setup__WEBPACK_IMPORTED_MODULE_5__.PlotlySetup.onPlotCreating.fire(this.model, options);
10200
- return [2 /*return*/, plotly_js_dist_min__WEBPACK_IMPORTED_MODULE_6___default().newPlot(chartNode, options.data, options.layout, options.config)];
10058
+ plot = plotly_js_dist_min__WEBPACK_IMPORTED_MODULE_6___default().newPlot(chartNode, options.data, options.layout, options.config);
10059
+ // setTimeout(() => Plotly.Plots.resize(chartNode), 10);
10060
+ return [2 /*return*/, plot];
10201
10061
  }
10202
10062
  });
10203
10063
  });
@@ -10229,11 +10089,11 @@ var GaugePlotly = /** @class */ (function (_super) {
10229
10089
  switch (_a.label) {
10230
10090
  case 0:
10231
10091
  chartNode = _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createElement("div");
10092
+ container.innerHTML = "";
10093
+ container.appendChild(chartNode);
10232
10094
  return [4 /*yield*/, this._chartAdapter.create(chartNode)];
10233
10095
  case 1:
10234
10096
  _a.sent();
10235
- container.innerHTML = "";
10236
- container.appendChild(chartNode);
10237
10097
  return [2 /*return*/, container];
10238
10098
  }
10239
10099
  });
@@ -10379,6 +10239,7 @@ var PlotlyChartAdapter = /** @class */ (function () {
10379
10239
  var dragLayer = getDragLayer();
10380
10240
  dragLayer && (dragLayer.style.cursor = "");
10381
10241
  });
10242
+ // setTimeout(() => Plotly.Plots.resize(chartNode), 10);
10382
10243
  this._chart = plot;
10383
10244
  return [2 /*return*/, plot];
10384
10245
  }
@@ -10402,7 +10263,7 @@ var SelectBasePlotly = /** @class */ (function (_super) {
10402
10263
  _this.chartTypes.push("stackedbar");
10403
10264
  }
10404
10265
  if (options.allowExperimentalFeatures) {
10405
- _this.chartTypes.splice(1, 0, "vbar");
10266
+ // this.chartTypes.splice(1, 0, "vbar");
10406
10267
  }
10407
10268
  _this._chartType = _this.chartTypes[0];
10408
10269
  if (_this.chartTypes.indexOf(options.defaultChartType) !== -1) {
@@ -10422,11 +10283,11 @@ var SelectBasePlotly = /** @class */ (function (_super) {
10422
10283
  switch (_a.label) {
10423
10284
  case 0:
10424
10285
  chartNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div");
10286
+ container.innerHTML = "";
10287
+ container.appendChild(chartNode);
10425
10288
  return [4 /*yield*/, this._chartAdapter.create(chartNode)];
10426
10289
  case 1:
10427
10290
  _a.sent();
10428
- container.innerHTML = "";
10429
- container.appendChild(chartNode);
10430
10291
  return [2 /*return*/, container];
10431
10292
  }
10432
10293
  });
@@ -10446,7 +10307,7 @@ var SelectBasePlotly = /** @class */ (function (_super) {
10446
10307
  }
10447
10308
  return statistics;
10448
10309
  };
10449
- SelectBasePlotly.types = ["bar", "pie", "doughnut", "scatter"];
10310
+ SelectBasePlotly.types = ["bar", "vbar", "pie", "doughnut"];
10450
10311
  SelectBasePlotly.displayModeBar = undefined;
10451
10312
  return SelectBasePlotly;
10452
10313
  }(_selectBase__WEBPACK_IMPORTED_MODULE_2__.SelectBase));
@@ -10664,6 +10525,20 @@ var PlotlySetup = /** @class */ (function () {
10664
10525
  var topMargin = 30;
10665
10526
  var bottomMargin = 30;
10666
10527
  var datasets = answersData.datasets, labels = answersData.labels, colors = answersData.colors, texts = answersData.texts, seriesLabels = answersData.seriesLabels;
10528
+ if (model.type !== "histogram") {
10529
+ labels = [].concat(labels).reverse();
10530
+ colors = [].concat(colors.slice(0, labels.length)).reverse();
10531
+ var ts_1 = [];
10532
+ texts.forEach(function (text) {
10533
+ ts_1.push([].concat(text).reverse());
10534
+ });
10535
+ texts = ts_1;
10536
+ var ds_1 = [];
10537
+ datasets.forEach(function (dataset) {
10538
+ ds_1.push([].concat(dataset).reverse());
10539
+ });
10540
+ datasets = ds_1;
10541
+ }
10667
10542
  var traces = [];
10668
10543
  var hasSeries = seriesLabels.length > 1 || model.question.getType() === "matrix";
10669
10544
  var layout = {
@@ -10685,10 +10560,10 @@ var PlotlySetup = /** @class */ (function () {
10685
10560
  showlegend: false,
10686
10561
  };
10687
10562
  var traceConfig = {
10688
- type: "bar",
10563
+ type: model.chartType === "line" ? "line" : "bar",
10689
10564
  customdata: hasSeries ? seriesLabels : labels,
10690
10565
  hoverinfo: "x+y",
10691
- mode: "markers",
10566
+ mode: model.chartType === "line" ? "lines+markers" : "markers",
10692
10567
  textposition: "none",
10693
10568
  width: 0.5,
10694
10569
  bargap: 0.5,
@@ -10721,6 +10596,7 @@ var PlotlySetup = /** @class */ (function () {
10721
10596
  }
10722
10597
  if (!model.getValueType || model.getValueType() != "date") {
10723
10598
  layout.xaxis = {
10599
+ automargin: true,
10724
10600
  type: "category",
10725
10601
  };
10726
10602
  }
@@ -10812,6 +10688,7 @@ var PlotlySetup = /** @class */ (function () {
10812
10688
  PlotlySetup.setups = {
10813
10689
  bar: PlotlySetup.setupBar,
10814
10690
  vbar: PlotlySetup.setupVBar,
10691
+ line: PlotlySetup.setupVBar,
10815
10692
  stackedbar: PlotlySetup.setupBar,
10816
10693
  doughnut: PlotlySetup.setupPie,
10817
10694
  pie: PlotlySetup.setupPie,
@@ -11057,7 +10934,7 @@ var SelectBase = /** @class */ (function (_super) {
11057
10934
  this.emptyAnswersBtn.innerText = this._hideEmptyAnswers
11058
10935
  ? _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("showEmptyAnswers")
11059
10936
  : _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("hideEmptyAnswers");
11060
- if (this.chartType == "bar" || this.chartType == "vbar" || this.chartType == "scatter") {
10937
+ if (this.chartType == "bar" || this.chartType == "vbar" || this.chartType == "line" || this.chartType == "scatter") {
11061
10938
  this.emptyAnswersBtn.style.display = "inline";
11062
10939
  }
11063
10940
  else {
@@ -11082,6 +10959,7 @@ var SelectBase = /** @class */ (function (_super) {
11082
10959
  if (!!this.choicesOrderSelector) {
11083
10960
  if (this.chartType == "bar" ||
11084
10961
  this.chartType == "vbar" ||
10962
+ this.chartType == "line" ||
11085
10963
  this.chartType == "scatter" ||
11086
10964
  ((this.chartType == "pie" || this.chartType == "doughnut") &&
11087
10965
  this.topN > 0)) {
@@ -11500,6 +11378,152 @@ var SelectBase = /** @class */ (function (_super) {
11500
11378
 
11501
11379
 
11502
11380
 
11381
+ /***/ }),
11382
+
11383
+ /***/ "./src/statistics-table.ts":
11384
+ /*!*********************************!*\
11385
+ !*** ./src/statistics-table.ts ***!
11386
+ \*********************************/
11387
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11388
+
11389
+ "use strict";
11390
+ __webpack_require__.r(__webpack_exports__);
11391
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11392
+ /* harmony export */ StatisticsTable: () => (/* binding */ StatisticsTable),
11393
+ /* harmony export */ StatisticsTableAdapter: () => (/* binding */ StatisticsTableAdapter)
11394
+ /* harmony export */ });
11395
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/utils/helpers.ts");
11396
+ /* harmony import */ var _selectBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectBase */ "./src/selectBase.ts");
11397
+ /* harmony import */ var _visualizationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./visualizationManager */ "./src/visualizationManager.ts");
11398
+ /* harmony import */ var _localizationManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./localizationManager */ "./src/localizationManager.ts");
11399
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./src/utils/index.ts");
11400
+
11401
+
11402
+
11403
+
11404
+
11405
+ var styles = __webpack_require__(/*! ./statistics-table.scss */ "./src/statistics-table.scss");
11406
+ var StatisticsTableAdapter = /** @class */ (function () {
11407
+ function StatisticsTableAdapter(model) {
11408
+ this.model = model;
11409
+ }
11410
+ StatisticsTableAdapter.prototype.create = function (container) {
11411
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
11412
+ var _a, datasets, labels, colors, texts, seriesLabels, hasSeries, emptyTextNode;
11413
+ var _this = this;
11414
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_b) {
11415
+ switch (_b.label) {
11416
+ case 0: return [4 /*yield*/, this.model.getAnswersData()];
11417
+ case 1:
11418
+ _a = _b.sent(), datasets = _a.datasets, labels = _a.labels, colors = _a.colors, texts = _a.texts, seriesLabels = _a.seriesLabels;
11419
+ hasSeries = seriesLabels.length > 1;
11420
+ emptyTextNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("p", "", {
11421
+ innerText: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("noResults"),
11422
+ });
11423
+ if (datasets.length === 0 || datasets[0].length === 0) {
11424
+ container.appendChild(emptyTextNode);
11425
+ return [2 /*return*/];
11426
+ }
11427
+ datasets.forEach(function (data, idx) {
11428
+ var tableNode = (_utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("table", "sa-statistics-table"));
11429
+ tableNode.style.backgroundColor = _this.model.backgroundColor;
11430
+ container.appendChild(tableNode);
11431
+ var headerRow = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("tr");
11432
+ var labelCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("th", "sa-statistics-table__cell-header", {
11433
+ textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("answer"),
11434
+ });
11435
+ headerRow.appendChild(labelCell);
11436
+ var sparklineCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("th", "sa-statistics-table__cell-header", {
11437
+ textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("statistics_chart"),
11438
+ });
11439
+ headerRow.appendChild(sparklineCell);
11440
+ var percentCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("th", "sa-statistics-table__cell-header", {
11441
+ textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("percentage"),
11442
+ });
11443
+ headerRow.appendChild(percentCell);
11444
+ var valueCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("th", "sa-statistics-table__cell-header", {
11445
+ textContent: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("responses"),
11446
+ });
11447
+ headerRow.appendChild(valueCell);
11448
+ tableNode.appendChild(headerRow);
11449
+ for (var index = data.length - 1; index >= 0; index--) {
11450
+ var row = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("tr");
11451
+ var labelCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("td", "sa-statistics-table__cell", {
11452
+ textContent: labels[index],
11453
+ });
11454
+ row.appendChild(labelCell);
11455
+ var sparklineCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("td", "sa-statistics-table__cell");
11456
+ var outerBar = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div", "sa-choices-sparkline");
11457
+ var innerBar = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div", "sa-choices-sparkline-value");
11458
+ innerBar.style.width = texts[idx][index] + "%";
11459
+ outerBar.appendChild(innerBar);
11460
+ sparklineCell.appendChild(outerBar);
11461
+ row.appendChild(sparklineCell);
11462
+ var percentCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("td", "sa-statistics-table__cell sa-statistics-table__cell-value", {
11463
+ textContent: "" + texts[idx][index] + "%",
11464
+ });
11465
+ row.appendChild(percentCell);
11466
+ var valueCell = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("td", "sa-statistics-table__cell sa-statistics-table__cell-value", {
11467
+ textContent: data[index],
11468
+ });
11469
+ row.appendChild(valueCell);
11470
+ tableNode.appendChild(row);
11471
+ }
11472
+ container.className = "sa-statistics-table__container";
11473
+ container.appendChild(tableNode);
11474
+ });
11475
+ return [2 /*return*/];
11476
+ }
11477
+ });
11478
+ });
11479
+ };
11480
+ StatisticsTableAdapter.prototype.destroy = function (node) {
11481
+ node.innerHTML = "";
11482
+ };
11483
+ return StatisticsTableAdapter;
11484
+ }());
11485
+
11486
+ var StatisticsTable = /** @class */ (function (_super) {
11487
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(StatisticsTable, _super);
11488
+ function StatisticsTable(question, data, options, name) {
11489
+ var _this = _super.call(this, question, data, options, name || "choices") || this;
11490
+ _this._statisticsTableAdapter = new StatisticsTableAdapter(_this);
11491
+ _this.showPercentages = true;
11492
+ return _this;
11493
+ }
11494
+ StatisticsTable.prototype.destroyContent = function (container) {
11495
+ this._statisticsTableAdapter.destroy(container);
11496
+ _super.prototype.destroyContent.call(this, container);
11497
+ };
11498
+ StatisticsTable.prototype.renderContentAsync = function (container) {
11499
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
11500
+ var tableNode;
11501
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
11502
+ switch (_a.label) {
11503
+ case 0:
11504
+ tableNode = _utils__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createElement("div");
11505
+ return [4 /*yield*/, this._statisticsTableAdapter.create(tableNode)];
11506
+ case 1:
11507
+ _a.sent();
11508
+ container.innerHTML = "";
11509
+ container.appendChild(tableNode);
11510
+ return [2 /*return*/, container];
11511
+ }
11512
+ });
11513
+ });
11514
+ };
11515
+ StatisticsTable.prototype.destroy = function () {
11516
+ this._statisticsTableAdapter.destroy(this.contentContainer);
11517
+ _super.prototype.destroy.call(this);
11518
+ };
11519
+ return StatisticsTable;
11520
+ }(_selectBase__WEBPACK_IMPORTED_MODULE_1__.SelectBase));
11521
+
11522
+ _visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.registerVisualizer("radiogroup", StatisticsTable);
11523
+ _visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.registerVisualizer("dropdown", StatisticsTable);
11524
+ _visualizationManager__WEBPACK_IMPORTED_MODULE_2__.VisualizationManager.registerVisualizer("checkbox", StatisticsTable);
11525
+
11526
+
11503
11527
  /***/ }),
11504
11528
 
11505
11529
  /***/ "./src/text.ts":
@@ -15593,24 +15617,32 @@ var WordCloudWidget = /** @class */ (function () {
15593
15617
  var _this = this;
15594
15618
  this._renderedTarget = target;
15595
15619
  var cloudElement = document.createElement("div");
15620
+ document.body.appendChild(cloudElement);
15621
+ cloudElement.style.position = "fixed";
15622
+ cloudElement.style.top = "-1000px";
15623
+ cloudElement.style.width = "0";
15624
+ cloudElement.style.height = "0";
15625
+ var startPoint = {
15626
+ x: cloudElement.offsetWidth / 2,
15627
+ y: cloudElement.offsetHeight / 2
15628
+ };
15629
+ var _a = this.arrangeWords(cloudElement, startPoint), yMin = _a[0], yMax = _a[1];
15630
+ this._placedWords.forEach(function (wordInfo) {
15631
+ wordInfo.element.style.top = wordInfo.top - yMin + _this._options.padding + "px";
15632
+ });
15633
+ cloudElement.remove();
15634
+ cloudElement.style.top = "auto";
15635
+ cloudElement.style.left = "50%";
15596
15636
  cloudElement.className = "sa-visualizer-wordcloud";
15597
15637
  cloudElement.style.position = "relative";
15598
- target.appendChild(cloudElement);
15599
15638
  if (this._options.maxHeight > 0) {
15600
15639
  cloudElement.style.height = this._options.maxHeight + "px";
15601
15640
  cloudElement.style.overflow = "auto";
15602
15641
  }
15603
- var startPoint = {
15604
- x: cloudElement.offsetWidth / 2,
15605
- y: cloudElement.offsetHeight / 2
15606
- };
15607
- var _a = this.arrangeWords(cloudElement, startPoint), yMin = _a[0], yMax = _a[1];
15608
15642
  if (this._options.maxHeight == 0) {
15609
15643
  cloudElement.style.height = yMax - yMin + this._options.padding * 2 + "px";
15610
15644
  }
15611
- this._placedWords.forEach(function (wordInfo) {
15612
- wordInfo.element.style.top = wordInfo.top - yMin + _this._options.padding + "px";
15613
- });
15645
+ target.appendChild(cloudElement);
15614
15646
  };
15615
15647
  WordCloudWidget.prototype.dispose = function () {
15616
15648
  if (!!this._renderedTarget) {
@@ -15653,7 +15685,6 @@ __webpack_require__.r(__webpack_exports__);
15653
15685
 
15654
15686
 
15655
15687
 
15656
- // import WordCloudLib from "wordcloud";
15657
15688
 
15658
15689
  var WordCloudAdapter = /** @class */ (function () {
15659
15690
  function WordCloudAdapter(model) {
@@ -15666,54 +15697,6 @@ var WordCloudAdapter = /** @class */ (function () {
15666
15697
  enumerable: false,
15667
15698
  configurable: true
15668
15699
  });
15669
- WordCloudAdapter.prototype.createWordCloud2 = function (node) {
15670
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
15671
- var data, colors, canvasNode, emptyTextNode, config, options;
15672
- var _this = this;
15673
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
15674
- switch (_a.label) {
15675
- case 0: return [4 /*yield*/, this.model.getCalculatedValues()];
15676
- case 1:
15677
- data = _a.sent();
15678
- colors = this.model.getColors();
15679
- canvasNode = (_utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("canvas", ""));
15680
- emptyTextNode = _utils__WEBPACK_IMPORTED_MODULE_5__.DocumentHelper.createElement("p", "", {
15681
- innerText: _localizationManager__WEBPACK_IMPORTED_MODULE_6__.localization.getString("noResults"),
15682
- });
15683
- if (data.length === 0) {
15684
- node.appendChild(emptyTextNode);
15685
- return [2 /*return*/];
15686
- }
15687
- node.appendChild(canvasNode);
15688
- config = {
15689
- list: data,
15690
- weightFactor: WordCloudAdapter.weightFactor,
15691
- abortThreshold: WordCloudAdapter.abortThreshold,
15692
- drawOutOfBound: WordCloudAdapter.drawOutOfBound,
15693
- shrinkToFit: WordCloudAdapter.shrinkToFit,
15694
- fontFamily: "Segoe UI Bold, sans-serif",
15695
- color: function (word, weight) {
15696
- return _this.model.getRandomColor();
15697
- },
15698
- rotateRatio: 0.5,
15699
- rotationSteps: 2,
15700
- backgroundColor: this.model.backgroundColor,
15701
- click: function (item) {
15702
- // eslint-disable-next-line no-console
15703
- console.log(item[0] + ": " + item[1]);
15704
- },
15705
- };
15706
- options = {
15707
- canvas: canvasNode,
15708
- config: config
15709
- };
15710
- WordCloudAdapter.onWordcloudCreating.fire(this.model, options);
15711
- // this._wordcloud = WordCloudLib(options.canvas, options.config as any);
15712
- return [2 /*return*/, this._wordcloud];
15713
- }
15714
- });
15715
- });
15716
- };
15717
15700
  WordCloudAdapter.prototype.create = function (element) {
15718
15701
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
15719
15702
  var data, colors, emptyTextNode, config, options;
@@ -15968,8 +15951,6 @@ __webpack_require__.r(__webpack_exports__);
15968
15951
  /* harmony export */ AlternativeVisualizersWrapper: () => (/* reexport safe */ _alternativeVizualizersWrapper__WEBPACK_IMPORTED_MODULE_25__.AlternativeVisualizersWrapper),
15969
15952
  /* harmony export */ BooleanModel: () => (/* reexport safe */ _boolean__WEBPACK_IMPORTED_MODULE_17__.BooleanModel),
15970
15953
  /* harmony export */ BooleanPlotly: () => (/* reexport safe */ _plotly_index__WEBPACK_IMPORTED_MODULE_26__.BooleanPlotly),
15971
- /* harmony export */ ChoicesTable: () => (/* reexport safe */ _choices_table__WEBPACK_IMPORTED_MODULE_30__.ChoicesTable),
15972
- /* harmony export */ ChoicesTableAdapter: () => (/* reexport safe */ _choices_table__WEBPACK_IMPORTED_MODULE_30__.ChoicesTableAdapter),
15973
15954
  /* harmony export */ DataProvider: () => (/* reexport safe */ _dataProvider__WEBPACK_IMPORTED_MODULE_12__.DataProvider),
15974
15955
  /* harmony export */ DocumentHelper: () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_32__.DocumentHelper),
15975
15956
  /* harmony export */ GaugePlotly: () => (/* reexport safe */ _plotly_index__WEBPACK_IMPORTED_MODULE_26__.GaugePlotly),
@@ -15989,6 +15970,8 @@ __webpack_require__.r(__webpack_exports__);
15989
15970
  /* harmony export */ RankingPlotly: () => (/* reexport safe */ _plotly_index__WEBPACK_IMPORTED_MODULE_26__.RankingPlotly),
15990
15971
  /* harmony export */ SelectBase: () => (/* reexport safe */ _selectBase__WEBPACK_IMPORTED_MODULE_15__.SelectBase),
15991
15972
  /* harmony export */ SelectBasePlotly: () => (/* reexport safe */ _plotly_index__WEBPACK_IMPORTED_MODULE_26__.SelectBasePlotly),
15973
+ /* harmony export */ StatisticsTable: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_30__.StatisticsTable),
15974
+ /* harmony export */ StatisticsTableAdapter: () => (/* reexport safe */ _statistics_table__WEBPACK_IMPORTED_MODULE_30__.StatisticsTableAdapter),
15992
15975
  /* harmony export */ Text: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_29__.Text),
15993
15976
  /* harmony export */ TextTableAdapter: () => (/* reexport safe */ _text__WEBPACK_IMPORTED_MODULE_29__.TextTableAdapter),
15994
15977
  /* harmony export */ VisualizationManager: () => (/* reexport safe */ _visualizationManager__WEBPACK_IMPORTED_MODULE_20__.VisualizationManager),
@@ -16036,7 +16019,7 @@ __webpack_require__.r(__webpack_exports__);
16036
16019
  /* harmony import */ var _wordcloud_wordcloud__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../wordcloud/wordcloud */ "./src/wordcloud/wordcloud.ts");
16037
16020
  /* harmony import */ var _wordcloud_stopwords_index__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../wordcloud/stopwords/index */ "./src/wordcloud/stopwords/index.ts");
16038
16021
  /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../text */ "./src/text.ts");
16039
- /* harmony import */ var _choices_table__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../choices-table */ "./src/choices-table.ts");
16022
+ /* harmony import */ var _statistics_table__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../statistics-table */ "./src/statistics-table.ts");
16040
16023
  /* harmony import */ var _nps__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../nps */ "./src/nps.ts");
16041
16024
  /* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../utils/index */ "./src/utils/index.ts");
16042
16025