12
12
var Plotly = require ( '../../plotly' ) ;
13
13
var Lib = require ( '../../lib' ) ;
14
14
var Snapshot = require ( '../../snapshot' ) ;
15
+ var Icons = require ( '../../../build/ploticon' ) ;
15
16
16
17
17
18
var modebarButtons = module . exports = { } ;
@@ -24,7 +25,7 @@ var modebarButtons = module.exports = {};
24
25
* @param {string } title
25
26
* text that appears while hovering over the button
26
27
* @param {string } icon
27
- * name of the svg icon associated with the button
28
+ * svg icon associated with the button
28
29
* @param {string } [gravity]
29
30
* icon positioning
30
31
* @param {function } click
@@ -43,7 +44,7 @@ var modebarButtons = module.exports = {};
43
44
modebarButtons . toImage = {
44
45
name : 'toImage' ,
45
46
title : 'Download plot as a png' ,
46
- icon : ' camera' ,
47
+ icon : Icons . camera ,
47
48
click : function ( gd ) {
48
49
var format = 'png' ;
49
50
@@ -95,7 +96,7 @@ modebarButtons.toImage = {
95
96
modebarButtons . sendDataToCloud = {
96
97
name : 'sendDataToCloud' ,
97
98
title : 'Save and edit plot in cloud' ,
98
- icon : ' disk' ,
99
+ icon : Icons . disk ,
99
100
click : function ( gd ) {
100
101
Plotly . Plots . sendDataToCloud ( gd ) ;
101
102
}
@@ -106,7 +107,7 @@ modebarButtons.zoom2d = {
106
107
title : 'Zoom' ,
107
108
attr : 'dragmode' ,
108
109
val : 'zoom' ,
109
- icon : ' zoombox' ,
110
+ icon : Icons . zoombox ,
110
111
click : handleCartesian
111
112
} ;
112
113
@@ -115,7 +116,7 @@ modebarButtons.pan2d = {
115
116
title : 'Pan' ,
116
117
attr : 'dragmode' ,
117
118
val : 'pan' ,
118
- icon : ' pan' ,
119
+ icon : Icons . pan ,
119
120
click : handleCartesian
120
121
} ;
121
122
@@ -124,7 +125,7 @@ modebarButtons.zoomIn2d = {
124
125
title : 'Zoom in' ,
125
126
attr : 'zoom' ,
126
127
val : 'in' ,
127
- icon : ' zoom_plus' ,
128
+ icon : Icons . zoom_plus ,
128
129
click : handleCartesian
129
130
} ;
130
131
@@ -133,7 +134,7 @@ modebarButtons.zoomOut2d = {
133
134
title : 'Zoom out' ,
134
135
attr : 'zoom' ,
135
136
val : 'out' ,
136
- icon : ' zoom_minus' ,
137
+ icon : Icons . zoom_minus ,
137
138
click : handleCartesian
138
139
} ;
139
140
@@ -142,7 +143,7 @@ modebarButtons.autoScale2d = {
142
143
title : 'Autoscale' ,
143
144
attr : 'zoom' ,
144
145
val : 'auto' ,
145
- icon : ' autoscale' ,
146
+ icon : Icons . autoscale ,
146
147
click : handleCartesian
147
148
} ;
148
149
@@ -151,7 +152,7 @@ modebarButtons.resetScale2d = {
151
152
title : 'Reset axes' ,
152
153
attr : 'zoom' ,
153
154
val : 'reset' ,
154
- icon : ' home' ,
155
+ icon : Icons . home ,
155
156
click : handleCartesian
156
157
} ;
157
158
@@ -160,7 +161,7 @@ modebarButtons.hoverClosestCartesian = {
160
161
title : 'Show closest data on hover' ,
161
162
attr : 'hovermode' ,
162
163
val : 'closest' ,
163
- icon : ' tooltip_basic' ,
164
+ icon : Icons . tooltip_basic ,
164
165
gravity : 'ne' ,
165
166
click : handleCartesian
166
167
} ;
@@ -172,7 +173,7 @@ modebarButtons.hoverCompareCartesian = {
172
173
val : function ( graphInfo ) {
173
174
return graphInfo . _fullLayout . _isHoriz ? 'y' : 'x' ;
174
175
} ,
175
- icon : ' tooltip_compare' ,
176
+ icon : Icons . tooltip_compare ,
176
177
gravity : 'ne' ,
177
178
click : handleCartesian
178
179
} ;
@@ -241,7 +242,7 @@ modebarButtons.zoom3d = {
241
242
title : 'Zoom' ,
242
243
attr : 'dragmode' ,
243
244
val : 'zoom' ,
244
- icon : ' zoombox' ,
245
+ icon : Icons . zoombox ,
245
246
click : handleDrag3d
246
247
} ;
247
248
@@ -250,7 +251,7 @@ modebarButtons.pan3d = {
250
251
title : 'Pan' ,
251
252
attr : 'dragmode' ,
252
253
val : 'pan' ,
253
- icon : ' pan' ,
254
+ icon : Icons . pan ,
254
255
click : handleDrag3d
255
256
} ;
256
257
@@ -259,7 +260,7 @@ modebarButtons.orbitRotation = {
259
260
title : 'orbital rotation' ,
260
261
attr : 'dragmode' ,
261
262
val : 'orbit' ,
262
- icon : '3d_rotate' ,
263
+ icon : Icons [ '3d_rotate' ] ,
263
264
click : handleDrag3d
264
265
} ;
265
266
@@ -268,7 +269,7 @@ modebarButtons.tableRotation = {
268
269
title : 'turntable rotation' ,
269
270
attr : 'dragmode' ,
270
271
val : 'turntable' ,
271
- icon : 'z-axis' ,
272
+ icon : Icons [ 'z-axis' ] ,
272
273
click : handleDrag3d
273
274
} ;
274
275
@@ -291,15 +292,15 @@ modebarButtons.resetCameraDefault3d = {
291
292
name : 'resetCameraDefault3d' ,
292
293
title : 'Reset camera to default' ,
293
294
attr : 'resetDefault' ,
294
- icon : ' home' ,
295
+ icon : Icons . home ,
295
296
click : handleCamera3d
296
297
} ;
297
298
298
299
modebarButtons . resetCameraLastSave3d = {
299
300
name : 'resetCameraLastSave3d' ,
300
301
title : 'Reset camera to last save' ,
301
302
attr : 'resetLastSave' ,
302
- icon : ' movie' ,
303
+ icon : Icons . movie ,
303
304
click : handleCamera3d
304
305
} ;
305
306
@@ -337,7 +338,7 @@ modebarButtons.hoverClosest3d = {
337
338
attr : 'hovermode' ,
338
339
val : null ,
339
340
toggle : true ,
340
- icon : ' tooltip_basic' ,
341
+ icon : Icons . tooltip_basic ,
341
342
gravity : 'ne' ,
342
343
click : function ( gd , ev ) {
343
344
var button = ev . currentTarget ,
@@ -389,7 +390,7 @@ modebarButtons.zoomInGeo = {
389
390
title : 'Zoom in' ,
390
391
attr : 'zoom' ,
391
392
val : 'in' ,
392
- icon : ' zoom_plus' ,
393
+ icon : Icons . zoom_plus ,
393
394
click : handleGeo
394
395
} ;
395
396
@@ -398,7 +399,7 @@ modebarButtons.zoomOutGeo = {
398
399
title : 'Zoom in' ,
399
400
attr : 'zoom' ,
400
401
val : 'out' ,
401
- icon : ' zoom_minus' ,
402
+ icon : Icons . zoom_minus ,
402
403
click : handleGeo
403
404
} ;
404
405
@@ -407,7 +408,7 @@ modebarButtons.resetGeo = {
407
408
title : 'Reset' ,
408
409
attr : 'reset' ,
409
410
val : null ,
410
- icon : ' autoscale' ,
411
+ icon : Icons . autoscale ,
411
412
click : handleGeo
412
413
} ;
413
414
@@ -417,7 +418,7 @@ modebarButtons.hoverClosestGeo = {
417
418
attr : 'hovermode' ,
418
419
val : null ,
419
420
toggle : true ,
420
- icon : ' tooltip_basic' ,
421
+ icon : Icons . tooltip_basic ,
421
422
gravity : 'ne' ,
422
423
click : handleGeo
423
424
} ;
@@ -450,7 +451,7 @@ modebarButtons.hoverClosestGl2d = {
450
451
attr : 'hovermode' ,
451
452
val : null ,
452
453
toggle : true ,
453
- icon : ' tooltip_basic' ,
454
+ icon : Icons . tooltip_basic ,
454
455
gravity : 'ne' ,
455
456
click : toggleHover
456
457
} ;
@@ -460,7 +461,7 @@ modebarButtons.hoverClosestPie = {
460
461
title : 'Toggle show closest data on hover' ,
461
462
attr : 'hovermode' ,
462
463
val : 'closest' ,
463
- icon : ' tooltip_basic' ,
464
+ icon : Icons . tooltip_basic ,
464
465
gravity : 'ne' ,
465
466
click : toggleHover
466
467
} ;
0 commit comments