|
| 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 | + |
| 10 | +'use strict'; |
| 11 | + |
| 12 | +var Lib = require('../../lib'); |
| 13 | +var scatterAttrs = require('../scatter/attributes'); |
| 14 | + |
| 15 | +var lineAttrs = scatterAttrs.line; |
| 16 | + |
| 17 | +var directionAttrs = { |
| 18 | + visible: { |
| 19 | + valType: 'enumerated', |
| 20 | + values: [true, false, 'legendonly'], |
| 21 | + role: 'info', |
| 22 | + dflt: true, |
| 23 | + description: [ |
| 24 | + |
| 25 | + ].join(' ') |
| 26 | + }, |
| 27 | + |
| 28 | + color: Lib.extendFlat({}, lineAttrs.color), |
| 29 | + width: Lib.extendFlat({}, lineAttrs.width), |
| 30 | + dash: Lib.extendFlat({}, lineAttrs.dash), |
| 31 | + |
| 32 | + tickwidth: { |
| 33 | + valType: 'number', |
| 34 | + min: 0, |
| 35 | + max: 1, |
| 36 | + dflt: 0.1, |
| 37 | + role: 'style', |
| 38 | + description: [ |
| 39 | + 'Sets the width of the open/close tick marks', |
| 40 | + 'relative to the *t* minimal interval.' |
| 41 | + ].join(' ') |
| 42 | + } |
| 43 | +}; |
| 44 | + |
| 45 | +module.exports = { |
| 46 | + |
| 47 | + // or should this be 'x' |
| 48 | + // |
| 49 | + // |
| 50 | + // should we add the option for ohlc along y-axis ?? |
| 51 | + t: { |
| 52 | + valType: 'data_array', |
| 53 | + description: [ |
| 54 | + 'Sets the time coordinate.', |
| 55 | + 'If absent, linear coordinate will be generated.' |
| 56 | + ].join(' ') |
| 57 | + }, |
| 58 | + |
| 59 | + open: { |
| 60 | + valType: 'data_array', |
| 61 | + dflt: [], |
| 62 | + description: 'Sets the open values.' |
| 63 | + }, |
| 64 | + |
| 65 | + high: { |
| 66 | + valType: 'data_array', |
| 67 | + dflt: [], |
| 68 | + description: 'Sets the high values.' |
| 69 | + }, |
| 70 | + |
| 71 | + low: { |
| 72 | + valType: 'data_array', |
| 73 | + dflt: [], |
| 74 | + description: 'Sets the low values.' |
| 75 | + }, |
| 76 | + |
| 77 | + close: { |
| 78 | + valType: 'data_array', |
| 79 | + dflt: [], |
| 80 | + description: 'Sets the close values.' |
| 81 | + }, |
| 82 | + |
| 83 | + // TODO find better colors |
| 84 | + increasing: Lib.extendDeep({}, directionAttrs, { |
| 85 | + color: { dflt: 'green' } |
| 86 | + }), |
| 87 | + |
| 88 | + decreasing: Lib.extendDeep({}, directionAttrs, { |
| 89 | + color: { dflt: 'red' } |
| 90 | + }), |
| 91 | + |
| 92 | + text: { |
| 93 | + valType: 'string', |
| 94 | + role: 'info', |
| 95 | + dflt: '', |
| 96 | + arrayOk: true, |
| 97 | + description: [ |
| 98 | + 'Sets hover text elements associated with each sample point.', |
| 99 | + 'If a single string, the same string appears over', |
| 100 | + 'all the data points.', |
| 101 | + 'If an array of string, the items are mapped in order to the', |
| 102 | + 'this trace\'s sample points.' |
| 103 | + ].join(' ') |
| 104 | + } |
| 105 | +}; |
0 commit comments