9
9
10
10
'use strict' ;
11
11
12
+ var Lib = require ( '../../lib' ) ;
12
13
var helpers = require ( '../ohlc/helpers' ) ;
13
14
14
15
exports . moduleType = 'transform' ;
@@ -52,17 +53,9 @@ function makeTrace(traceIn, state, direction) {
52
53
type : 'box' ,
53
54
boxpoints : false ,
54
55
55
- // TODO could do better
56
- name : direction ,
57
-
58
- // TODO this doesn't restyle currently
59
- whiskerwidth : traceIn . whiskerwidth ,
60
-
61
- text : traceIn . text ,
56
+ visible : traceIn . visible ,
62
57
hoverinfo : traceIn . hoverinfo ,
63
-
64
58
opacity : traceIn . opacity ,
65
- showlegend : traceIn . showlegend ,
66
59
67
60
transforms : helpers . makeTransform ( traceIn , state , direction )
68
61
} ;
@@ -72,21 +65,27 @@ function makeTrace(traceIn, state, direction) {
72
65
var directionOpts = traceIn [ direction ] ;
73
66
74
67
if ( directionOpts ) {
68
+ Lib . extendFlat ( traceOut , {
75
69
76
- // to make autotype catch date axes soon!!
77
- traceOut . x = traceIn . x || [ 0 ] ;
70
+ // to make autotype catch date axes soon!!
71
+ x : traceIn . x || [ 0 ] ,
78
72
79
- // concat low and high to get correct autorange
80
- traceOut . y = [ ] . concat ( traceIn . low ) . concat ( traceIn . high ) ;
73
+ // concat low and high to get correct autorange
74
+ y : [ ] . concat ( traceIn . low ) . concat ( traceIn . high ) ,
81
75
82
- traceOut . visible = directionOpts . visible ;
76
+ whiskerwidth : traceIn . whiskerwidth ,
77
+ text : traceIn . text ,
83
78
84
- traceOut . line = {
85
- color : directionOpts . color ,
86
- width : directionOpts . width
87
- } ;
79
+ name : directionOpts . name ,
80
+ showlegend : directionOpts . showlegend ,
81
+
82
+ line : {
83
+ color : directionOpts . color ,
84
+ width : directionOpts . width
85
+ } ,
88
86
89
- traceOut . fillcolor = directionOpts . fillcolor ;
87
+ fillcolor : directionOpts . fillcolor
88
+ } ) ;
90
89
}
91
90
92
91
return traceOut ;
0 commit comments