Skip to content

Commit 36968ad

Browse files
committed
first pass range selector attributes
1 parent 826ed94 commit 36968ad

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
var fontAttrs = require('../../plots/font_attributes');
12+
var colorAttrs = require('../color/attributes');
13+
var extendFlat = require('../../lib/extend').extendFlat;
14+
var buttonAttrs = require('./button_attributes');
15+
16+
module.exports = {
17+
visible: {
18+
valType: 'boolean',
19+
description: [
20+
'Determines whether or not this range selector is visible.'
21+
].join(' ')
22+
},
23+
24+
buttons: {
25+
role: 'object',
26+
items: buttonAttrs,
27+
description: [
28+
'buttons!!!'
29+
].join(' ')
30+
},
31+
32+
x: {
33+
valType: 'number',
34+
min: -2,
35+
max: 3,
36+
dflt: 0,
37+
role: 'style',
38+
description: 'Sets the x position (in normalized coordinates) of the range selector.'
39+
},
40+
xanchor: {
41+
valType: 'enumerated',
42+
values: ['auto', 'left', 'center', 'right'],
43+
dflt: 'left',
44+
role: 'info',
45+
description: [
46+
'Sets the range selector \'s horizontal position anchor.',
47+
'This anchor binds the `x` position to the *left*, *center*',
48+
'or *right* of the range selector.'
49+
].join(' ')
50+
},
51+
y: {
52+
valType: 'number',
53+
min: -2,
54+
max: 3,
55+
dflt: 1,
56+
role: 'style',
57+
description: 'Sets the y position (in normalized coordinates) of the range selector.'
58+
},
59+
yanchor: {
60+
valType: 'enumerated',
61+
values: ['auto', 'top', 'middle', 'bottom'],
62+
dflt: 'auto',
63+
role: 'info',
64+
description: [
65+
'Sets the range selector\'s vertical position anchor',
66+
'This anchor binds the `y` position to the *top*, *middle*',
67+
'or *bottom* of the range selector.'
68+
].join(' ')
69+
},
70+
71+
font: extendFlat({}, fontAttrs, {
72+
description: 'Sets the font used to text the range selector buttons.'
73+
}),
74+
75+
bgcolor: {
76+
valType: 'color',
77+
role: 'style',
78+
description: 'Sets the range selector background color.'
79+
},
80+
bordercolor: {
81+
valType: 'color',
82+
dflt: colorAttrs.defaultLine,
83+
role: 'style',
84+
description: 'Sets the color of the border enclosing the range selector.'
85+
},
86+
borderwidth: {
87+
valType: 'number',
88+
min: 0,
89+
dflt: 0,
90+
role: 'style',
91+
description: 'Sets the width (in px) of the border enclosing the range selector.'
92+
}
93+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright 2012-2016, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
'use strict';
10+
11+
12+
module.exports = {
13+
step: {
14+
valType: 'enumerated',
15+
role: 'info',
16+
values: ['month', 'year', 'day', 'all'],
17+
dflt: 'month',
18+
description: [
19+
''
20+
].join(' ')
21+
},
22+
stepmode: {
23+
valType: 'enumerated',
24+
role: 'info',
25+
values: ['backward', 'to day'],
26+
dflt: 'backward',
27+
description: [
28+
''
29+
].join(' ')
30+
},
31+
count: {
32+
valType: 'number',
33+
role: 'info',
34+
dflt: 1,
35+
description: [
36+
''
37+
].join(' ')
38+
},
39+
label: {
40+
valType: 'string',
41+
role: 'info',
42+
description: ''
43+
}
44+
};

0 commit comments

Comments
 (0)