survey-analytics 1.9.31 → 1.9.32

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/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "test_debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
7
7
  "testcafe": "concurrently \"http-server\" \"testcafe chrome testCafe/\"",
8
8
  "testcafe_ci": "http-server --silent & testcafe chrome:headless testCafe/ --reporter minimal,dashboard",
9
- "testcafe_file": "concurrently \"http-server --silent\" \"testcafe chrome testCafe/summary/basetests.js --selector-timeout 1500 --reporter minimal --debug-mode\"",
9
+ "testcafe:file": "concurrently \"http-server --silent\" \"testcafe chrome testCafe/tabulator/basetests.js --selector-timeout 1500 --reporter minimal --debug-mode\"",
10
10
  "release": "standard-version --message \"Release: %s [skip ci]\" ",
11
11
  "doc_gen": "node doc_generator/lib_docgenerator.js src/index.ts",
12
12
  "doc_update": "chmod +x ./docupdate_npm.sh && ./docupdate_npm.sh",
@@ -16,7 +16,7 @@
16
16
  "lint": "eslint ./src --quiet",
17
17
  "pre-push-check": "npm run lint && npm run test"
18
18
  },
19
- "version": "1.9.31",
19
+ "version": "1.9.32",
20
20
  "name": "survey-analytics",
21
21
  "description": "SurveyJS analytics Library.",
22
22
  "main": "survey.analytics.js",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Analytics library v1.9.31
2
+ * surveyjs - SurveyJS Analytics library v1.9.32
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,4 +1,4 @@
1
- /*Type definitions for SurveyJS Analytics library v1.9.31
1
+ /*Type definitions for SurveyJS Analytics library v1.9.32
2
2
  Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
3
3
  Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
4
4
  */
@@ -8,10 +8,10 @@ Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
8
8
 
9
9
  import { Event } from "survey-core";
10
10
  import { Question } from "survey-core";
11
+ import { SurveyModel } from "survey-core";
11
12
  import { IQuestion } from "survey-core";
12
13
  import { QuestionMatrixDropdownModel } from "survey-core";
13
14
  import { ItemValue } from "survey-core";
14
- import { SurveyModel } from "survey-core";
15
15
  import Plotly from "plotly.js-dist-min";
16
16
  import { QuestionMatrixModel } from "survey-core";
17
17
  import { QuestionBooleanModel } from "survey-core";
