survey-analytics 2.2.3 → 2.2.5

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 (53) hide show
  1. package/fesm/shared.mjs +2 -1
  2. package/fesm/shared.mjs.map +1 -1
  3. package/fesm/shared2.mjs +379 -268
  4. package/fesm/shared2.mjs.map +1 -1
  5. package/fesm/survey.analytics.core.mjs +2 -2
  6. package/fesm/survey.analytics.mjs +177 -418
  7. package/fesm/survey.analytics.mjs.map +1 -1
  8. package/fesm/survey.analytics.tabulator.mjs +16 -4
  9. package/fesm/survey.analytics.tabulator.mjs.map +1 -1
  10. package/package.json +6 -5
  11. package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +1 -0
  12. package/survey-analytics-tabulator.types/localizationManager.d.ts +1 -0
  13. package/survey-analytics-tabulator.types/tables/extensions/tableextensions.d.ts +1 -0
  14. package/survey-analytics.types/analytics-localization/english.d.ts +1 -0
  15. package/survey-analytics.types/boolean.d.ts +0 -1
  16. package/survey-analytics.types/entries/summary.core.d.ts +2 -1
  17. package/survey-analytics.types/histogram.d.ts +1 -1
  18. package/survey-analytics.types/localizationManager.d.ts +1 -0
  19. package/survey-analytics.types/pivot.d.ts +2 -0
  20. package/survey-analytics.types/plotly/chart-adapter.d.ts +22 -0
  21. package/survey-analytics.types/plotly/index.d.ts +2 -8
  22. package/survey-analytics.types/plotly/legacy.d.ts +33 -0
  23. package/survey-analytics.types/plotly/setup.d.ts +5 -3
  24. package/survey-analytics.types/{plotly/ranking.d.ts → ranking.d.ts} +2 -2
  25. package/survey-analytics.types/selectBase.d.ts +2 -0
  26. package/survey-analytics.types/statisticCalculators.d.ts +4 -0
  27. package/survey-analytics.types/visualizationManager.d.ts +1 -0
  28. package/survey-analytics.types/visualizerBase.d.ts +12 -3
  29. package/survey.analytics.core.css +1 -1
  30. package/survey.analytics.core.js +355 -151
  31. package/survey.analytics.core.js.map +1 -1
  32. package/survey.analytics.core.min.css +1 -1
  33. package/survey.analytics.core.min.js +1 -1
  34. package/survey.analytics.core.min.js.LICENSE.txt +1 -1
  35. package/survey.analytics.css +1 -1
  36. package/survey.analytics.js +679 -909
  37. package/survey.analytics.js.map +1 -1
  38. package/survey.analytics.min.css +1 -1
  39. package/survey.analytics.min.js +1 -1
  40. package/survey.analytics.min.js.LICENSE.txt +1 -1
  41. package/survey.analytics.tabulator.css +1 -1
  42. package/survey.analytics.tabulator.js +39 -5
  43. package/survey.analytics.tabulator.js.map +1 -1
  44. package/survey.analytics.tabulator.min.css +1 -1
  45. package/survey.analytics.tabulator.min.js +1 -1
  46. package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
  47. package/survey-analytics.types/plotly/boolean.d.ts +0 -16
  48. package/survey-analytics.types/plotly/histogram.d.ts +0 -12
  49. package/survey-analytics.types/plotly/matrix.d.ts +0 -11
  50. package/survey-analytics.types/plotly/matrixdropdown-grouped.d.ts +0 -11
  51. package/survey-analytics.types/plotly/pivot.d.ts +0 -12
  52. package/survey-analytics.types/plotly/rating.d.ts +0 -20
  53. package/survey-analytics.types/plotly/selectBase.d.ts +0 -25
package/package.json CHANGED
@@ -15,9 +15,10 @@
15
15
  "build:types:summary": "tsc --p tsconfig.summary.json && echo \"export * from './survey-analytics.types/entries/summary';\" >> build/survey.analytics.d.ts",
16
16
  "build:types:tabulator": "tsc --p tsconfig.tabulator.json && echo \"export * from './survey-analytics-tabulator.types/entries/tabulator';\" >> build/survey.analytics.tabulator.d.ts",
17
17
  "lint": "eslint ./src --quiet",
18
- "pre-push-check": "npm run lint && npm run test"
18
+ "pre-push-check": "npm run lint && npm run test",
19
+ "postinstall": "playwright install chromium"
19
20
  },
20
- "version": "2.2.3",
21
+ "version": "2.2.5",
21
22
  "name": "survey-analytics",
22
23
  "description": "SurveyJS analytics Library.",
23
24
  "main": "survey.analytics.js",
@@ -45,7 +46,7 @@
45
46
  "tabulator-tables": "^6.2.5"
46
47
  },
