-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
134 lines (123 loc) · 3.47 KB
/
attributes.js
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
/**
* Copyright 2012-2016, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var fontAttrs = require('../../plots/font_attributes');
var colorAttrs = require('../color/attributes');
var extendFlat = require('../../lib/extend').extendFlat;
var buttonsAttrs = {
_isLinkedToArray: true,
method: {
valType: 'enumerated',
values: ['restyle', 'relayout', 'animate'],
dflt: 'restyle',
role: 'info',
description: [
'Sets the Plotly method to be called on click.'
].join(' ')
},
args: {
valType: 'info_array',
role: 'info',
freeLength: true,
items: [
{ valType: 'any' },
{ valType: 'any' },
{ valType: 'any' }
],
description: [
'Sets the arguments values to be passed to the Plotly',
'method set in `method` on click.'
].join(' ')
},
label: {
valType: 'string',
role: 'info',
dflt: '',
description: 'Sets the text label to appear on the button.'
}
};
module.exports = {
_isLinkedToArray: true,
visible: {
valType: 'boolean',
role: 'info',
description: [
'Determines whether or not the update menu is visible.'
].join(' ')
},
active: {
valType: 'integer',
role: 'info',
min: -1,
dflt: 0,
description: [
'Determines which button (by index starting from 0) is',
'considered active.'
].join(' ')
},
buttons: buttonsAttrs,
x: {
valType: 'number',
min: -2,
max: 3,
dflt: -0.05,
role: 'style',
description: 'Sets the x position (in normalized coordinates) of the update menu.'
},
xanchor: {
valType: 'enumerated',
values: ['auto', 'left', 'center', 'right'],
dflt: 'right',
role: 'info',
description: [
'Sets the update menu\'s horizontal position anchor.',
'This anchor binds the `x` position to the *left*, *center*',
'or *right* of the range selector.'
].join(' ')
},
y: {
valType: 'number',
min: -2,
max: 3,
dflt: 1,
role: 'style',
description: 'Sets the y position (in normalized coordinates) of the update menu.'
},
yanchor: {
valType: 'enumerated',
values: ['auto', 'top', 'middle', 'bottom'],
dflt: 'top',
role: 'info',
description: [
'Sets the update menu\'s vertical position anchor',
'This anchor binds the `y` position to the *top*, *middle*',
'or *bottom* of the range selector.'
].join(' ')
},
font: extendFlat({}, fontAttrs, {
description: 'Sets the font of the update menu button text.'
}),
bgcolor: {
valType: 'color',
role: 'style',
description: 'Sets the background color of the update menu buttons.'
},
bordercolor: {
valType: 'color',
dflt: colorAttrs.borderLine,
role: 'style',
description: 'Sets the color of the border enclosing the update menu.'
},
borderwidth: {
valType: 'number',
min: 0,
dflt: 1,
role: 'style',
description: 'Sets the width (in px) of the border enclosing the update menu.'
}
};