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