File tree 3 files changed +48
-35
lines changed
3 files changed +48
-35
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var constants = require ( './constants' ) ;
4
+
3
5
module . exports = {
4
6
editType : 'modebar' ,
5
7
@@ -43,7 +45,8 @@ module.exports = {
43
45
'Determines which predefined modebar buttons to add.' ,
44
46
'Please note that these buttons will only be shown if they are' ,
45
47
'compatible with all trace types used in a graph.' ,
46
- 'Similar to `config.modeBarButtonsToAdd` option'
48
+ 'Similar to `config.modeBarButtonsToAdd` option.' ,
49
+ 'This may include *' + constants . backButtons . join ( '*, *' ) + '*.'
47
50
] . join ( ' ' )
48
51
} ,
49
52
remove : {
@@ -53,7 +56,8 @@ module.exports = {
53
56
editType : 'modebar' ,
54
57
description : [
55
58
'Determines which predefined modebar buttons to remove.' ,
56
- 'Similar to `config.modeBarButtonsToRemove` option'
59
+ 'Similar to `config.modeBarButtonsToRemove` option.' ,
60
+ 'This may include *' + constants . foreButtons . join ( '*, *' ) + '*.'
57
61
] . join ( ' ' )
58
62
}
59
63
} ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var modeBarButtons = require ( './buttons' ) ;
4
+ var buttonList = Object . keys ( modeBarButtons ) ;
5
+
6
+ var DRAW_MODES = [
7
+ 'drawline' ,
8
+ 'drawopenpath' ,
9
+ 'drawclosedpath' ,
10
+ 'drawcircle' ,
11
+ 'drawrect' ,
12
+ 'eraseshape'
13
+ ] ;
14
+
15
+ var backButtons = [
16
+ 'v1hovermode' ,
17
+ 'hoverclosest' ,
18
+ 'hovercompare' ,
19
+ 'togglehover' ,
20
+ 'togglespikelines'
21
+ ] . concat ( DRAW_MODES ) ;
22
+
23
+ var foreButtons = [ ] ;
24
+ var addToForeButtons = function ( b ) {
25
+ if ( backButtons . indexOf ( b . _cat || b . name ) !== - 1 ) return ;
26
+ // for convenience add lowercase shotname e.g. zoomin as well fullname zoomInGeo
27
+ var name = b . name ;
28
+ var _cat = ( b . _cat || b . name ) . toLowerCase ( ) ;
29
+ if ( foreButtons . indexOf ( name ) === - 1 ) foreButtons . push ( name ) ;
30
+ if ( foreButtons . indexOf ( _cat ) === - 1 ) foreButtons . push ( _cat ) ;
31
+ } ;
32
+ buttonList . forEach ( function ( k ) {
33
+ addToForeButtons ( modeBarButtons [ k ] ) ;
34
+ } ) ;
35
+ foreButtons . sort ( ) ;
36
+
37
+ module . exports = {
38
+ DRAW_MODES : DRAW_MODES ,
39
+ backButtons : backButtons ,
40
+ foreButtons : foreButtons
41
+ } ;
Original file line number Diff line number Diff line change @@ -7,39 +7,7 @@ var isUnifiedHover = require('../fx/helpers').isUnifiedHover;
7
7
8
8
var createModeBar = require ( './modebar' ) ;
9
9
var modeBarButtons = require ( './buttons' ) ;
10
- var buttonList = Object . keys ( modeBarButtons ) ;
11
-
12
- var DRAW_MODES = [
13
- 'drawline' ,
14
- 'drawopenpath' ,
15
- 'drawclosedpath' ,
16
- 'drawcircle' ,
17
- 'drawrect' ,
18
- 'eraseshape'
19
- ] ;
20
-
21
- var backButtons = [
22
- 'v1hovermode' ,
23
- 'hoverclosest' ,
24
- 'hovercompare' ,
25
- 'togglehover' ,
26
- 'togglespikelines'
27
- ] . concat ( DRAW_MODES ) ;
28
-
29
- var foreButtons = [ ] ;
30
- var addToForeButtons = function ( b ) {
31
- if ( backButtons . indexOf ( b . _cat || b . name ) !== - 1 ) return ;
32
- // for convenience add lowercase shotname e.g. zoomin as well fullname zoomInGeo
33
- var name = b . name ;
34
- var _cat = ( b . _cat || b . name ) . toLowerCase ( ) ;
35
- if ( foreButtons . indexOf ( name ) === - 1 ) foreButtons . push ( name ) ;
36
- if ( foreButtons . indexOf ( _cat ) === - 1 ) foreButtons . push ( _cat ) ;
37
- } ;
38
- buttonList . forEach ( function ( k ) {
39
- addToForeButtons ( modeBarButtons [ k ] ) ;
40
- } ) ;
41
- foreButtons . sort ( ) ;
42
-
10
+ var DRAW_MODES = require ( './constants' ) . DRAW_MODES ;
43
11
44
12
/**
45
13
* ModeBar wrapper around 'create' and 'update',
You can’t perform that action at this time.
0 commit comments