@@ -71,19 +71,21 @@ proto.update = function(data) {
71
71
var positions = zip3 (
72
72
toDataCoords ( layout . xaxis , data . x , scene . dataScale [ 0 ] , data . xcalendar ) ,
73
73
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
+ ) ;
75
76
76
77
var cells ;
77
78
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 ) {
81
85
cells = convexHull ( positions ) ;
82
- }
83
- else if ( data . alphahull > 0 ) {
86
+ } else if ( data . alphahull > 0 ) {
84
87
cells = alphaShape ( data . alphahull , positions ) ;
85
- }
86
- else {
88
+ } else {
87
89
var d = [ 'x' , 'y' , 'z' ] . indexOf ( data . delaunayaxis ) ;
88
90
cells = triangulate ( positions . map ( function ( c ) {
89
91
return [ c [ ( d + 1 ) % 3 ] , c [ ( d + 2 ) % 3 ] ] ;
@@ -113,16 +115,13 @@ proto.update = function(data) {
113
115
config . vertexIntensity = data . intensity ;
114
116
config . vertexIntensityBounds = [ data . cmin , data . cmax ] ;
115
117
config . colormap = parseColorScale ( data . colorscale ) ;
116
- }
117
- else if ( data . vertexcolor ) {
118
+ } else if ( data . vertexcolor ) {
118
119
this . color = data . vertexcolor [ 0 ] ;
119
120
config . vertexColors = parseColorArray ( data . vertexcolor ) ;
120
- }
121
- else if ( data . facecolor ) {
121
+ } else if ( data . facecolor ) {
122
122
this . color = data . facecolor [ 0 ] ;
123
123
config . cellColors = parseColorArray ( data . facecolor ) ;
124
- }
125
- else {
124
+ } else {
126
125
this . color = data . color ;
127
126
config . meshColor = str2RgbaArray ( data . color ) ;
128
127
}
0 commit comments