99
1010'use strict' ;
1111
12+ var Lib = require ( '../../lib' ) ;
1213var helpers = require ( '../ohlc/helpers' ) ;
1314
1415exports . moduleType = 'transform' ;
@@ -52,17 +53,9 @@ function makeTrace(traceIn, state, direction) {
5253 type : 'box' ,
5354 boxpoints : false ,
5455
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 ,
6257 hoverinfo : traceIn . hoverinfo ,
63-
6458 opacity : traceIn . opacity ,
65- showlegend : traceIn . showlegend ,
6659
6760 transforms : helpers . makeTransform ( traceIn , state , direction )
6861 } ;
@@ -72,21 +65,27 @@ function makeTrace(traceIn, state, direction) {
7265 var directionOpts = traceIn [ direction ] ;
7366
7467 if ( directionOpts ) {
68+ Lib . extendFlat ( traceOut , {
7569
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 ] ,
7872
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 ) ,
8175
82- traceOut . visible = directionOpts . visible ;
76+ whiskerwidth : traceIn . whiskerwidth ,
77+ text : traceIn . text ,
8378
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+ } ,
8886
89- traceOut . fillcolor = directionOpts . fillcolor ;
87+ fillcolor : directionOpts . fillcolor
88+ } ) ;
9089 }
9190
9291 return traceOut ;
0 commit comments