-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathattributes.js
57 lines (46 loc) · 1.6 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
'use strict';
var extendFlat = require('../../lib').extendFlat;
var axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;
var OHLCattrs = require('../ohlc/attributes');
var boxAttrs = require('../box/attributes');
function directionAttrs(lineColorDefault) {
return {
line: {
color: extendFlat({}, boxAttrs.line.color, {dflt: lineColorDefault}),
width: boxAttrs.line.width,
editType: 'style'
},
fillcolor: boxAttrs.fillcolor,
editType: 'style'
};
}
module.exports = {
xperiod: OHLCattrs.xperiod,
xperiod0: OHLCattrs.xperiod0,
xperiodalignment: OHLCattrs.xperiodalignment,
xhoverformat: axisHoverFormat('x'),
yhoverformat: axisHoverFormat('y'),
x: OHLCattrs.x,
open: OHLCattrs.open,
high: OHLCattrs.high,
low: OHLCattrs.low,
close: OHLCattrs.close,
line: {
width: extendFlat({}, boxAttrs.line.width, {
description: [
boxAttrs.line.width.description,
'Note that this style setting can also be set per',
'direction via `increasing.line.width` and',
'`decreasing.line.width`.'
].join(' ')
}),
editType: 'style'
},
increasing: directionAttrs(OHLCattrs.increasing.line.color.dflt),
decreasing: directionAttrs(OHLCattrs.decreasing.line.color.dflt),
text: OHLCattrs.text,
hovertext: OHLCattrs.hovertext,
whiskerwidth: extendFlat({}, boxAttrs.whiskerwidth, { dflt: 0 }),
hoverlabel: OHLCattrs.hoverlabel,
zindex: boxAttrs.zindex
};