@@ -59,7 +59,7 @@ var proto = Contour.prototype;
59
59
60
60
proto . handlePick = function ( pickResult ) {
61
61
var index = pickResult . pointId ,
62
- options = this . contourOptions ,
62
+ options = this . heatmapOptions ,
63
63
shape = options . shape ;
64
64
65
65
return {
@@ -87,7 +87,9 @@ proto.update = function(fullTrace, calcTrace) {
87
87
rowLen = z [ 0 ] . length ,
88
88
colLen = z . length ;
89
89
90
- this . contourOptions . z = this . heatmapOptions . z = flattenZ ( z ) ;
90
+ this . contourOptions . z = flattenZ ( z , rowLen , colLen ) ;
91
+ this . heatmapOptions . z = [ ] . concat . apply ( [ ] , z ) ;
92
+
91
93
this . contourOptions . shape = this . heatmapOptions . shape = [ rowLen , colLen ] ;
92
94
93
95
this . contourOptions . x = this . heatmapOptions . x = calcPt . x ;
@@ -109,15 +111,12 @@ proto.dispose = function() {
109
111
this . heatmap . dispose ( ) ;
110
112
} ;
111
113
112
- function flattenZ ( zIn ) {
113
- var Nx = zIn . length ,
114
- Ny = zIn [ 0 ] . length ;
115
-
116
- var zOut = new Float32Array ( Nx * Ny ) ;
114
+ function flattenZ ( zIn , rowLen , colLen ) {
115
+ var zOut = new Float32Array ( rowLen * colLen ) ;
117
116
var pt = 0 ;
118
117
119
- for ( var i = 0 ; i < Nx ; i ++ ) {
120
- for ( var j = 0 ; j < Ny ; j ++ ) {
118
+ for ( var i = 0 ; i < rowLen ; i ++ ) {
119
+ for ( var j = 0 ; j < colLen ; j ++ ) {
121
120
zOut [ pt ++ ] = zIn [ j ] [ i ] ;
122
121
}
123
122
}
0 commit comments