@@ -67,52 +67,6 @@ errorBars.supplyDefaults = function(traceIn, traceOut, defaultColor, opts) {
6767 }
6868} ;
6969
70- errorBars . pushRef2GDC = function ( gd , selCurve , astr , val ) {
71- // Copy the error bar data into gdc
72- // This is called from the style-box, where
73- // either the reference trace was selected.
74- // This function copies the data from the referenced trace
75- // into the gdc object
76- // selCurve: the selected curve (i.e. gdc = gd[selCurve])
77- // astr: the string that was modified
78- var iRef ,
79- various = false ,
80- parts = astr . split ( '.' ) ,
81- container = parts [ 0 ] ,
82- attr = parts [ 1 ] ,
83- letter = container . charAt ( container . length - 1 ) ;
84- if ( attr === 'type' ) {
85- if ( selCurve === 'various' ) {
86- various = true ;
87- selCurve = 0 ;
88- }
89- // if the 'trace' type was just selected
90- iRef = Number ( gd . calcdata [ Number ( selCurve ) ] [ 0 ] . trace [ 'error_' + letter ] . traceref ) || 0 ;
91- }
92- else if ( attr === 'traceref' || attr === 'tracerefminus' ) {
93- if ( selCurve === 'various' ) various = true ;
94- // if the trace reference was just modified
95- iRef = Number ( val ) || 0 ;
96- }
97-
98- // now copy the appropriate referenced error bar data into gdc
99- // TODO: do this through restyle so we can undo it
100- // the error bar data that we're referencing
101- var newdata = gd . data [ iRef ] [ letter ] . map ( Number ) ;
102-
103- function setarrays ( i ) {
104- var eb = gd . data [ i ] [ container ] ;
105- eb [ attr === 'tracerefminus' ? 'arrayminus' : 'array' ] = newdata ;
106- }
107-
108- if ( ! various ) setarrays ( Number ( selCurve ) ) ;
109- else {
110- // copy all of the data
111- // TODO: this won't work right if we just select some traces, right?
112- for ( var i = 0 ; i < gd . data . length ; i ++ ) { setarrays ( i ) ; }
113- }
114- } ;
115-
11670// size the error bar itself (for all types except data)
11771function errorval ( type , dataval , errval ) {
11872 if ( type === 'percent' ) return Math . abs ( dataval * errval / 100 ) ;
0 commit comments