@@ -71,19 +71,25 @@ module.exports = function calc(gd, trace) {
71
71
dy = trace . dy ;
72
72
73
73
z = clean2dArray ( zIn , trace , xa , ya ) ;
74
+ }
74
75
75
- if ( xa . rangebreaks || ya . rangebreaks ) {
76
- z = dropZonBreaks ( z , trace ) ;
77
- x = trace . _x = skipBreaks ( trace . _x ) ;
78
- y = trace . _y = skipBreaks ( trace . _y ) ;
79
- }
76
+ if ( xa . rangebreaks || ya . rangebreaks ) {
77
+ z = dropZonBreaks ( x , y , z ) ;
78
+
79
+ if ( ! isHist ) {
80
+ x = skipBreaks ( x ) ;
81
+ y = skipBreaks ( y ) ;
80
82
81
- if ( isContour || trace . connectgaps ) {
82
- trace . _emptypoints = findEmpties ( z ) ;
83
- interp2d ( z , trace . _emptypoints ) ;
83
+ trace . _x = x ;
84
+ trace . _y = y ;
84
85
}
85
86
}
86
87
88
+ if ( ! isHist && ( isContour || trace . connectgaps ) ) {
89
+ trace . _emptypoints = findEmpties ( z ) ;
90
+ interp2d ( z , trace . _emptypoints ) ;
91
+ }
92
+
87
93
function noZsmooth ( msg ) {
88
94
zsmooth = trace . _input . zsmooth = trace . zsmooth = false ;
89
95
Lib . warn ( 'cannot use zsmooth: "fast": ' + msg ) ;
@@ -174,15 +180,15 @@ function skipBreaks(a) {
174
180
return b ;
175
181
}
176
182
177
- function dropZonBreaks ( z , trace ) {
183
+ function dropZonBreaks ( x , y , z ) {
178
184
var newZ = [ ] ;
179
185
var k = - 1 ;
180
186
for ( var i = 0 ; i < z . length ; i ++ ) {
181
- if ( trace . _y [ i ] === BADNUM ) continue ;
187
+ if ( y [ i ] === BADNUM ) continue ;
182
188
k ++ ;
183
189
newZ [ k ] = [ ] ;
184
190
for ( var j = 0 ; j < z [ i ] . length ; j ++ ) {
185
- if ( trace . _x [ j ] === BADNUM ) continue ;
191
+ if ( x [ j ] === BADNUM ) continue ;
186
192
187
193
newZ [ k ] . push ( z [ i ] [ j ] ) ;
188
194
}
0 commit comments