File tree 1 file changed +5
-11
lines changed
1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -114,28 +114,23 @@ exports.decodeTypedArraySpec = function(vIn) {
114
114
( '' + v . shape ) . split ( ',' ) ;
115
115
116
116
shape . reverse ( ) ; // i.e. to match numpy order
117
- var ndims = shape . length ;
117
+ var ndim = shape . length ;
118
118
119
119
var nj , j ;
120
120
var ni = + shape [ 0 ] ;
121
121
122
122
var rowBytes = BYTES_PER_ELEMENT * ni ;
123
123
var pos = 0 ;
124
124
125
- if ( ndims === 1 ) {
125
+ if ( ndim === 1 ) {
126
126
out = new T ( buffer ) ;
127
- } else if ( ndims === 2 ) {
127
+ } else if ( ndim === 2 ) {
128
128
nj = + shape [ 1 ] ;
129
129
for ( j = 0 ; j < nj ; j ++ ) {
130
130
out [ j ] = new T ( buffer , pos , ni ) ;
131
131
pos += rowBytes ;
132
132
}
133
- /*
134
-
135
- // 3d arrays are not supported in traces e.g. volume & isosurface
136
- // once supported we could uncomment this part
137
-
138
- } else if(ndims === 3) {
133
+ } else if ( ndim === 3 ) {
139
134
nj = + shape [ 1 ] ;
140
135
var nk = + shape [ 2 ] ;
141
136
for ( var k = 0 ; k < nk ; k ++ ) {
@@ -145,9 +140,8 @@ exports.decodeTypedArraySpec = function(vIn) {
145
140
pos += rowBytes ;
146
141
}
147
142
}
148
- */
149
143
} else {
150
- throw new Error ( 'Error in shape: "' + v . shape + '"' ) ;
144
+ throw new Error ( 'ndim: ' + ndim + 'is not supported with the shape:"' + v . shape + '"' ) ;
151
145
}
152
146
153
147
// attach bdata, dtype & shape to array for json export
You can’t perform that action at this time.
0 commit comments