@@ -292,7 +292,7 @@ export class VisualizerBase implements IDataInfo {
292
292
  /**
293
293
  * Renders visualizer in the given container.
294
294
  */
295
- render(targetElement: HTMLElement): void;
295
+ render(targetElement: HTMLElement | string): void;
296
296
  /**
297
297
  * Redraws visualizer and all inner content.
298
298
  */
@@ -357,25 +357,131 @@ import "./visualizationPanel.scss";
357
357
  export interface IVisualizerPanelRenderedElement extends IVisualizerPanelElement {
358
358
  renderedElement?: HTMLElement;
359
359
  }
360
+ /**
361
+ * This interface contains all available options to setup a visualization panel
362
+ */
363
+ export interface IVisualizationPanelOptions {
364
+ /**
365
+ * Set the length of a label where the truncation starts. Set to -1 to disable truncate. Default is 27
366
+ */
367
+ labelTruncateLength?: number;
368
+ /**
369
+ * Set it to true to allow make elements private/public also @see persmissions property
370
+ */
371
+ allowMakeQuestionsPrivate?: boolean;
372
+ /**
373
+ * An array of series values in data to group data by series
374
+ */
375
+ seriesValues?: string[];
376
+ /**
377
+ * Labels for series to display, if not passed the seriesValues are used as labels
378
+ */
379
+ seriesLabels?: string[];
380
+ /**
381
+ * Set it to true to force use values as labels
382
+ */
383
+ useValuesAsLabels?: boolean;
384
+ /**
385
+ * Pass survey instance to use localses from the survey JSON
386
+ */
387
+ survey?: SurveyModel;
388
+ /**
389
+ * dataProvider instance for this visualizer
390
+ */
391
+ dataProvider?: DataProvider;
392
+ /**
393
+ * Set it to false to deny user to hide/show individual questions, this will hide the corresponding question toolbar button
394
+ */
395
+ allowHideQuestions?: boolean;
396
+ /**
397
+ * Set it to false to disable items drag/drop reordering and dynamic layouting
398
+ */
399
+ allowDynamicLayout?: boolean;
400
+ /**
401
+ * Layout engine to be used for layouting inner visualizers @see LayoutEngine
402
+ */
403
+ layoutEngine?: LayoutEngine;
404
+ /**
405
+ * Set to true to allow to show percentages in bar charts, this will show the corresponding question toolbar button
406
+ */
407
+ allowShowPercentages?: boolean;
408
+ /**
409
+ * Set it to true to show percentages in bar charts
410
+ */
411
+ showPercentages?: boolean;
412
+ /**
413
+ * Set it to true to show percentages only in bar charts (don't show values)
414
+ */
415
+ showOnlyPercentages?: boolean;
416
+ /**
417
+ * Set percentage decimal presision
418
+ */
419
+ percentagePrecision?: number;
420
+ /**
421
+ *
422
+ */
423
+ haveCommercialLicense?: boolean;
424
+ /**
425
+ * Set to true to allow change answers order, choices are ordered by answers count, this will show the corresponding question toolbar dropdown
426
+ */
427
+ allowChangeAnswersOrder?: boolean;
428
+ /**
429
+ * Defauls answers order
430
+ */
431
+ answersOrder?: "default" | "desc" | "desc";
432
+ /**
433
+ * Set to true to allow hide empty answers, this will show the corresponding question toolbar button
434
+ */
435
+ allowHideEmptyAnswers?: boolean;
436
+ /**
437
+ * Set to true to hide empty answers
438
+ */
439
+ hideEmptyAnswers?: boolean;
440
+ /**
441
+ * Set to true to allow show top N answers, this will show the corresponding question toolbar dropdown
442
+ */
443
+ allowTopNAnswers?: boolean;
444
+ /**
445
+ * Set to true to allow show missing answers, this will show the corresponding question toolbar button
446
+ */
447
+ allowShowMissingAnswers?: boolean;
448
+ /**
449
+ * Set to true to allow to use experimental features: e.g. vertical bar chart configuration
450
+ */
451
+ allowExperimentalFeatures?: boolean;
452
+ /**
453
+ * Set default chart type
454
+ */
455
+ defaultChartType?: string;
456
+ /**
457
+ * Set to true to allow transpose data: answers in matrix can be grouped by columns or by rows, this will show the corresponding question toolbar button
458
+ */
459
+ allowTransposeData?: boolean;
460
+ /**
461
+ * Set to false to disable selection and cross filtering in charts
462
+ */
463
+ allowSelection?: boolean;
464
+ /**
465
+ * Pass a function to render content of a visualizer
466
+ */
467
+ renderContent?: Function;
468
+ /**
469
+ * Pass a function to destroy content of a visualizer
470
+ */
471
+ destroyContent?: Function;
472
+ /**
473
+ * Set to true to strip HTML tags from titles
474
+ */
475
+ stripHtmlFromTitles?: boolean;
476
+ }
360
477
  /**
361
478
  * VisualizationPanel is responsible for visualizing an array of survey questions
362
- *
363
- * constructor parameters:
364
- * questions - an array of survey questions to visualize,
365
- * data - an array of answers in format of survey result,
366
- * options - object with the following options,
367
- * elements - list of visual element descriptions
368
- *
369
- * options:
370
- * allowDynamicLayout - set it to false to disable items drag/drop reordering and dynamic layouting,
371
- * labelTruncateLength - the length of the label where the truncation starts. Set to -1 to disable truncate. Default is 27.
372
- * allowHideQuestions - set it to false to deny user to hide/show individual questions,
373
- * allowMakeQuestionsPrivate - set it to true to allow make elements private/public also see persmissions property,
374
- * seriesValues - an array of series values in data to group data by series,
375
- * seriesLabels - labels for series to display, if not passed the seriesValues are used as labels,
376
- * survey - pass survey instance to use localses from the survey JSON,
377
- * dataProvider - dataProvider for this visualizer,
378
- * layoutEngine - layout engine to be used for layouting inner visualizers
479
+ * <br/>
480
+ * <br/> constructor parameters:
481
+ * <br/> questions - an array of survey questions to visualize,
482
+ * <br/> data - an array of answers in format of survey result,
483
+ * <br/> options - object of the IVisualizationPanelOptions type, @see IVisualizationPanelOptions
484
+ * <br/> elements - list of visual element descriptions
379
485
  *
380
486
  */
381
487
  export class VisualizationPanel extends VisualizerBase {
@@ -384,9 +490,7 @@ export class VisualizationPanel extends VisualizerBase {
384
490
  visualizers: Array<VisualizerBase>;
385
491
  constructor(questions: Array<any>, data: Array<{
386
492
  [index: string]: any;
387
- }>, options?: {
388
- [index: string]: any;
389
- }, _elements?: Array<IVisualizerPanelRenderedElement>);
493
+ }>, options?: IVisualizationPanelOptions, _elements?: Array<IVisualizerPanelRenderedElement>);
390
494
  protected showElement(elementName: string): void;
391
495
  protected hideElement(elementName: string): void;
392
496
  protected makeElementPrivate(element: IVisualizerPanelElement): void;
@@ -607,7 +711,7 @@ export class DataTables extends Table {
607
711
  setPageSize(value: number): void;
608
712
  setPageNumber(value: number): void;
609
713
  getPageNumber(): number;
610
- render(targetNode: HTMLElement): void;
714
+ render(targetNode: HTMLElement | string): void;
611
715
  getColumns(): Array<any>;
612
716
  layout(): void;
613
717
  }
@@ -641,7 +745,7 @@ export class Tabulator extends Table {
641
745
  static set haveCommercialLicense(val: boolean);
642
746
  constructor(survey: SurveyModel, data: Array<Object>, options: ITabulatorOptions, _columns?: Array<any>);
643
747
  tabulatorTables: any;
644
- render(targetNode: HTMLElement): void;
748
+ render(targetNode: HTMLElement | string): void;
645
749
  destroy: () => void;
646
750
  getColumns(): Array<any>;
647
751
  setColumnVisibility(columnName: string, isVisible: boolean): void;
@@ -862,7 +966,7 @@ export abstract class Table {
862
966
  abstract applyFilter(value: string): void;
863
967
  abstract applyColumnFilter(columnName: string, value: string): void;
864
968
  abstract sortByColumn(columnName: string, direction: string): void;
865
- render(targetNode: HTMLElement): void;
969
+ render(targetNode: HTMLElement | string): void;
866
970
  enableColumnReorder(): void;
867
971
  disableColumnReorder(): void;
868
972
  getPageNumber(): number;
@@ -871,6 +975,7 @@ export abstract class Table {
871
975
  setPageSize(value: number): void;
872
976
  getCreatedRows(): TableRow[];
873
977
  clearCreatedRows(): void;
978
+ protected get useNamesAsTitles(): boolean;
874
979
  protected buildColumns: (survey: SurveyModel) => ITableColumn[];
875
980
  isColumnVisible(column: ITableColumn): boolean;
876
981
  get columns(): Array<ITableColumn>;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Analytics library v1.9.31
2
+ * surveyjs - SurveyJS Analytics library v1.9.32
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */