survey-analytics 2.2.5 → 2.3.0
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 +24 -6
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +1 -1
- package/fesm/survey.analytics.mjs +80 -19
- package/fesm/survey.analytics.mjs.map +1 -1
- package/fesm/survey.analytics.tabulator.mjs +1 -1
- package/package.json +2 -2
- 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.types/analytics-localization/english.d.ts +1 -0
- package/survey-analytics.types/config.d.ts +1 -0
- package/survey-analytics.types/localizationManager.d.ts +1 -0
- package/survey-analytics.types/plotly/chart-adapter.d.ts +1 -0
- package/survey-analytics.types/plotly/setup.d.ts +1 -0
- package/survey-analytics.types/ranking.d.ts +4 -0
- package/survey-analytics.types/visualizationMatrixDropdown.d.ts +1 -0
- package/survey-analytics.types/visualizationPanel.d.ts +4 -2
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +39 -19
- 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 +133 -50
- 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 +2 -1
- 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/fesm/shared2.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.3.0
|
|
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
|
*/
|
|
6
6
|
|
|
7
7
|
import { D as DocumentHelper, l as localization, f as createLoadingIndicator, a as DataHelper, e as svgTemplate, d as createCommercialLicenseLink, t as toPrecision } from './shared.mjs';
|
|
8
|
-
import { Event, QuestionCommentModel, settings, ItemValue, hasLicense, surveyLocalization, IsTouch
|
|
8
|
+
import { Event, QuestionCommentModel, settings, ItemValue, hasLicense, surveyLocalization, IsTouch } from 'survey-core';
|
|
9
9
|
|
|
10
10
|
/******************************************************************************
|
|
11
11
|
Copyright (c) Microsoft Corporation.
|
|
@@ -189,7 +189,7 @@ class VisualizationManager {
|
|
|
189
189
|
if (constructor) {
|
|
190
190
|
let visualizers = VisualizationManager.vizualizers[qType];
|
|
191
191
|
if (!!visualizers) {
|
|
192
|
-
const vDescr = visualizers.filter(v => v.ctor === constructor)[0];
|
|
192
|
+
const vDescr = visualizers.filter(v => v.ctor === constructor || v.ctor.isPrototypeOf(constructor))[0];
|
|
193
193
|
if (!!vDescr) {
|
|
194
194
|
let index = visualizers.indexOf(vDescr);
|
|
195
195
|
if (index !== -1) {
|
|
@@ -2497,6 +2497,9 @@ PivotModel.UseIntervalsFrom = 10;
|
|
|
2497
2497
|
VisualizationManager.registerPivotVisualizer(PivotModel);
|
|
2498
2498
|
|
|
2499
2499
|
class RankingModel extends SelectBase {
|
|
2500
|
+
constructor(question, data, options, name) {
|
|
2501
|
+
super(question, data, options, name || "ranking");
|
|
2502
|
+
}
|
|
2500
2503
|
getQuestionResults() {
|
|
2501
2504
|
const name = this.question.name;
|
|
2502
2505
|
return this.data.map((dataItem) => dataItem[name]);
|
|
@@ -10369,6 +10372,17 @@ class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
|
|
|
10369
10372
|
}
|
|
10370
10373
|
VisualizationManager.registerVisualizer("matrixdynamic", VisualizationMatrixDynamic);
|
|
10371
10374
|
|
|
10375
|
+
function isChoicesArraysEqual(choices1, choices2) {
|
|
10376
|
+
if (choices1.length !== choices2.length)
|
|
10377
|
+
return false;
|
|
10378
|
+
for (let i = 0; i < choices1.length; i++) {
|
|
10379
|
+
if (choices1[i].value !== choices2[i].value ||
|
|
10380
|
+
choices1[i].text !== choices2[i].text) {
|
|
10381
|
+
return false;
|
|
10382
|
+
}
|
|
10383
|
+
}
|
|
10384
|
+
return true;
|
|
10385
|
+
}
|
|
10372
10386
|
class VisualizationMatrixDropdown extends VisualizerBase {
|
|
10373
10387
|
constructor(question, data, options = {}, name) {
|
|
10374
10388
|
super(question, data, options, name || "matrixDropdown");
|
|
@@ -10384,18 +10398,22 @@ class VisualizationMatrixDropdown extends VisualizerBase {
|
|
|
10384
10398
|
this._childOptions.transposeData = true;
|
|
10385
10399
|
this._childOptions.seriesValues = question.rows.map((row) => row.value);
|
|
10386
10400
|
this._childOptions.seriesLabels = question.rows.map((row) => row.text);
|
|
10387
|
-
|
|
10388
|
-
const canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(innerQuestion => Helpers.isArraysEqual(innerQuestion.choices, this.question.choices));
|
|
10389
|
-
if (canGroupColumns) {
|
|
10401
|
+
if (this.canGroupColumns) {
|
|
10390
10402
|
var creators = VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
|
|
10391
10403
|
this._matrixDropdownVisualizer = new creators[0](this.question, [], this._childOptions);
|
|
10392
10404
|
}
|
|
10393
10405
|
else {
|
|
10406
|
+
const innerQuestions = this.getQuestions();
|
|
10394
10407
|
this._matrixDropdownVisualizer = new VisualizationPanel(innerQuestions, [], this._childOptions);
|
|
10395
10408
|
}
|
|
10396
10409
|
this._matrixDropdownVisualizer.onAfterRender.add(this.onPanelAfterRenderCallback);
|
|
10397
10410
|
this.updateData(data);
|
|
10398
10411
|
}
|
|
10412
|
+
get canGroupColumns() {
|
|
10413
|
+
const innerQuestions = this.getQuestions();
|
|
10414
|
+
const canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(innerQuestion => innerQuestion.getType() !== "boolean" && isChoicesArraysEqual(innerQuestion.choices, this.question.choices));
|
|
10415
|
+
return canGroupColumns;
|
|
10416
|
+
}
|
|
10399
10417
|
setLocale(newLocale) {
|
|
10400
10418
|
super.setLocale(newLocale);
|
|
10401
10419
|
this._childOptions.seriesLabels = this.question.rows.map((row) => row.text);
|