@@ -71,19 +71,25 @@ module.exports = function calc(gd, trace) {
7171 dy = trace . dy ;
7272
7373 z = clean2dArray ( zIn , trace , xa , ya ) ;
74+ }
7475
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 ) ;
8082
81- if ( isContour || trace . connectgaps ) {
82- trace . _emptypoints = findEmpties ( z ) ;
83- interp2d ( z , trace . _emptypoints ) ;
83+ trace . _x = x ;
84+ trace . _y = y ;
8485 }
8586 }
8687
88+ if ( ! isHist && ( isContour || trace . connectgaps ) ) {
89+ trace . _emptypoints = findEmpties ( z ) ;
90+ interp2d ( z , trace . _emptypoints ) ;
91+ }
92+
8793 function noZsmooth ( msg ) {
8894 zsmooth = trace . _input . zsmooth = trace . zsmooth = false ;
8995 Lib . warn ( 'cannot use zsmooth: "fast": ' + msg ) ;
@@ -174,15 +180,15 @@ function skipBreaks(a) {
174180 return b ;
175181}
176182
177- function dropZonBreaks ( z , trace ) {
183+ function dropZonBreaks ( x , y , z ) {
178184 var newZ = [ ] ;
179185 var k = - 1 ;
180186 for ( var i = 0 ; i < z . length ; i ++ ) {
181- if ( trace . _y [ i ] === BADNUM ) continue ;
187+ if ( y [ i ] === BADNUM ) continue ;
182188 k ++ ;
183189 newZ [ k ] = [ ] ;
184190 for ( var j = 0 ; j < z [ i ] . length ; j ++ ) {
185- if ( trace . _x [ j ] === BADNUM ) continue ;
191+ if ( x [ j ] === BADNUM ) continue ;
186192
187193 newZ [ k ] . push ( z [ i ] [ j ] ) ;
188194 }
0 commit comments