@@ -71,19 +71,21 @@ proto.update = function(data) {
7171 var positions = zip3 (
7272 toDataCoords ( layout . xaxis , data . x , scene . dataScale [ 0 ] , data . xcalendar ) ,
7373 toDataCoords ( layout . yaxis , data . y , scene . dataScale [ 1 ] , data . ycalendar ) ,
74- toDataCoords ( layout . zaxis , data . z , scene . dataScale [ 2 ] , data . zcalendar ) ) ;
74+ toDataCoords ( layout . zaxis , data . z , scene . dataScale [ 2 ] , data . zcalendar )
75+ ) ;
7576
7677 var cells ;
7778 if ( data . i && data . j && data . k ) {
78- cells = zip3 ( data . i , data . j , data . k ) ;
79- }
80- else if ( data . alphahull === 0 ) {
79+ cells = zip3 (
80+ data . i . map ( function ( e ) { return Math . round ( e ) ; } ) ,
81+ data . j . map ( function ( e ) { return Math . round ( e ) ; } ) ,
82+ data . k . map ( function ( e ) { return Math . round ( e ) ; } )
83+ ) ;
84+ } else if ( data . alphahull === 0 ) {
8185 cells = convexHull ( positions ) ;
82- }
83- else if ( data . alphahull > 0 ) {
86+ } else if ( data . alphahull > 0 ) {
8487 cells = alphaShape ( data . alphahull , positions ) ;
85- }
86- else {
88+ } else {
8789 var d = [ 'x' , 'y' , 'z' ] . indexOf ( data . delaunayaxis ) ;
8890 cells = triangulate ( positions . map ( function ( c ) {
8991 return [ c [ ( d + 1 ) % 3 ] , c [ ( d + 2 ) % 3 ] ] ;
@@ -113,16 +115,13 @@ proto.update = function(data) {
113115 config . vertexIntensity = data . intensity ;
114116 config . vertexIntensityBounds = [ data . cmin , data . cmax ] ;
115117 config . colormap = parseColorScale ( data . colorscale ) ;
116- }
117- else if ( data . vertexcolor ) {
118+ } else if ( data . vertexcolor ) {
118119 this . color = data . vertexcolor [ 0 ] ;
119120 config . vertexColors = parseColorArray ( data . vertexcolor ) ;
120- }
121- else if ( data . facecolor ) {
121+ } else if ( data . facecolor ) {
122122 this . color = data . facecolor [ 0 ] ;
123123 config . cellColors = parseColorArray ( data . facecolor ) ;
124- }
125- else {
124+ } else {
126125 this . color = data . color ;
127126 config . meshColor = str2RgbaArray ( data . color ) ;
128127 }
0 commit comments