survey-analytics 1.9.84 → 1.9.86
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 +2 -2
- package/survey.analytics.css +1 -1
- package/survey.analytics.d.ts +266 -154
- package/survey.analytics.datatables.css +1 -1
- package/survey.analytics.datatables.d.ts +55 -0
- package/survey.analytics.datatables.js +94 -22
- package/survey.analytics.datatables.min.css +1 -1
- package/survey.analytics.datatables.min.js +2 -2
- package/survey.analytics.js +340 -223
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js +3 -3
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.d.ts +55 -0
- package/survey.analytics.tabulator.js +96 -24
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +2 -2
package/survey.analytics.d.ts
CHANGED
|
@@ -227,6 +227,60 @@ declare module "analytics-localization/french" {
|
|
|
227
227
|
responses: string;
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
+
declare module "analytics-localization/german" {
|
|
231
|
+
export var germanStrings: {
|
|
232
|
+
groupButton: string;
|
|
233
|
+
ungroupButton: string;
|
|
234
|
+
selectButton: string;
|
|
235
|
+
hideColumn: string;
|
|
236
|
+
showColumn: string;
|
|
237
|
+
makePrivateColumn: string;
|
|
238
|
+
makePublicColumn: string;
|
|
239
|
+
moveToDetail: string;
|
|
240
|
+
showAsColumn: string;
|
|
241
|
+
filterPlaceholder: string;
|
|
242
|
+
removeRows: string;
|
|
243
|
+
showLabel: string;
|
|
244
|
+
entriesLabel: string;
|
|
245
|
+
visualizer_text: string;
|
|
246
|
+
visualizer_wordcloud: string;
|
|
247
|
+
chartType_bar: string;
|
|
248
|
+
chartType_stackedbar: string;
|
|
249
|
+
chartType_doughnut: string;
|
|
250
|
+
chartType_pie: string;
|
|
251
|
+
chartType_scatter: string;
|
|
252
|
+
chartType_gauge: string;
|
|
253
|
+
chartType_bullet: string;
|
|
254
|
+
hideButton: string;
|
|
255
|
+
makePrivateButton: string;
|
|
256
|
+
makePublicButton: string;
|
|
257
|
+
showButton: string;
|
|
258
|
+
filter: string;
|
|
259
|
+
resetFilter: string;
|
|
260
|
+
changeLocale: string;
|
|
261
|
+
clearButton: string;
|
|
262
|
+
addElement: string;
|
|
263
|
+
defaultOrder: string;
|
|
264
|
+
ascOrder: string;
|
|
265
|
+
descOrder: string;
|
|
266
|
+
showMinorColumns: string;
|
|
267
|
+
otherCommentTitle: string;
|
|
268
|
+
showPercentages: string;
|
|
269
|
+
hidePercentages: string;
|
|
270
|
+
pdfDownloadCaption: string;
|
|
271
|
+
xlsxDownloadCaption: string;
|
|
272
|
+
csvDownloadCaption: string;
|
|
273
|
+
saveDiagramAsPNG: string;
|
|
274
|
+
hideEmptyAnswers: string;
|
|
275
|
+
showEmptyAnswers: string;
|
|
276
|
+
"topNValueText-1": string;
|
|
277
|
+
topNValueText5: string;
|
|
278
|
+
topNValueText10: string;
|
|
279
|
+
topNValueText20: string;
|
|
280
|
+
noVisualizerForQuestion: string;
|
|
281
|
+
noResults: string;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
230
284
|
declare module "analytics-localization/norwegian" {
|
|
231
285
|
export var norwegianStrings: {
|
|
232
286
|
groupButton: string;
|
|
@@ -621,16 +675,8 @@ declare module "analytics-localization/arabic" {
|
|
|
621
675
|
}
|
|
622
676
|
declare module "dataProvider" {
|
|
623
677
|
import { Event } from "survey-core";
|
|
624
|
-
/**
|
|
625
|
-
* Describes data info:
|
|
626
|
-
* dataName - question name, used as a key to obtain question data
|
|
627
|
-
* getValues - function returning an array of all possible values
|
|
628
|
-
* getLabels - function returning an array of human-friendly descriptions for values
|
|
629
|
-
* getSeriesValues - function returning an array of all possible series values
|
|
630
|
-
* getSeriesLabels - function returning an array of human-friendly descriptions for series values
|
|
631
|
-
*/
|
|
632
678
|
export interface IDataInfo {
|
|
633
|
-
|
|
679
|
+
name: string | Array<string>;
|
|
634
680
|
getValues(): Array<any>;
|
|
635
681
|
getLabels(): Array<string>;
|
|
636
682
|
getSeriesValues(): Array<string>;
|
|
@@ -675,7 +721,9 @@ declare module "visualizationManager" {
|
|
|
675
721
|
[index: string]: any;
|
|
676
722
|
}>, options?: Object) => any;
|
|
677
723
|
/**
|
|
678
|
-
*
|
|
724
|
+
* An object with methods used to register and unregister visualizers for individual question types.
|
|
725
|
+
*
|
|
726
|
+
* [View Demo](https://surveyjs.io/dashboard/examples/visualize-answers-from-text-entry-fields-with-charts/ (linkStyle))
|
|
679
727
|
*/
|
|
680
728
|
export class VisualizationManager {
|
|
681
729
|
static alternativesVisualizer: any;
|
|
@@ -683,27 +731,39 @@ declare module "visualizationManager" {
|
|
|
683
731
|
[index: string]: Array<VisualizerConstructor>;
|
|
684
732
|
};
|
|
685
733
|
/**
|
|
686
|
-
*
|
|
734
|
+
* Registers a visualizer for a specified question type.
|
|
735
|
+
*
|
|
736
|
+
* [View Demo](https://surveyjs.io/dashboard/examples/visualize-answers-from-text-entry-fields-with-charts/ (linkStyle))
|
|
737
|
+
* @param questionType A question [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
738
|
+
* @param constructor A function that returns a visualizer constructor to register.
|
|
687
739
|
*/
|
|
688
|
-
static registerVisualizer(
|
|
740
|
+
static registerVisualizer(questionType: string, constructor: VisualizerConstructor): void;
|
|
689
741
|
/**
|
|
690
|
-
*
|
|
742
|
+
* Unregisters a visualizer for a specified question type.
|
|
743
|
+
*
|
|
744
|
+
* [View Demo](https://surveyjs.io/dashboard/examples/visualize-answers-from-text-entry-fields-with-charts/ (linkStyle))
|
|
745
|
+
* @param questionType A question [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
746
|
+
* @param constructor A function that returns a visualizer constructor to unregister.
|
|
691
747
|
*/
|
|
692
|
-
static unregisterVisualizer(
|
|
748
|
+
static unregisterVisualizer(questionType: string, constructor: VisualizerConstructor): void;
|
|
693
749
|
/**
|
|
694
|
-
*
|
|
750
|
+
* Unregisters a visualizer for all question types.
|
|
751
|
+
* @param constructor A function that returns a visualizer constructor to unregister.
|
|
695
752
|
*/
|
|
696
753
|
static unregisterVisualizerForAll(constructor: VisualizerConstructor): void;
|
|
697
754
|
/**
|
|
698
|
-
*
|
|
755
|
+
* Returns all visualizer constructors for a specified question type.
|
|
756
|
+
* @param questionType A question [type](https://surveyjs.io/form-library/documentation/api-reference/question#getType).
|
|
699
757
|
*/
|
|
700
|
-
static getVisualizersByType(
|
|
758
|
+
static getVisualizersByType(questionType: string): VisualizerConstructor[];
|
|
701
759
|
/**
|
|
702
|
-
*
|
|
760
|
+
* Returns a constructor for an alternative visualizer selector.
|
|
761
|
+
* @see registerAlternativesVisualizer
|
|
703
762
|
*/
|
|
704
763
|
static getAlternativesVisualizer(): any;
|
|
705
764
|
/**
|
|
706
|
-
*
|
|
765
|
+
* Registers an alternative visualizer selector.
|
|
766
|
+
* @param constructor A function that returns a constructor for an alternative visualizer selector.
|
|
707
767
|
*/
|
|
708
768
|
static registerAlternativesVisualizer(constructor: any): void;
|
|
709
769
|
}
|
|
@@ -712,12 +772,16 @@ declare module "visualizerFactory" {
|
|
|
712
772
|
import { Question } from "survey-core";
|
|
713
773
|
import { VisualizerBase } from "visualizerBase";
|
|
714
774
|
/**
|
|
715
|
-
*
|
|
775
|
+
* An object that allows you to create individual visualizers without creating a [visualization panel](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel).
|
|
716
776
|
*/
|
|
717
777
|
export class VisualizerFactory {
|
|
718
778
|
/**
|
|
719
|
-
*
|
|
720
|
-
*
|
|
779
|
+
* Creates a visualizer for a specified question.
|
|
780
|
+
*
|
|
781
|
+
* If a question has more than one [registered](https://surveyjs.io/dashboard/documentation/api-reference/visualizationmanager#registerVisualizer) visualizer, users can switch between them using a drop-down menu.
|
|
782
|
+
* @param question A question for which to create a visualizer.
|
|
783
|
+
* @param data A data array with survey results to be visualized.
|
|
784
|
+
* @param options An object with any custom properties you need within the visualizer.
|
|
721
785
|
*/
|
|
722
786
|
static createVisualizer(question: Question, data: Array<{
|
|
723
787
|
[index: string]: any;
|
|
@@ -770,28 +834,36 @@ declare module "visualizerBase" {
|
|
|
770
834
|
import { IDataInfo, DataProvider } from "dataProvider";
|
|
771
835
|
import { Event } from "survey-core";
|
|
772
836
|
/**
|
|
773
|
-
*
|
|
837
|
+
* A base object for all visualizers. Use it to implement a custom visualizer.
|
|
774
838
|
*
|
|
775
|
-
*
|
|
776
|
-
* question - a survey question to visualize,
|
|
777
|
-
* data - an array of answers in format of survey result,
|
|
778
|
-
* options - object with the following options,
|
|
779
|
-
* name - visualizer name
|
|
839
|
+
* Constructor parameters:
|
|
780
840
|
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
784
|
-
*
|
|
785
|
-
*
|
|
841
|
+
* - `question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
|
|
842
|
+
* A survey question to visualize.
|
|
843
|
+
* - `data`: `Array<any>`\
|
|
844
|
+
* Survey results.
|
|
845
|
+
* - `options`\
|
|
846
|
+
* An object with the following properties:
|
|
847
|
+
* - `seriesValues`: `Array<String>`\
|
|
848
|
+
* Series values used to group data.
|
|
849
|
+
* - `seriesLabels`: `Array<String>`\
|
|
850
|
+
* Series labels to display. If this property is not set, `seriesValues` are used as labels.
|
|
851
|
+
* - `survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
|
|
852
|
+
* Pass a `SurveyModel` instance if you want to use locales from the survey JSON schema.
|
|
853
|
+
* - `dataProvider`: `DataProvider`\
|
|
854
|
+
* A data provider for this visualizer.
|
|
855
|
+
* - `name`: `String`\
|
|
856
|
+
* *(Optional)* The visualizer's name.
|
|
786
857
|
*
|
|
858
|
+
* [View Demo](https://surveyjs.io/dashboard/examples/how-to-plot-survey-data-in-custom-bar-chart/ (linkStyle))
|
|
787
859
|
*/
|
|
788
860
|
export class VisualizerBase implements IDataInfo {
|
|
789
861
|
question: Question;
|
|
790
862
|
options: {
|
|
791
863
|
[index: string]: any;
|
|
792
864
|
};
|
|
793
|
-
private
|
|
794
|
-
private
|
|
865
|
+
private _type?;
|
|
866
|
+
private _showToolbar;
|
|
795
867
|
private _footerVisualizer;
|
|
796
868
|
private _dataProvider;
|
|
797
869
|
labelTruncateLength: number;
|
|
@@ -803,14 +875,31 @@ declare module "visualizerBase" {
|
|
|
803
875
|
protected _supportSelection: boolean;
|
|
804
876
|
static otherCommentCollapsed: boolean;
|
|
805
877
|
/**
|
|
806
|
-
*
|
|
878
|
+
* An event that is raised after the visualizer's content is rendered.
|
|
879
|
+
*
|
|
880
|
+
* Parameters:
|
|
881
|
+
*
|
|
882
|
+
* - `sender`: `VisualizerBase`\
|
|
883
|
+
* A `VisualizerBase` instance that raised the event.
|
|
884
|
+
*
|
|
885
|
+
* - `options.htmlElement`: `HTMLElement`\
|
|
886
|
+
* A page element with the visualizer's content.
|
|
887
|
+
* @see render
|
|
888
|
+
* @see refresh
|
|
807
889
|
**/
|
|
808
890
|
onAfterRender: Event<(sender: VisualizerBase, options: any) => any, VisualizerBase, any>;
|
|
809
891
|
protected afterRender(contentContainer: HTMLElement): void;
|
|
810
892
|
/**
|
|
811
|
-
*
|
|
812
|
-
*
|
|
813
|
-
*
|
|
893
|
+
* An event that is raised after a new locale is set.
|
|
894
|
+
*
|
|
895
|
+
* Parameters:
|
|
896
|
+
*
|
|
897
|
+
* - `sender`: `VisualizerBase`\
|
|
898
|
+
* A `VisualizerBase` instance that raised the event.
|
|
899
|
+
*
|
|
900
|
+
* - `options.locale`: `String`\
|
|
901
|
+
* The indentifier of a new locale (for example, "en").
|
|
902
|
+
* @see locale
|
|
814
903
|
*/
|
|
815
904
|
onLocaleChanged: Event<(sender: VisualizerBase, options: {
|
|
816
905
|
locale: string;
|
|
@@ -822,63 +911,56 @@ declare module "visualizerBase" {
|
|
|
822
911
|
[index: string]: any;
|
|
823
912
|
}>, options?: {
|
|
824
913
|
[index: string]: any;
|
|
825
|
-
},
|
|
914
|
+
}, _type?: string);
|
|
826
915
|
protected get questionOptions(): any;
|
|
827
916
|
protected onDataChanged(): void;
|
|
917
|
+
get name(): string | Array<string>;
|
|
828
918
|
/**
|
|
829
|
-
*
|
|
830
|
-
|
|
831
|
-
get dataName(): string | Array<string>;
|
|
832
|
-
/**
|
|
833
|
-
* Indicates whether visualizer has header. Usually it is true then a question has correct answer.
|
|
919
|
+
* Indicates whether the visualizer displays a header. This property is `true` when a visualized question has a correct answer.
|
|
920
|
+
* @see hasFooter
|
|
834
921
|
*/
|
|
835
922
|
get hasHeader(): boolean;
|
|
836
923
|
/**
|
|
837
|
-
* Indicates whether visualizer
|
|
924
|
+
* Indicates whether the visualizer displays a footer. This property is `true` when a visualized question has a comment.
|
|
925
|
+
* @see hasHeader
|
|
838
926
|
*/
|
|
839
927
|
get hasFooter(): boolean;
|
|
840
928
|
protected createVisualizer<T = VisualizerBase>(question: Question): T;
|
|
841
929
|
/**
|
|
842
|
-
*
|
|
930
|
+
* Allows you to access the footer visualizer. Returns `undefined` if the footer is absent.
|
|
931
|
+
* @see hasFooter
|
|
843
932
|
*/
|
|
844
933
|
get footerVisualizer(): VisualizerBase;
|
|
845
934
|
/**
|
|
846
|
-
* Indicates whether
|
|
935
|
+
* Indicates whether users can select series points to cross-filter charts. To allow or disallow selection, set the `allowSelection` property of the `options` object in the constructor.
|
|
847
936
|
*/
|
|
848
937
|
get supportSelection(): boolean;
|
|
849
|
-
/**
|
|
850
|
-
* Series values getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
|
|
851
|
-
*/
|
|
852
938
|
getSeriesValues(): Array<string>;
|
|
853
|
-
/**
|
|
854
|
-
* Series labels getter. Some questions (used in matrices) should be grouped by matrix rows. This groups are called series.
|
|
855
|
-
*/
|
|
856
939
|
getSeriesLabels(): Array<string>;
|
|
857
|
-
/**
|
|
858
|
-
* Available values of question answers (available choices).
|
|
859
|
-
*/
|
|
860
940
|
getValues(): Array<any>;
|
|
861
|
-
/**
|
|
862
|
-
* Available labels of question answers (human readable representation of available choices).
|
|
863
|
-
*/
|
|
864
941
|
getLabels(): Array<string>;
|
|
865
942
|
/**
|
|
866
|
-
* Registers
|
|
943
|
+
* Registers a function used to create a toolbar item for this visualizer.
|
|
944
|
+
* @param name A custom name for the toolbar item.
|
|
945
|
+
* @param creator A function that accepts the toolbar and should return an `HTMLElement` with the toolbar item.
|
|
867
946
|
*/
|
|
868
947
|
registerToolbarItem(name: string, creator: (toolbar?: HTMLDivElement) => HTMLElement): void;
|
|
869
948
|
/**
|
|
870
|
-
*
|
|
949
|
+
* Returns the visualizer's name.
|
|
871
950
|
*/
|
|
872
|
-
get
|
|
951
|
+
get type(): string;
|
|
873
952
|
/**
|
|
874
|
-
*
|
|
953
|
+
* Returns an array of survey results used to calculate values for visualization. If a user applies a filter, the array is also filtered.
|
|
954
|
+
*
|
|
955
|
+
* To get an array of calculated and visualized values, call the [`getData()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#getData) method.
|
|
875
956
|
*/
|
|
876
957
|
protected get data(): {
|
|
877
958
|
[index: string]: any;
|
|
878
959
|
}[];
|
|
879
960
|
protected get dataProvider(): DataProvider;
|
|
880
961
|
/**
|
|
881
|
-
* Updates
|
|
962
|
+
* Updates visualized data.
|
|
963
|
+
* @param data A data array with survey results to be visualized.
|
|
882
964
|
*/
|
|
883
965
|
updateData(data: Array<{
|
|
884
966
|
[index: string]: any;
|
|
@@ -886,11 +968,14 @@ declare module "visualizerBase" {
|
|
|
886
968
|
onUpdate: () => void;
|
|
887
969
|
invokeOnUpdate(): void;
|
|
888
970
|
/**
|
|
889
|
-
*
|
|
971
|
+
* Deletes the visualizer and all its elements from the DOM.
|
|
972
|
+
* @see clear
|
|
890
973
|
*/
|
|
891
974
|
destroy(): void;
|
|
892
975
|
/**
|
|
893
|
-
*
|
|
976
|
+
* Empties the toolbar, header, footer, and content containers.
|
|
977
|
+
*
|
|
978
|
+
* If you want to empty and delete the visualizer and all its elements from the DOM, call the [`destroy()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#destroy) method instead.
|
|
894
979
|
*/
|
|
895
980
|
clear(): void;
|
|
896
981
|
protected createToolbarItems(toolbar: HTMLDivElement): void;
|
|
@@ -904,11 +989,12 @@ declare module "visualizerBase" {
|
|
|
904
989
|
protected destroyFooter(container: HTMLElement): void;
|
|
905
990
|
protected renderFooter(container: HTMLElement): void;
|
|
906
991
|
/**
|
|
907
|
-
* Renders visualizer in
|
|
992
|
+
* Renders the visualizer in a specified container.
|
|
993
|
+
* @param targetElement An `HTMLElement` or an `id` of a page element in which you want to render the visualizer.
|
|
908
994
|
*/
|
|
909
995
|
render(targetElement: HTMLElement | string): void;
|
|
910
996
|
/**
|
|
911
|
-
*
|
|
997
|
+
* Re-renders the visualizer and its content.
|
|
912
998
|
*/
|
|
913
999
|
refresh(): void;
|
|
914
1000
|
protected processText(text: string): string;
|
|
@@ -922,36 +1008,41 @@ declare module "visualizerBase" {
|
|
|
922
1008
|
private static colors;
|
|
923
1009
|
getColors(count?: number): any;
|
|
924
1010
|
/**
|
|
925
|
-
*
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Sets whether the visualizer renders it header.
|
|
1011
|
+
* Gets or sets the visibility of the visualizer's toolbar.
|
|
1012
|
+
*
|
|
1013
|
+
* Default value: `true`
|
|
930
1014
|
*/
|
|
931
|
-
|
|
1015
|
+
get showToolbar(): boolean;
|
|
1016
|
+
set showToolbar(newValue: boolean);
|
|
932
1017
|
/**
|
|
933
|
-
* Returns
|
|
1018
|
+
* Returns an array of calculated and visualized values. If a user applies a filter, the array is also filtered.
|
|
1019
|
+
*
|
|
1020
|
+
* To get an array of source survey results, use the [`data`](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase#data) property.
|
|
934
1021
|
*/
|
|
935
1022
|
getData(): any;
|
|
936
1023
|
/**
|
|
937
|
-
* Returns visualizer state
|
|
938
|
-
*
|
|
1024
|
+
* Returns an object with properties that describe a current visualizer state. The properties are different for each individual visualizer.
|
|
1025
|
+
*
|
|
1026
|
+
* > This method is overriden in descendant classes.
|
|
1027
|
+
* @see setState
|
|
939
1028
|
*/
|
|
940
1029
|
getState(): any;
|
|
941
1030
|
/**
|
|
942
|
-
* Sets visualizer state
|
|
943
|
-
*
|
|
1031
|
+
* Sets the visualizer's state.
|
|
1032
|
+
*
|
|
1033
|
+
* > This method is overriden in descendant classes.
|
|
1034
|
+
* @see getState
|
|
944
1035
|
*/
|
|
945
1036
|
setState(state: any): void;
|
|
946
1037
|
/**
|
|
947
|
-
*
|
|
948
|
-
*
|
|
949
|
-
*
|
|
1038
|
+
* Gets or sets the current locale.
|
|
1039
|
+
*
|
|
1040
|
+
* If you want to inherit the locale from a visualized survey, assign a `SurveyModel` instance to the `survey` property of the `options` object in the constructor.
|
|
1041
|
+
*
|
|
1042
|
+
* If the survey is [translated into more than one language](https://surveyjs.io/form-library/examples/survey-localization/), the toolbar displays a language selection drop-down menu.
|
|
1043
|
+
* @see onLocaleChanged
|
|
950
1044
|
*/
|
|
951
1045
|
get locale(): string;
|
|
952
|
-
/**
|
|
953
|
-
* Sets locale for visualization panel.
|
|
954
|
-
*/
|
|
955
1046
|
set locale(newLocale: string);
|
|
956
1047
|
protected setLocale(newLocale: string): void;
|
|
957
1048
|
}
|
|
@@ -1205,7 +1296,7 @@ declare module "alternativeVizualizersWrapper" {
|
|
|
1205
1296
|
* quiet - set it to true if you don't want to rise a notification event
|
|
1206
1297
|
*
|
|
1207
1298
|
**/
|
|
1208
|
-
setVisualizer(
|
|
1299
|
+
setVisualizer(type: string, quiet?: boolean): void;
|
|
1209
1300
|
updateData(data: Array<{
|
|
1210
1301
|
[index: string]: any;
|
|
1211
1302
|
}>): void;
|
|
@@ -1218,12 +1309,31 @@ declare module "alternativeVizualizersWrapper" {
|
|
|
1218
1309
|
}
|
|
1219
1310
|
}
|
|
1220
1311
|
declare module "config" {
|
|
1312
|
+
/**
|
|
1313
|
+
* An interface that describes a visualization item (chart, gauge, etc.).
|
|
1314
|
+
*
|
|
1315
|
+
* To access `IVisualizerPanelElement` objects, you can use the following properties and methods of `VisualizationPanel`:
|
|
1316
|
+
*
|
|
1317
|
+
* - [`getElements()`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel#getElements)
|
|
1318
|
+
* - [`visibleElements`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel#visibleElements)
|
|
1319
|
+
* - [`hiddenElements`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel#hiddenElements)
|
|
1320
|
+
*/
|
|
1221
1321
|
export interface IVisualizerPanelElement {
|
|
1322
|
+
/**
|
|
1323
|
+
* The name of a survey question visualized by this item.
|
|
1324
|
+
*/
|
|
1222
1325
|
name: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* The title of a survey question visualized by this item. The visualization item displays the same title.
|
|
1328
|
+
*/
|
|
1223
1329
|
displayName: string;
|
|
1330
|
+
/**
|
|
1331
|
+
* Indicates whether the visualization item is currently visible.
|
|
1332
|
+
*
|
|
1333
|
+
* If you want to disallow users to hide visualization items, set the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property to `false`.
|
|
1334
|
+
*/
|
|
1224
1335
|
isVisible: boolean;
|
|
1225
1336
|
isPublic: boolean;
|
|
1226
|
-
type?: string;
|
|
1227
1337
|
chartType?: string;
|
|
1228
1338
|
answersOrder?: string;
|
|
1229
1339
|
hideEmptyAnswers?: boolean;
|
|
@@ -1253,8 +1363,7 @@ declare module "filterInfo" {
|
|
|
1253
1363
|
}
|
|
1254
1364
|
declare module "layoutEngine" {
|
|
1255
1365
|
/**
|
|
1256
|
-
*
|
|
1257
|
-
* You can create a descendant of this class in order to override layout.
|
|
1366
|
+
* A base class used to implement custom layout engines or integrate third-party layout engines with SurveyJS Dashboard.
|
|
1258
1367
|
*/
|
|
1259
1368
|
export class LayoutEngine {
|
|
1260
1369
|
protected _allowed: boolean;
|
|
@@ -1264,15 +1373,17 @@ declare module "layoutEngine" {
|
|
|
1264
1373
|
protected updateCore(): void;
|
|
1265
1374
|
get allowed(): boolean;
|
|
1266
1375
|
/**
|
|
1267
|
-
*
|
|
1376
|
+
* Enables the dynamic layout in a given HTML element.
|
|
1377
|
+
*
|
|
1378
|
+
* This method should arrange visualization items based on the available screen space and allow users to reorder them via drag and drop.
|
|
1268
1379
|
*/
|
|
1269
1380
|
start(container: HTMLElement): void;
|
|
1270
1381
|
/**
|
|
1271
|
-
*
|
|
1382
|
+
* Disables the dynamic layout.
|
|
1272
1383
|
*/
|
|
1273
1384
|
stop(): void;
|
|
1274
1385
|
/**
|
|
1275
|
-
* Updates
|
|
1386
|
+
* Updates the dynamic layout.
|
|
1276
1387
|
*/
|
|
1277
1388
|
update(): void;
|
|
1278
1389
|
add(elements: Array<HTMLElement>, options?: any): void;
|
|
@@ -1303,10 +1414,16 @@ declare module "visualizationPanel" {
|
|
|
1303
1414
|
renderedElement?: HTMLElement;
|
|
1304
1415
|
}
|
|
1305
1416
|
/**
|
|
1306
|
-
* Visualization Panel configuration. Pass it as the third argument to the `VisualizationPanel` constructor:
|
|
1417
|
+
* Visualization Panel configuration. Pass it as the third argument to the [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel) constructor:
|
|
1307
1418
|
*
|
|
1308
1419
|
* ```js
|
|
1309
|
-
*
|
|
1420
|
+
* import { VisualizationPanel } from "survey-analytics";
|
|
1421
|
+
*
|
|
1422
|
+
* const vizPanel = new VisualizationPanel(
|
|
1423
|
+
* surveyQuestions,
|
|
1424
|
+
* surveyResults,
|
|
1425
|
+
* vizPanelOptions
|
|
1426
|
+
* );
|
|
1310
1427
|
* ```
|
|
1311
1428
|
*/
|
|
1312
1429
|
export interface IVisualizationPanelOptions {
|
|
@@ -1516,14 +1633,18 @@ declare module "visualizationPanel" {
|
|
|
1516
1633
|
stripHtmlFromTitles?: boolean;
|
|
1517
1634
|
}
|
|
1518
1635
|
/**
|
|
1519
|
-
*
|
|
1520
|
-
*
|
|
1521
|
-
*
|
|
1522
|
-
* <br/> questions - an array of survey questions to visualize,
|
|
1523
|
-
* <br/> data - an array of answers in format of survey result,
|
|
1524
|
-
* <br/> options - object of the IVisualizationPanelOptions type, @see IVisualizationPanelOptions
|
|
1525
|
-
* <br/> elements - list of visual element descriptions
|
|
1636
|
+
* An object that visualizes survey results and allows users to analyze them.
|
|
1637
|
+
*
|
|
1638
|
+
* Constructor parameters:
|
|
1526
1639
|
*
|
|
1640
|
+
* - `questions`: Array\<[`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\>\
|
|
1641
|
+
* Survey questions to visualize. Call `SurveyModel`'s [`getAllQuestions()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#getQuestionByName) method to access all survey questions and pass its result as the `questions` parameter.
|
|
1642
|
+
* - `data`: `Array<any>`\
|
|
1643
|
+
* Survey results.
|
|
1644
|
+
* - `options`: [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions)\
|
|
1645
|
+
* Visualization Panel configuration.
|
|
1646
|
+
*
|
|
1647
|
+
* [View Demo](https://surveyjs.io/dashboard/examples/interactive-survey-data-dashboard/ (linkStyle))
|
|
1527
1648
|
*/
|
|
1528
1649
|
export class VisualizationPanel extends VisualizerBase {
|
|
1529
1650
|
protected questions: Array<any>;
|
|
@@ -1560,43 +1681,43 @@ declare module "visualizationPanel" {
|
|
|
1560
1681
|
private destroyVisualizers;
|
|
1561
1682
|
protected setLocale(newLocale: string): void;
|
|
1562
1683
|
/**
|
|
1563
|
-
* Returns
|
|
1684
|
+
* Returns the [`allowDynamicLayout`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowDynamicLayout) property value of the [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions) object.
|
|
1564
1685
|
*/
|
|
1565
1686
|
get allowDynamicLayout(): boolean;
|
|
1566
1687
|
/**
|
|
1567
|
-
* Returns
|
|
1688
|
+
* Returns the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property value of the [`IVisualizationPanelOptions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions) object.
|
|
1568
1689
|
*/
|
|
1569
1690
|
get allowHideQuestions(): boolean;
|
|
1570
|
-
/**
|
|
1571
|
-
* Returns whether the VisualizationPanel allows to make private/public individual inner visualizers for work with permissions.
|
|
1572
|
-
*/
|
|
1573
1691
|
get allowMakeQuestionsPrivate(): boolean;
|
|
1574
1692
|
private _layoutEngine;
|
|
1575
1693
|
/**
|
|
1576
|
-
* Returns
|
|
1694
|
+
* Returns a [`LayoutEngine`](https://surveyjs.io/dashboard/documentation/api-reference/layoutengine) instance used to arrange visualization items on `VisualizationPanel`.
|
|
1577
1695
|
*/
|
|
1578
1696
|
get layoutEngine(): LayoutEngine;
|
|
1579
1697
|
protected buildElements(questions: any[]): IVisualizerPanelElement[];
|
|
1580
1698
|
/**
|
|
1581
|
-
* Returns
|
|
1582
|
-
*
|
|
1699
|
+
* Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about visualization items.
|
|
1700
|
+
* @see visibleElements
|
|
1701
|
+
* @see hiddenElements
|
|
1583
1702
|
*/
|
|
1584
1703
|
getElements(): IVisualizerPanelElement[];
|
|
1585
1704
|
/**
|
|
1586
|
-
* Returns
|
|
1705
|
+
* Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about currently visible visualization items.
|
|
1706
|
+
*
|
|
1707
|
+
* If you want to disallow users to hide visualization items, set the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property to `false`.
|
|
1708
|
+
* @see hiddenElements
|
|
1709
|
+
* @see getElements
|
|
1587
1710
|
*/
|
|
1588
1711
|
get visibleElements(): IVisualizerPanelRenderedElement[];
|
|
1589
1712
|
/**
|
|
1590
|
-
* Returns
|
|
1713
|
+
* Returns an array of [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement) objects with information about currently hidden visualization items.
|
|
1714
|
+
*
|
|
1715
|
+
* If you want to disallow users to hide visualization items, set the [`allowHideQuestions`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions) property to `false`.
|
|
1716
|
+
* @see visibleElements
|
|
1717
|
+
* @see getElements
|
|
1591
1718
|
*/
|
|
1592
1719
|
get hiddenElements(): IVisualizerPanelRenderedElement[];
|
|
1593
|
-
/**
|
|
1594
|
-
* Returns panel's public elements.
|
|
1595
|
-
*/
|
|
1596
1720
|
get publicElements(): IVisualizerPanelRenderedElement[];
|
|
1597
|
-
/**
|
|
1598
|
-
* Returns panel's private elements.
|
|
1599
|
-
*/
|
|
1600
1721
|
get privateElements(): IVisualizerPanelRenderedElement[];
|
|
1601
1722
|
protected get locales(): any;
|
|
1602
1723
|
/**
|
|
@@ -1604,63 +1725,53 @@ declare module "visualizationPanel" {
|
|
|
1604
1725
|
*/
|
|
1605
1726
|
getElement(name: string): IVisualizerPanelRenderedElement;
|
|
1606
1727
|
/**
|
|
1607
|
-
* Returns
|
|
1728
|
+
* Returns a [visualizer](https://surveyjs.io/dashboard/documentation/api-reference/visualizerbase) that visualizes a specified survey question.
|
|
1729
|
+
* @param questionName A question [name](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
|
1608
1730
|
*/
|
|
1609
|
-
getVisualizer(
|
|
1731
|
+
getVisualizer(questionName: string): VisualizerBase;
|
|
1610
1732
|
/**
|
|
1611
|
-
*
|
|
1612
|
-
*
|
|
1613
|
-
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1733
|
+
* An event that is raised when users [move a visualization item](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowDynamicLayout) or [toggle its visibility](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizationpaneloptions#allowHideQuestions).
|
|
1734
|
+
*
|
|
1735
|
+
* Parameters:
|
|
1736
|
+
*
|
|
1737
|
+
* - `sender`: [`VisualizationPanel`](https://surveyjs.io/dashboard/documentation/api-reference/visualizationpanel)\
|
|
1738
|
+
* A `VisualizationPanel` that raised the event.
|
|
1739
|
+
*
|
|
1740
|
+
* - `options.elements`: Array\<[`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement)\>\
|
|
1741
|
+
* Information about visualization items rendered by this `VisualizationPanel`.
|
|
1742
|
+
*
|
|
1743
|
+
* - `options.changed`: [`IVisualizerPanelElement`](https://surveyjs.io/dashboard/documentation/api-reference/ivisualizerpanelelement)\
|
|
1744
|
+
* A visualization item that has been changed.
|
|
1745
|
+
*
|
|
1746
|
+
* - `options.reason`: `"ADDED"` | `"REMOVED"` | `"MOVED"`\
|
|
1747
|
+
* Indicates the reason why the event has been raised.
|
|
1616
1748
|
*/
|
|
1617
1749
|
onVisibleElementsChanged: Event<(sender: VisualizationPanel, options: any) => any, VisualizationPanel, any>;
|
|
1618
1750
|
protected visibleElementsChanged(element: IVisualizerPanelElement, reason: string): void;
|
|
1619
|
-
/**
|
|
1620
|
-
* Fires when vizualization panel state changed.
|
|
1621
|
-
* sender - this panel
|
|
1622
|
-
* state - new state of the panel
|
|
1623
|
-
*/
|
|
1624
1751
|
onStateChanged: Event<(sender: VisualizationPanel, state: IState) => any, VisualizationPanel, any>;
|
|
1625
|
-
/**
|
|
1626
|
-
* Fires when permissions changed
|
|
1627
|
-
*/
|
|
1628
1752
|
onPermissionsChangedCallback: any;
|
|
1629
1753
|
protected renderPanelElement(element: IVisualizerPanelRenderedElement, container: HTMLElement): HTMLElement;
|
|
1630
1754
|
protected renderToolbar(container: HTMLElement): void;
|
|
1631
|
-
/**
|
|
1632
|
-
* Renders all questions into given HTML container element.
|
|
1633
|
-
* container - HTML element to render the panel
|
|
1634
|
-
*/
|
|
1635
1755
|
renderContent(container: HTMLElement): void;
|
|
1636
1756
|
protected destroyContent(container: HTMLElement): void;
|
|
1637
1757
|
/**
|
|
1638
|
-
* Redraws
|
|
1758
|
+
* Redraws the `VisualizationPanel` and all its content.
|
|
1639
1759
|
*/
|
|
1640
1760
|
refresh(): void;
|
|
1641
|
-
/**
|
|
1642
|
-
* Updates layout of visualizer inner content.
|
|
1643
|
-
*/
|
|
1644
1761
|
layout(): void;
|
|
1645
1762
|
/**
|
|
1646
|
-
*
|
|
1763
|
+
* Filters visualized data based on a specified question name and value. This method is called when a user clicks a chart point.
|
|
1764
|
+
* @param questionName A question [name](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
|
1765
|
+
* @param selectedValue
|
|
1766
|
+
* @see IVisualizationPanelOptions.allowSelection
|
|
1647
1767
|
*/
|
|
1648
1768
|
setFilter(questionName: string, selectedValue: any): void;
|
|
1649
|
-
/**
|
|
1650
|
-
* Gets vizualization panel state.
|
|
1651
|
-
*/
|
|
1652
1769
|
get state(): IState;
|
|
1653
1770
|
/**
|
|
1654
1771
|
* Sets vizualization panel state.
|
|
1655
1772
|
*/
|
|
1656
1773
|
set state(newState: IState);
|
|
1657
|
-
/**
|
|
1658
|
-
* Gets vizualization panel permissions.
|
|
1659
|
-
*/
|
|
1660
1774
|
get permissions(): IPermission[];
|
|
1661
|
-
/**
|
|
1662
|
-
* Sets vizualization panel permissions.
|
|
1663
|
-
*/
|
|
1664
1775
|
set permissions(permissions: IPermission[]);
|
|
1665
1776
|
destroy(): void;
|
|
1666
1777
|
}
|
|
@@ -1678,7 +1789,7 @@ declare module "visualizationPanelDynamic" {
|
|
|
1678
1789
|
}, name?: string);
|
|
1679
1790
|
protected setLocale(newLocale: string): void;
|
|
1680
1791
|
private onAfterRenderPanelCallback;
|
|
1681
|
-
get
|
|
1792
|
+
get type(): string;
|
|
1682
1793
|
private updatePanelVisualizerData;
|
|
1683
1794
|
updateData(data: Array<{
|
|
1684
1795
|
[index: string]: any;
|
|
@@ -1697,7 +1808,7 @@ declare module "visualizationMatrixDynamic" {
|
|
|
1697
1808
|
constructor(question: Question, data: Array<{
|
|
1698
1809
|
[index: string]: any;
|
|
1699
1810
|
}>, options?: Object);
|
|
1700
|
-
get
|
|
1811
|
+
get type(): string;
|
|
1701
1812
|
getQuestions(): Question[];
|
|
1702
1813
|
}
|
|
1703
1814
|
}
|
|
@@ -1831,7 +1942,7 @@ declare module "matrixDropdownGrouped" {
|
|
|
1831
1942
|
[index: string]: any;
|
|
1832
1943
|
}>, options?: Object, name?: string);
|
|
1833
1944
|
protected get matrixQuestion(): QuestionMatrixDropdownModel;
|
|
1834
|
-
get
|
|
1945
|
+
get name(): string | Array<string>;
|
|
1835
1946
|
getSeriesValues(): Array<string>;
|
|
1836
1947
|
getSeriesLabels(): Array<string>;
|
|
1837
1948
|
valuesSource(): Array<ItemValue>;
|
|
@@ -1988,6 +2099,7 @@ declare module "entries/summary" {
|
|
|
1988
2099
|
export * from "localizationManager";
|
|
1989
2100
|
import "analytics-localization/farsi";
|
|
1990
2101
|
import "analytics-localization/french";
|
|
2102
|
+
import "analytics-localization/german";
|
|
1991
2103
|
import "analytics-localization/norwegian";
|
|
1992
2104
|
import "analytics-localization/portuguese";
|
|
1993
2105
|
import "analytics-localization/russian";
|