|
| 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 | +}; |
0 commit comments