12
12
/**
13
13
* Modebar buttons configuration
14
14
*
15
+ * @param {string } category button category depending on e.g. plot type
16
+ * @param {string } group button group ('ext', 'drag', 'zoom', 'hover')
15
17
* @param {string } title text that appears while hovering over the button
16
18
* @param {string } icon name of the svg icon associated with the button
17
19
* @param {string } [gravity] icon positioning
@@ -28,53 +30,69 @@ module.exports = {
28
30
29
31
// for all plot types
30
32
toImage : {
33
+ category : 'all' ,
34
+ group : 'ext' ,
31
35
title : 'download plot as a png' ,
32
36
icon : 'camera' ,
33
37
click : 'toImage'
34
38
} ,
35
39
sendDataToCloud : {
40
+ category : 'all' ,
41
+ group : 'ext' ,
36
42
title : 'save and edit plot in cloud' ,
37
43
icon : 'disk' ,
38
44
click : 'sendDataToCloud'
39
45
} ,
40
<
8000
/td>46
41
47
// cartesian and gl2d
42
48
zoom2d : {
49
+ category : '2d' ,
50
+ group : 'drag' ,
43
51
title : 'Zoom' ,
44
52
attr : 'dragmode' ,
45
53
val : 'zoom' ,
46
54
icon : 'zoombox' ,
47
55
click : 'handleCartesian'
48
56
} ,
49
57
pan2d : {
58
+ category : '2d' ,
59
+ group : 'drag' ,
50
60
title : 'Pan' ,
51
61
attr : 'dragmode' ,
52
62
val : 'pan' ,
53
63
icon : 'pan' ,
54
64
click : 'handleCartesian'
55
65
} ,
56
66
zoomIn2d : {
67
+ category : '2d' ,
68
+ group : 'zoom' ,
57
69
title : 'Zoom in' ,
58
70
attr : 'zoom' ,
59
71
val : 'in' ,
60
72
icon : 'zoom_plus' ,
61
73
click : 'handleCartesian'
62
74
} ,
63
75
zoomOut2d : {
76
+ category : '2d' ,
77
+ group : 'zoom' ,
64
78
title : 'Zoom out' ,
65
79
attr : 'zoom' ,
66
80
val : 'out' ,
67
81
icon : 'zoom_minus' ,
68
82
click : 'handleCartesian'
69
83
} ,
70
84
autoScale2d : {
85
+ category : '2d' ,
86
+ group : 'zoom' ,
71
87
title : 'Autoscale' ,
72
88
attr : 'zoom' ,
73
89
val : 'auto' ,
74
90
icon : 'autoscale' ,
75
91
click : 'handleCartesian'
76
92
} ,
77
93
resetScale2d : {
94
+ category : '2d' ,
95
+ group : 'zoom' ,
78
96
title : 'Reset axes' ,
79
97
attr : 'zoom' ,
80
98
val : 'reset' ,
@@ -84,6 +102,8 @@ module.exports = {
84
102
85
103
// cartesian only
86
104
hoverClosest2d : {
105
+ category : 'cartesian' ,
106
+ group : 'hover' ,
87
107
title : 'Show closest data on hover' ,
88
108
attr : 'hovermode' ,
89
109
val : 'closest' ,
@@ -92,6 +112,8 @@ module.exports = {
92
112
click : 'handleCartesian'
93
113
} ,
94
114
hoverCompare2d : {
115
+ category : 'cartesian' ,
116
+ group : 'hover' ,
95
117
title : 'Compare data on hover' ,
96
118
attr : 'hovermode' ,
97
119
val : function ( graphInfo ) {
@@ -104,46 +126,60 @@ module.exports = {
104
126
105
127
// gl3d
106
128
zoom3d : {
129
+ category : 'gl3d' ,
130
+ group : 'drag' ,
107
131
title : 'Zoom' ,
108
132
attr : 'dragmode' ,
109
133
val : 'zoom' ,
110
134
icon : 'zoombox' ,
111
135
click : 'handleDrag3d'
112
136
} ,
113
137
pan3d : {
138
+ category : 'gl3d' ,
139
+ group : 'drag' ,
114
140
title : 'Pan' ,
115
141
attr : 'dragmode' ,
116
142
val : 'pan' ,
117
143
icon : 'pan' ,
118
144
click : 'handleDrag3d'
119
145
} ,
120
146
orbitRotation : {
147
+ category : 'gl3d' ,
148
+ group : 'drag' ,
121
149
title : 'orbital rotation' ,
122
150
attr : 'dragmode' ,
123
151
val : 'orbit' ,
124
152
icon : '3d_rotate' ,
125
153
click : 'handleDrag3d'
126
154
} ,
127
155
tableRotation : {
156
+ category : 'gl3d' ,
157
+ group : 'drag' ,
128
158
title : 'turntable rotation' ,
129
159
attr : 'dragmode' ,
130
160
val : 'turntable' ,
131
161
icon : 'z-axis' ,
132
162
click : 'handleDrag3d'
133
163
} ,
134
164
resetCameraDefault3d : {
165
+ category : 'gl3d' ,
166
+ group : 'zoom' ,
135
167
title : 'Reset camera to default' ,
136
168
attr : 'resetDefault' ,
137
169
icon : 'home' ,
138
170
click : 'handleCamera3d'
139
171
} ,
140
172
resetCameraLastSave3d : {
173
+ category : 'gl3d' ,
174
+ group : 'zoom' ,
141
175
title : 'Reset camera to last save' ,
142
176
attr : 'resetLastSave' ,
143
177
icon : 'movie' ,
144
178
click : 'handleCamera3d'
145
179
} ,
146
180
hoverClosest3d : {
181
+ category : 'gl3d' ,
182
+ group : 'hover' ,
147
183
title : 'Toggle show closest data on hover' ,
148
184
attr : 'hovermode' ,
149
185
val : null ,
@@ -155,27 +191,35 @@ module.exports = {
155
191
156
192
// geo
157
193
zoomInGeo : {
194
+ category : 'geo' ,
195
+ group : 'zoom' ,
158
196
title : 'Zoom in' ,
159
197
attr : 'zoom' ,
160
198
val : 'in' ,
161
199
icon : 'zoom_plus' ,
162
200
click : 'handleGeo'
163
201
} ,
164
202
zoomOutGeo : {
203
+ category : 'geo' ,
204
+ group : 'zoom' ,
165
205
title : 'Zoom out' ,
166
206
attr : 'zoom' ,
167
207
val : 'out' ,
168
208
icon : 'zoom_minus' ,
169
209
click : 'handleGeo'
170
210
} ,
171
211
resetGeo : {
212
+ category : 'geo' ,
213
+ group : 'zoom' ,
172
214
title : 'Reset' ,
173
215
attr : 'reset' ,
174
216
val : null ,
175
217
icon : 'autoscale' ,
176
218
click : 'handleGeo'
177
219
} ,
178
220
hoverClosestGeo : {
221
+ category : 'geo' ,
222
+ group : 'hover' ,
179
223
title : 'Toggle show closest data on hover' ,
180
224
attr : 'hovermode' ,
181
225
val : null ,
@@ -187,6 +231,8 @@ module.exports = {
187
231
188
232
// gl2d only
189
233
hoverClosestGl2d : {
234
+ category : 'gl2d' ,
235
+ group : 'hover' ,
190
236
title : 'Toggle show closest data on hover' ,
191
237
attr : 'hovermode' ,
192
238
val : null ,
@@ -198,6 +244,8 @@ module.exports = {
198
244
199
245
// pie traces only
200
246
hoverClosestPie : {
247
+ category : 'pie' ,
248
+ group : 'hover' ,
201
249
title : 'Toggle show closest data on hover' ,
202
250
attr : 'hovermode' ,
203
251
val : 'closest' ,
0 commit comments