|
10 | 10 |
|
11 | 11 | var fontAttrs = require('../../plots/font_attributes');
|
12 | 12 | var colorAttrs = require('../color/attributes');
|
13 |
| -var extendFlat = require('../../lib/extend').extendFlat; |
14 |
| -var buttonAttrs = require('./button_attributes'); |
15 |
| - |
16 |
| -buttonAttrs = extendFlat(buttonAttrs, { |
17 |
| - _isLinkedToArray: 'button', |
| 13 | +var templatedArray = require('../../plot_api/plot_template').templatedArray; |
18 | 14 |
|
| 15 | +var buttonAttrs = templatedArray('button', { |
| 16 | + visible: { |
| 17 | + valType: 'boolean', |
| 18 | + role: 'info', |
| 19 | + dflt: true, |
| 20 | + editType: 'plot', |
| 21 | + description: 'Determines whether or not this button is visible.' |
| 22 | + }, |
| 23 | + step: { |
| 24 | + valType: 'enumerated', |
| 25 | + role: 'info', |
| 26 | + values: ['month', 'year', 'day', 'hour', 'minute', 'second', 'all'], |
| 27 | + dflt: 'month', |
| 28 | + editType: 'plot', |
| 29 | + description: [ |
| 30 | + 'The unit of measurement that the `count` value will set the range by.' |
| 31 | + ].join(' ') |
| 32 | + }, |
| 33 | + stepmode: { |
| 34 | + valType: 'enumerated', |
| 35 | + role: 'info', |
| 36 | + values: ['backward', 'todate'], |
| 37 | + dflt: 'backward', |
| 38 | + editType: 'plot', |
| 39 | + description: [ |
| 40 | + 'Sets the range update mode.', |
| 41 | + 'If *backward*, the range update shifts the start of range', |
| 42 | + 'back *count* times *step* milliseconds.', |
| 43 | + 'If *todate*, the range update shifts the start of range', |
| 44 | + 'back to the first timestamp from *count* times', |
| 45 | + '*step* milliseconds back.', |
| 46 | + 'For example, with `step` set to *year* and `count` set to *1*', |
| 47 | + 'the range update shifts the start of the range back to', |
| 48 | + 'January 01 of the current year.', |
| 49 | + 'Month and year *todate* are currently available only', |
| 50 | + 'for the built-in (Gregorian) calendar.' |
| 51 | + ].join(' ') |
| 52 | + }, |
| 53 | + count: { |
| 54 | + valType: 'number', |
| 55 | + role: 'info', |
| 56 | + min: 0, |
| 57 | + dflt: 1, |
| 58 | + editType: 'plot', |
| 59 | + description: [ |
| 60 | + 'Sets the number of steps to take to update the range.', |
| 61 | + 'Use with `step` to specify the update interval.' |
| 62 | + ].join(' ') |
| 63 | + }, |
| 64 | + label: { |
| 65 | + valType: 'string', |
| 66 | + role: 'info', |
| 67 | + editType: 'plot', |
| 68 | + description: 'Sets the text label to appear on the button.' |
| 69 | + }, |
| 70 | + editType: 'plot', |
19 | 71 | description: [
|
20 | 72 | 'Sets the specifications for each buttons.',
|
21 | 73 | 'By default, a range selector comes with no buttons.'
|
|
0 commit comments