8000 rename modebar_config -> buttons_config · siqitech/plotly.js@079f747 · GitHub
[go: up one dir, main page]

Skip to content

Commit 079f747

Browse files
committed
rename modebar_config -> buttons_config
1 parent 387e7da commit 079f747

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

src/components/modebar/modebar_config.js renamed to src/components/modebar/buttons_config.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
/**
1313
* Modebar buttons configuration
1414
*
15+
* @param {string} category button category depending on e.g. plot type
16+
* @param {string} group button group ('ext', 'drag', 'zoom', 'hover')
1517
* @param {string} title text that appears while hovering over the button
1618
* @param {string} icon name of the svg icon associated with the button
1719
* @param {string} [gravity] icon positioning
@@ -28,53 +30,69 @@ module.exports = {
2830

2931
// for all plot types
3032
toImage: {
33+
category: 'all',
34+
group: 'ext',
3135
title: 'download plot as a png',
3236
icon: 'camera',
3337
click: 'toImage'
3438
},
3539
sendDataToCloud: {
40+
category: 'all',
41+
group: 'ext',
3642
title: 'save and edit plot in cloud',
3743
icon: 'disk',
3844
click: 'sendDataToCloud'
3945
},
40< 8000 /td>46

4147
// cartesian and gl2d
4248
zoom2d: {
49+
category: '2d',
50+
group: 'drag',
4351
title: 'Zoom',
4452
attr: 'dragmode',
4553
val: 'zoom',
4654
icon: 'zoombox',
4755
click: 'handleCartesian'
4856
},
4957
pan2d: {
58+
category: '2d',
59+
group: 'drag',
5060
title: 'Pan',
5161
attr: 'dragmode',
5262
val: 'pan',
5363
icon: 'pan',
5464
click: 'handleCartesian'
5565
},
5666
zoomIn2d: {
67+
category: '2d',
68+
group: 'zoom',
5769
title: 'Zoom in',
5870
attr: 'zoom',
5971
val: 'in',
6072
icon: 'zoom_plus',
6173
click: 'handleCartesian'
6274
},
6375
zoomOut2d: {
76+
category: '2d',
77+
group: 'zoom',
6478
title: 'Zoom out',
6579
attr: 'zoom',
6680
val: 'out',
6781
icon: 'zoom_minus',
6882
click: 'handleCartesian'
6983
},
7084
autoScale2d: {
85+
category: '2d',
86+
group: 'zoom',
7187
title: 'Autoscale',
7288
attr: 'zoom',
7389
val: 'auto',
7490
icon: 'autoscale',
7591
click: 'handleCartesian'
7692
},
7793
resetScale2d: {
94+
category: '2d',
95+
group: 'zoom',
7896
title: 'Reset axes',
7997
attr: 'zoom',
8098
val: 'reset',
@@ -84,6 +102,8 @@ module.exports = {
84102

85103
// cartesian only
86104
hoverClosest2d: {
105+
category: 'cartesian',
106+
group: 'hover',
87107
title: 'Show closest data on hover',
88108
attr: 'hovermode',
89109
val: 'closest',
@@ -92,6 +112,8 @@ module.exports = {
92112
click: 'handleCartesian'
93113
},
94114
hoverCompare2d: {
115+
category: 'cartesian',
116+
group: 'hover',
95117
title: 'Compare data on hover',
96118
attr: 'hovermode',
97119
val: function(graphInfo) {
@@ -104,46 +126,60 @@ module.exports = {
104126

105127
// gl3d
106128
zoom3d: {
129+
category: 'gl3d',
130+
group: 'drag',
107131
title: 'Zoom',
108132
attr: 'dragmode',
109133
val: 'zoom',
110134
icon: 'zoombox',
111135
click: 'handleDrag3d'
112136
},
113137
pan3d: {
138+
category: 'gl3d',
139+
group: 'drag',
114140
title: 'Pan',
115141
attr: 'dragmode',
116142
val: 'pan',
117143
icon: 'pan',
118144
click: 'handleDrag3d'
119145
},
120146
orbitRotation: {
147+
category: 'gl3d',
148+
group: 'drag',
121149
title: 'orbital rotation',
122150
attr: 'dragmode',
123151
val: 'orbit',
124152
icon: '3d_rotate',
125153
click: 'handleDrag3d'
126154
},
127155
tableRotation: {
156+
category: 'gl3d',
157+
group: 'drag',
128158
title: 'turntable rotation',
129159
attr: 'dragmode',
130160
val: 'turntable',
131161
icon: 'z-axis',
132162
click: 'handleDrag3d'
133163
},
134164
resetCameraDefault3d: {
165+
category: 'gl3d',
166+
group: 'zoom',
135167
title: 'Reset camera to default',
136168
attr: 'resetDefault',
137169
icon: 'home',
138170
click: 'handleCamera3d'
139171
},
140172
resetCameraLastSave3d: {
173+
category: 'gl3d',
174+
group: 'zoom',
141175
title: 'Reset camera to last save',
142176
attr: 'resetLastSave',
143177
icon: 'movie',
144178
click: 'handleCamera3d'
145179
},
146180
hoverClosest3d: {
181+
category: 'gl3d',
182+
group: 'hover',
147183
title: 'Toggle show closest data on hover',
148184
attr: 'hovermode',
149185
val: null,
@@ -155,27 +191,35 @@ module.exports = {
155191

156192
// geo
157193
zoomInGeo: {
194+
category: 'geo',
195+
group: 'zoom',
158196
title: 'Zoom in',
159197
attr: 'zoom',
160198
val: 'in',
161199
icon: 'zoom_plus',
162200
click: 'handleGeo'
163201
},
164202
zoomOutGeo: {
203+
category: 'geo',
204+
group: 'zoom',
165205
title: 'Zoom out',
166206
attr: 'zoom',
167207
val: 'out',
168208
icon: 'zoom_minus',
169209
click: 'handleGeo'
170210
},
171211
resetGeo: {
212+
category: 'geo',
213+
group: 'zoom',
172214
title: 'Reset',
173215
attr: 'reset',
174216
val: null,
175217
icon: 'autoscale',
176218
click: 'handleGeo'
177219
},
178220
hoverClosestGeo: {
221+
category: 'geo',
222+
group: 'hover',
179223
title: 'Toggle show closest data on hover',
180224
attr: 'hovermode',
181225
val: null,
@@ -187,6 +231,8 @@ module.exports = {
187231

188232
// gl2d only
189233
hoverClosestGl2d: {
234+
category: 'gl2d',
235+
group: 'hover',
190236
title: 'Toggle show closest data on hover',
191237
attr: 'hovermode',
192238
val: null,
@@ -198,6 +244,8 @@ module.exports = {
198244

199245
// pie traces only
200246
hoverClosestPie: {
247+
category: 'pie',
248+
group: 'hover',
201249
title: 'Toggle show closest data on hover',
202250
attr: 'hovermode',
203251
val: 'closest',

src/components/modebar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var Plotly = require('../../plotly');
1313
var d3 = require('d3');
1414

1515
var Icons = require('../../../build/ploticon');
16-
var modebarConfig = require('./modebar_config');
16+
var buttonsConfig = require('./buttons_config');
1717

1818

1919
/**

0 commit comments

Comments
 (0)
0