1
+ define ( [
2
+ ] , function ( ) {
3
+ /**
4
+ * name
5
+ * library
6
+ * description
7
+ * code
8
+ * options: [
9
+ * {
10
+ * name
11
+ * label
12
+ * [optional]
13
+ * component :
14
+ * - 1darr / 2darr / ndarr / scalar / param / dtype / tabblock
15
+ * default
16
+ * required
17
+ * usePair
18
+ * code
19
+ * }
20
+ * ]
21
+ */
22
+ var CHART_LIBRARIES = {
23
+ /** Relational plots */
24
+ 'scatterplot' : {
25
+ name : 'Scatter Plot' ,
26
+ code : '${allocateTo} = sns.scatterplot(${data}${x}${y}${hue}${etc})' ,
27
+ description : 'Draw a scatter plot with possibility of several semantic groupings.' ,
28
+ options : [
29
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
30
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
31
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
32
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
33
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
34
+ ]
35
+ } ,
36
+ 'lineplot' : {
37
+ name : 'Line Plot' ,
38
+ code : '${allocateTo} = sns.lineplot(${data}${x}${y}${hue}${etc})' ,
39
+ description : 'Draw a line plot with possibility of several semantic groupings.' ,
40
+ options : [
41
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
42
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
43
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
44
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
45
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
46
+ ]
47
+ } ,
48
+ /** Distribution plots */
49
+ 'histplot' : {
50
+ name : 'Histogram Plot' ,
51
+ code : '${allocateTo} = sns.histplot(${data}${x}${y}${hue}${etc})' ,
52
+ description : 'Plot univariate or bivariate histograms to show distributions of datasets.' ,
53
+ options : [
54
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
55
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
56
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
57
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
58
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
59
+ ]
60
+ } ,
61
+ 'kdeplot' : {
62
+ name : 'Kernel Density Plot' ,
63
+ code : '${allocateTo} = sns.kdeplot(${data}${x}${y}${hue}${etc})' ,
64
+ description : 'Plot univariate or bivariate distributions using kernel density estimation.' ,
65
+ options : [
66
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
67
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
68
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
69
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
70
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
71
+ ]
72
+ } ,
73
+ 'ecdfplot' : {
74
+ name : 'Empirical Cumulative Distribution Plot' ,
75
+ code : '${allocateTo} = sns.ecdfplot(${data}${x}${y}${hue}${etc})' ,
76
+ description : 'Plot empirical cumulative distribution functions.' ,
77
+ options : [
78
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
79
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
80
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
81
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
82
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
83
+ ]
84
+ } ,
85
+ 'rugplot' : {
86
+ name : 'Rug Plot' ,
87
+ code : '${allocateTo} = sns.rugplot(${data}${x}${y}${hue}${etc})' ,
88
+ description : 'Plot marginal distributions by drawing ticks along the x and y axes.' ,
89
+ options : [
90
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
91
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
92
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
93
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
94
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
95
+ ]
96
+ } ,
97
+ /** Categorical plots */
98
+ 'stripplot' : {
99
+ name : 'Strip Plot' ,
100
+ code : '${allocateTo} = sns.stripplot(${data}${x}${y}${hue}${etc})' ,
101
+ description : 'Draw a scatterplot where one variable is categorical.' ,
102
+ options : [
103
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
104
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
105
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
106
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
107
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
108
+ ]
109
+ } ,
110
+ 'swarmplot' : {
111
+ name : 'Swarm Plot' ,
112
+ code : '${allocateTo} = sns.swarmplot(${data}${x}${y}${hue}${etc})' ,
113
+ description : 'Draw a categorical scatterplot with non-overlapping points.' ,
114
+ options : [
115
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
116
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
117
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
118
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
119
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
120
+ ]
121
+ } ,
122
+ 'boxplot' : {
123
+ name : 'Box Plot' ,
124
+ code : '${allocateTo} = sns.boxplot(${data}${x}${y}${hue}${etc})' ,
125
+ description : 'Draw a box plot to show distributions with respect to categories.' ,
126
+ options : [
127
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
128
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
129
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
130
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
131
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
132
+ ]
133
+ } ,
134
+ 'violinplot' : {
135
+ name : 'Violin Plot' ,
136
+ code : '${allocateTo} = sns.violinplot(${data}${x}${y}${hue}${etc})' ,
137
+ description : 'Draw a combination of boxplot and kernel density estimate.' ,
138
+ options : [
139
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
140
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
141
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
142
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
143
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
144
+ ]
145
+ } ,
146
+ 'pointplot' : {
147
+ name : 'Point Plot' ,
148
+ code : '${allocateTo} = sns.pointplot(${data}${x}${y}${hue}${etc})' ,
149
+ description : 'Show point estimates and confidence intervals using scatter plot glyphs.' ,
150
+ options : [
151
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
152
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
153
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
154
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
155
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
156
+ ]
157
+ } ,
158
+ 'barplot' : {
159
+ name : 'Bar Plot' ,
160
+ code : '${allocateTo} = sns.barplot(${data}${x}${y}${hue}${etc})' ,
161
+ description : 'Show point estimates and confidence intervals as rectangular bars.' ,
162
+ options : [
163
+ { name : 'data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'list' ] , usePair : true } ,
164
+ { name : 'x' , component : [ 'col_select' ] , usePair : true } ,
165
+ { name : 'y' , component : [ 'col_select' ] , usePair : true } ,
166
+ { name : 'hue' , component : [ 'col_select' ] , usePair : true } ,
167
+ { name : 'allocateTo' , label : 'Allocate To' , component : [ 'input' ] , usePair : true }
168
+ ]
169
+ } ,
170
+ }
171
+
172
+ return CHART_LIBRARIES ;
173
+ } ) ;
0 commit comments