survey-analytics 2.3.7 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm/shared.mjs +1 -1
- package/fesm/shared2.mjs +61 -38
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +1 -1
- package/fesm/survey.analytics.mjs +1 -1
- package/fesm/survey.analytics.mongo.mjs +221 -0
- package/fesm/survey.analytics.mongo.mjs.map +1 -0
- package/fesm/survey.analytics.tabulator.mjs +37 -2
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +12 -3
- package/survey-analytics-tabulator.types/entries/tabulator.d.ts +2 -0
- package/survey-analytics-tabulator.types/tables/columnbuilder.d.ts +3 -0
- package/survey-analytics.types/visualizationComposite.d.ts +1 -1
- package/survey-analytics.types/visualizationPanel.d.ts +6 -0
- package/survey-analytics.types/visualizerBase.d.ts +5 -0
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +66 -39
- 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 +66 -39
- 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.mongo.js +359 -0
- package/survey.analytics.mongo.js.map +1 -0
- package/survey.analytics.mongo.min.js +2 -0
- package/survey.analytics.mongo.min.js.LICENSE.txt +5 -0
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +80 -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/fesm/shared.mjs
CHANGED
package/fesm/shared2.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.3.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.3.9
|
|
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, g as createLoadingIndicator, b as DataHelper, e as createCommercialLicenseLink, f as svgTemplate, t as toPrecision } from './shared.mjs';
|
|
8
|
-
import { Event, QuestionCustomModel, QuestionCompositeModel, hasLicense, QuestionCommentModel, settings, ItemValue, surveyLocalization, IsTouch } from 'survey-core';
|
|
8
|
+
import { Event, QuestionCustomModel, QuestionCompositeModel, hasLicense, QuestionCommentModel, settings, ItemValue, QuestionRatingModel, surveyLocalization, IsTouch } from 'survey-core';
|
|
9
9
|
|
|
10
10
|
/******************************************************************************
|
|
11
11
|
Copyright (c) Microsoft Corporation.
|
|
@@ -699,6 +699,18 @@ class VisualizerBase {
|
|
|
699
699
|
}
|
|
700
700
|
return undefined;
|
|
701
701
|
}
|
|
702
|
+
/**
|
|
703
|
+
* Returns the visualizer's title.
|
|
704
|
+
*/
|
|
705
|
+
get title() {
|
|
706
|
+
return this.getTitle(this.question);
|
|
707
|
+
}
|
|
708
|
+
getTitle(question) {
|
|
709
|
+
var _a;
|
|
710
|
+
if (question === undefined)
|
|
711
|
+
return "";
|
|
712
|
+
return this.processText(((_a = question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) ? question.locTitle.renderedHtml : question.title);
|
|
713
|
+
}
|
|
702
714
|
/**
|
|
703
715
|
* Returns the visualizer's type.
|
|
704
716
|
*/
|
|
@@ -1197,19 +1209,21 @@ class NumberModel extends VisualizerBase {
|
|
|
1197
1209
|
this.chartTypes = this._chartAdapter.getChartTypes();
|
|
1198
1210
|
this.chartType = this.chartTypes[0];
|
|
1199
1211
|
}
|
|
1200
|
-
this.
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
return {
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
this.
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1212
|
+
if (this.options.allowChangeVisualizerType !== false) {
|
|
1213
|
+
this.registerToolbarItem("changeChartType", () => {
|
|
1214
|
+
if (this.chartTypes.length > 1) {
|
|
1215
|
+
return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
|
|
1216
|
+
return {
|
|
1217
|
+
value: chartType,
|
|
1218
|
+
text: localization.getString("chartType_" + chartType),
|
|
1219
|
+
};
|
|
1220
|
+
}), (option) => this.chartType === option.value, (e) => {
|
|
1221
|
+
this.setChartType(e.target.value);
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
return null;
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1213
1227
|
}
|
|
1214
1228
|
onDataChanged() {
|
|
1215
1229
|
this._resultAverage = undefined;
|
|
@@ -1408,19 +1422,21 @@ class SelectBase extends VisualizerBase {
|
|
|
1408
1422
|
this._chartType = this.options.defaultChartType;
|
|
1409
1423
|
}
|
|
1410
1424
|
}
|
|
1411
|
-
this.
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
return {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
this.
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1425
|
+
if (this.options.allowChangeVisualizerType !== false) {
|
|
1426
|
+
this.registerToolbarItem("changeChartType", () => {
|
|
1427
|
+
if (this.chartTypes.length > 1) {
|
|
1428
|
+
return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
|
|
1429
|
+
return {
|
|
1430
|
+
value: chartType,
|
|
1431
|
+
text: localization.getString("chartType_" + chartType),
|
|
1432
|
+
};
|
|
1433
|
+
}), (option) => this.chartType === option.value, (e) => {
|
|
1434
|
+
this.setChartType(e.target.value);
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
return null;
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1424
1440
|
this.registerToolbarItem("changeAnswersOrder", () => {
|
|
1425
1441
|
if (this.isSupportAnswersOrder()) {
|
|
1426
1442
|
this.choicesOrderSelector = DocumentHelper.createSelector([
|
|
@@ -1596,6 +1612,11 @@ class SelectBase extends VisualizerBase {
|
|
|
1596
1612
|
}
|
|
1597
1613
|
}
|
|
1598
1614
|
getSelectedItemByText(itemText) {
|
|
1615
|
+
var _a;
|
|
1616
|
+
if (this.question instanceof QuestionRatingModel) {
|
|
1617
|
+
const rateValues = this.question.rateValues;
|
|
1618
|
+
return (_a = rateValues === null || rateValues === void 0 ? void 0 : rateValues.filter((choice) => choice.text === itemText)[0]) !== null && _a !== void 0 ? _a : new ItemValue(parseFloat(itemText), itemText);
|
|
1619
|
+
}
|
|
1599
1620
|
const selBase = this.question;
|
|
1600
1621
|
if (this.question.hasOther && itemText == selBase.otherText) {
|
|
1601
1622
|
return selBase.otherItem;
|
|
@@ -2715,12 +2736,14 @@ class AlternativeVisualizersWrapper extends VisualizerBase {
|
|
|
2715
2736
|
this.visualizersWithSelection.push(visualizer);
|
|
2716
2737
|
}
|
|
2717
2738
|
});
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2739
|
+
if (this.options.allowChangeVisualizerType !== false) {
|
|
2740
|
+
this.registerToolbarItem("changeVisualizer", () => this.visualizerSelector = DocumentHelper.createSelector(this.visualizers.map((visualizer) => {
|
|
2741
|
+
return {
|
|
2742
|
+
value: visualizer.type,
|
|
2743
|
+
text: localization.getString("visualizer_" + visualizer.type),
|
|
2744
|
+
};
|
|
2745
|
+
}), (option) => this.visualizer.type === option.value, (e) => this.setVisualizer(e.target.value)), 0);
|
|
2746
|
+
}
|
|
2724
2747
|
this.visualizer = visualizers[0];
|
|
2725
2748
|
this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback);
|
|
2726
2749
|
this.visualizer.onStateChanged.add(this.onVisualizerStateChangedCallback);
|
|
@@ -10171,7 +10194,7 @@ class VisualizationPanel extends VisualizerBase {
|
|
|
10171
10194
|
question = Array.isArray(question) ? question[0] : question;
|
|
10172
10195
|
const element = this.getElement(question.name);
|
|
10173
10196
|
if (!!element) {
|
|
10174
|
-
element.displayName = this.
|
|
10197
|
+
element.displayName = this.getTitle(question);
|
|
10175
10198
|
}
|
|
10176
10199
|
});
|
|
10177
10200
|
this.visualizers.forEach(v => {
|
|
@@ -10218,7 +10241,7 @@ class VisualizationPanel extends VisualizerBase {
|
|
|
10218
10241
|
question = Array.isArray(question) ? question[0] : question;
|
|
10219
10242
|
return {
|
|
10220
10243
|
name: question.name,
|
|
10221
|
-
displayName: this.
|
|
10244
|
+
displayName: this.getTitle(question),
|
|
10222
10245
|
isVisible: true,
|
|
10223
10246
|
isPublic: true,
|
|
10224
10247
|
};
|
|
@@ -10640,9 +10663,9 @@ class VisualizationComposite extends VisualizationPanelDynamic {
|
|
|
10640
10663
|
super(question, data, options, name || "composite");
|
|
10641
10664
|
}
|
|
10642
10665
|
getQuestions() {
|
|
10643
|
-
const
|
|
10666
|
+
const questionComposite = this.question;
|
|
10644
10667
|
const innerQuestions = [];
|
|
10645
|
-
|
|
10668
|
+
questionComposite.contentPanel.addQuestionsToList(innerQuestions);
|
|
10646
10669
|
return innerQuestions;
|
|
10647
10670
|
}
|
|
10648
10671
|
}
|