47
48
  "devDependencies": {
48
- "@playwright/test": "^1.53.1",
49
+ "@playwright/test": "1.53.1",
49
50
  "@rollup/plugin-commonjs": "^28.0.2",
50
51
  "@rollup/plugin-node-resolve": "^16.0.0",
51
52
  "@rollup/plugin-replace": "^6.0.2",
@@ -67,7 +68,7 @@
67
68
  "jest-junit": "^16.0.0",
68
69
  "mini-css-extract-plugin": "^2.9.0",
69
70
  "node-uuid": "1.4.7",
70
- "playwright": "^1.53.1",
71
+ "playwright": "1.53.1",
71
72
  "puppeteer": "22.13.1",
72
73
  "replace-in-file": "^6.3.2",
73
74
  "rollup": "^4.34.8",
@@ -89,7 +90,7 @@
89
90
  "peerDependencies": {
90
91
  "@types/plotly.js-dist-min": "^2.3.0",
91
92
  "@types/tabulator-tables": "^6.2.3",
92
- "survey-core": "2.2.3"
93
+ "survey-core": "2.2.5"
93
94
  },
94
95
  "husky": {
95
96
  "hooks": {
@@ -41,6 +41,7 @@ export declare var englishStrings: {
41
41
  ascOrder: string;
42
42
  descOrder: string;
43
43
  showMinorColumns: string;
44
+ actionsColumn: string;
44
45
  otherCommentTitle: string;
45
46
  showPercentages: string;
46
47
  hidePercentages: string;
@@ -56,6 +56,7 @@ export declare var surveyStrings: {
56
56
  ascOrder: string;
57
57
  descOrder: string;
58
58
  showMinorColumns: string;
59
+ actionsColumn: string;
59
60
  otherCommentTitle: string;
60
61
  showPercentages: string;
61
62
  hidePercentages: string;
@@ -17,5 +17,6 @@ export declare class TableExtensions {
17
17
  private static removeExtension;
18
18
  static unregisterExtension(location: string, actionName: string): void;
19
19
  static findExtension(location: string, actionName: string): ITableExtension;
20
+ static getExtensions(location: string): Array<ITableExtension>;
20
21
  private sortExtensions;
21
22
  }
@@ -41,6 +41,7 @@ export declare var englishStrings: {
41
41
  ascOrder: string;
42
42
  descOrder: string;
43
43
  showMinorColumns: string;
44
+ actionsColumn: string;
44
45
  otherCommentTitle: string;
45
46
  showPercentages: string;
46
47
  hidePercentages: string;
@@ -2,7 +2,6 @@ import { Question, QuestionBooleanModel } from "survey-core";
2
2
  import { ItemValue } from "survey-core";
3
3
  import { SelectBase } from "./selectBase";
4
4
  export declare class BooleanModel extends SelectBase {
5
- protected chartTypes: string[];
6
5
  constructor(question: Question, data: Array<{
7
6
  [index: string]: any;
8
7
  }>, options?: Object, name?: string);
@@ -14,11 +14,11 @@ import "../analytics-localization/polish";
14
14
  import "../analytics-localization/finnish";
15
15
  export * from "../dataProvider";
16
16
  export * from "../visualizerFactory";
17
- export * from "../number";
18
17
  export * from "../selectBase";
19
18
  export * from "../matrix";
20
19
  export * from "../boolean";
21
20
  export * from "../histogram";
21
+ export * from "../number";
22
22
  export * from "../visualizerBase";
23
23
  export * from "../visualizationManager";
24
24
  export * from "../visualizationPanel";
@@ -31,5 +31,6 @@ export * from "../wordcloud/stopwords/index";
31
31
  export * from "../text";
32
32
  export * from "../statistics-table";
33
33
  export * from "../nps";
34
+ export * from "../ranking";
34
35
  export * from "../pivot";
35
36
  export { DocumentHelper } from "../utils/index";
@@ -6,7 +6,6 @@ export declare class HistogramModel extends SelectBase {
6
6
  private _continiousData;
7
7
  private _cachedIntervals;
8
8
  private _intervalPrecision;
9
- protected chartTypes: string[];
10
9
  static IntervalsCount: number;
11
10
  static UseIntervalsFrom: number;
12
11
  constructor(question: Question, data: Array<{
@@ -36,4 +35,5 @@ export declare class HistogramModel extends SelectBase {
36
35
  get intervals(): any;
37
36
  convertFromExternalData(externalCalculatedData: any): any[];
38
37
  protected getCalculatedValuesCore(): Array<any>;
38
+ getValueType(): "date" | "number";
39
39
  }
@@ -56,6 +56,7 @@ export declare var surveyStrings: {
56
56
  ascOrder: string;
57
57
  descOrder: string;
58
58
  showMinorColumns: string;
59
+ actionsColumn: string;
59
60
  otherCommentTitle: string;
60
61
  showPercentages: string;
61
62
  hidePercentages: string;
@@ -59,4 +59,6 @@ export declare class PivotModel extends SelectBase {
59
59
  [index: string]: number;
60
60
  }): void;
61
61
  protected getCalculatedValuesCore(): Array<any>;
62
+ getValueType(): "enum" | "date" | "number";
63
+ protected isSupportSoftUpdateContent(): boolean;
62
64
  }
@@ -0,0 +1,22 @@
1
+ import { SelectBase } from "../selectBase";
2
+ import { VisualizerBase, IChartAdapter } from "../visualizerBase";
3
+ export declare const plotlyChartTypes: {
4
+ boolean: string[];
5
+ number: string[];
6
+ selectBase: string[];
7
+ histogram: string[];
8
+ matrix: string[];
9
+ matrixDropdownGrouped: string[];
10
+ pivot: string[];
11
+ };
12
+ export declare class PlotlyChartAdapter implements IChartAdapter {
13
+ protected model: SelectBase | VisualizerBase;
14
+ private _chart;
15
+ constructor(model: SelectBase | VisualizerBase);
16
+ protected patchConfigParameters(chartNode: object, traces: Array<object>, layout: object, config: any): void;
17
+ get chart(): Promise<Plotly.PlotlyHTMLElement>;
18
+ getChartTypes(): string[];
19
+ create(chartNode: HTMLElement): Promise<any>;
20
+ update(chartNode: HTMLElement): Promise<any>;
21
+ destroy(node: HTMLElement): void;
22
+ }
@@ -1,9 +1,3 @@
1
1
  export * from "./setup";
2
- export * from "./selectBase";
3
- export * from "./matrix";
4
- export * from "./boolean";
5
- export * from "./ranking";
6
- export * from "./matrixdropdown-grouped";
7
- export * from "./histogram";
8
- export * from "./rating";
9
- export * from "./pivot";
2
+ export * from "./chart-adapter";
3
+ export * from "./legacy";
@@ -0,0 +1,33 @@
1
+ import { BooleanModel } from "../boolean";
2
+ import { SelectBase } from "../selectBase";
3
+ import { HistogramModel } from "../histogram";
4
+ import { Matrix } from "../matrix";
5
+ import { MatrixDropdownGrouped } from "../matrixDropdownGrouped";
6
+ import { PivotModel } from "../pivot";
7
+ import { NumberModel } from "../number";
8
+ import { RankingModel } from "../ranking";
9
+ export declare class SelectBasePlotly extends SelectBase {
10
+ static types: string[];
11
+ static displayModeBar: any;
12
+ }
13
+ export declare class BooleanPlotly extends BooleanModel {
14
+ static types: string[];
15
+ }
16
+ export declare class HistogramPlotly extends HistogramModel {
17
+ static types: string[];
18
+ }
19
+ export declare class MatrixPlotly extends Matrix {
20
+ static types: string[];
21
+ }
22
+ export declare class MatrixDropdownGroupedPlotly extends MatrixDropdownGrouped {
23
+ static types: string[];
24
+ }
25
+ export declare class PivotPlotly extends PivotModel {
26
+ static types: string[];
27
+ }
28
+ export declare class GaugePlotly extends NumberModel {
29
+ static displayModeBar: any;
30
+ static types: string[];
31
+ }
32
+ export declare class RankingPlotly extends RankingModel {
33
+ }
@@ -1,6 +1,7 @@
1
1
  import { Event } from "survey-core";
2
2
  import { IAnswersData, SelectBase } from "../selectBase";
3
3
  import { VisualizerBase } from "../visualizerBase";
4
+ import { NumberModel } from "../number";
4
5
  export interface PlotlyOptions {
5
6
  traces: Array<any>;
6
7
  layout: any;
@@ -11,19 +12,20 @@ export declare class PlotlySetup {
11
12
  /**
12
13
  * Fires when end user clicks on the 'save as image' button.
13
14
  */
14
- static onImageSaving: Event<(sender: SelectBase, options: any) => any, SelectBase, any>;
15
+ static onImageSaving: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
15
16
  /**
16
17
  * Fires before plot will be created. User can change traces, layout and config of the plot.
17
18
  * Options is an object with the following fields: traces, layout and config of the plot.
18
19
  */
19
20
  static onPlotCreating: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
20
21
  static setups: {
21
- [type: string]: (model: SelectBase, answersData: IAnswersData) => PlotlyOptions;
22
+ [type: string]: (model: VisualizerBase, answersData: IAnswersData) => PlotlyOptions;
22
23
  };
23
- static setup(charType: string, model: SelectBase, answersData: IAnswersData): PlotlyOptions;
24
+ static setup(charType: string, model: VisualizerBase, answersData: IAnswersData): PlotlyOptions;
24
25
  static getTruncatedLabel: (label: string, labelTruncateLength: number) => string;
25
26
  static setupPie(model: SelectBase, answersData: IAnswersData): PlotlyOptions;
26
27
  static setupBar(model: SelectBase, answersData: IAnswersData): PlotlyOptions;
27
28
  static setupVBar(model: SelectBase, answersData: IAnswersData): PlotlyOptions;
28
29
  static setupScatter(model: SelectBase, answersData: IAnswersData): PlotlyOptions;
30
+ static setupGauge(model: NumberModel, answersData: IAnswersData): PlotlyOptions;
29
31
  }
@@ -1,5 +1,5 @@
1
- import { SelectBasePlotly } from "./selectBase";
2
- export declare class RankingPlotly extends SelectBasePlotly {
1
+ import { SelectBase } from "./selectBase";
2
+ export declare class RankingModel extends SelectBase {
3
3
  getQuestionResults(): any[];
4
4
  getEmptyData(): any;
5
5
  protected getCalculatedValuesCore(): Array<any>;
@@ -51,6 +51,8 @@ export declare class SelectBase extends VisualizerBase implements IVisualizerWit
51
51
  protected onChartTypeChanged(): void;
52
52
  protected setChartType(chartType: string): void;
53
53
  protected getCorrectAnswerText(): string;
54
+ protected isSupportSoftUpdateContent(): boolean;
55
+ protected softUpdateContent(): void;
54
56
  getSelectedItemByText(itemText: string): any;
55
57
  setSelection(item: ItemValue): void;
56
58
  get selection(): ItemValue;
@@ -0,0 +1,4 @@
1
+ import { IDataInfo } from "./visualizerBase";
2
+ export declare function defaultStatisticsCalculator(data: Array<any>, dataInfo: IDataInfo): Array<any>;
3
+ export declare function histogramStatisticsCalculator(data: any, intervals: any, seriesValues: Array<string>): Array<any>;
4
+ export declare function mathStatisticsCalculator(data: Array<any>, dataName: string): number[];
@@ -8,6 +8,7 @@ declare type VisualizerConstructor = new (question: Question, data: Array<{
8
8
  * [View Demo](https://surveyjs.io/dashboard/examples/custom-survey-data-visualizer/ (linkStyle))
9
9
  */
10
10
  export declare class VisualizationManager {
11
+ static defaultVisualizer: any;
11
12
  static alternativesVisualizer: any;
12
13
  static pivotVisualizer: any;
13
14
  static vizualizers: {
@@ -1,7 +1,12 @@
1
- import { Question } from "survey-core";
1
+ import { Question, Event } from "survey-core";
2
2
  import { DataProvider, GetDataFn } from "./dataProvider";
3
- import { Event } from "survey-core";
4
3
  import "./visualizerBase.scss";
4
+ export interface IChartAdapter {
5
+ getChartTypes(): string[];
6
+ create(chartNode: HTMLElement): Promise<any>;
7
+ update(chartNode: HTMLElement): Promise<any>;
8
+ destroy(node: HTMLElement): void;
9
+ }
5
10
  export interface IDataInfo {
6
11
  name: string;
7
12
  dataNames: Array<string>;
@@ -47,6 +52,7 @@ export declare class VisualizerBase implements IDataInfo {
47
52
  };
48
53
  private _type?;
49
54
  static suppressVisualizerStubRendering: boolean;
55
+ static chartAdapterType: any;
50
56
  private _showToolbar;
51
57
  private _footerVisualizer;
52
58
  private _dataProvider;
@@ -58,6 +64,7 @@ export declare class VisualizerBase implements IDataInfo {
58
64
  protected contentContainer: HTMLElement;
59
65
  protected footerContainer: HTMLElement;
60
66
  protected _supportSelection: boolean;
67
+ protected _chartAdapter: IChartAdapter;
61
68
  static otherCommentCollapsed: boolean;
62
69
  /**
63
70
  * An event that is raised after the visualizer's content is rendered.
@@ -255,6 +262,9 @@ export declare class VisualizerBase implements IDataInfo {
255
262
  */
256
263
  render(targetElement: HTMLElement | string): void;
257
264
  updateToolbar(): void;
265
+ protected isSupportSoftUpdateContent(): boolean;
266
+ protected softUpdateContent(): void;
267
+ protected hardUpdateContent(): void;
258
268
  updateContent(): void;
259
269
  /**
260
270
  * Re-renders the visualizer and its content.
@@ -325,4 +335,3 @@ export declare class VisualizerBase implements IDataInfo {
325
335
  set locale(newLocale: string);
326
336
  protected setLocale(newLocale: string): void;
327
337
  }
328
- export declare function defaultStatisticsCalculator(data: Array<any>, dataInfo: IDataInfo): Array<any>;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.2.3
2
+ * surveyjs - SurveyJS Dashboard library v2.2.5
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
  */