Skip to content

Commit 51788a4

Browse files
committedJun 18, 2020
no longer depend on ndarray-fill module that uses cwise with static-eval
1 parent 3d5f311 commit 51788a4

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed
 

‎package-lock.json

-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
"mouse-event-offset": "^3.0.2",
101101
"mouse-wheel": "^1.2.0",
102102
"ndarray": "^1.0.19",
103-
"ndarray-fill": "^1.0.2",
104103
"ndarray-homography": "^1.0.0",
105104
"parse-svg-path": "^0.1.2",
106105
"point-cluster": "^3.1.8",

‎src/traces/surface/convert.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var createSurface = require('gl-surface3d');
1313

1414
var ndarray = require('ndarray');
1515
var homography = require('ndarray-homography');
16-
var fill = require('ndarray-fill');
1716

1817
var isArrayOrTypedArray = require('../../lib').isArrayOrTypedArray;
1918
var parseColorScale = require('../../lib/gl_format_color').parseColorScale;
@@ -511,9 +510,13 @@ proto.update = function(data) {
511510
ndarray(new Float32Array(xlen * ylen), [xlen, ylen]),
512511
ndarray(new Float32Array(xlen * ylen), [xlen, ylen])
513512
];
514-
fill(coords[0], function(row, col) { return rawCoords[0][row][col]; });
515-
fill(coords[1], function(row, col) { return rawCoords[1][row][col]; });
516-
fill(coords[2], function(row, col) { return rawCoords[2][row][col]; });
513+
for(i = 0; i < 3; i++) {
514+
for(j = 0; j < xlen; j++) {
515+
for(k = 0; k < ylen; k++) {
516+
coords[i].set(j, k, rawCoords[i][j][k]);
517+
}
518+
}
519+
}
517520
rawCoords = []; // free memory
518521

519522
var params = {
@@ -543,9 +546,11 @@ proto.update = function(data) {
543546
if(data.surfacecolor) {
544547
var intensity = ndarray(new Float32Array(xlen * ylen), [xlen, ylen]);
545548

546-
fill(intensity, function(row, col) {
547-
return data.surfacecolor[col][row];
548-
});
549+
for(j = 0; j < xlen; j++) {
550+
for(k = 0; k < ylen; k++) {
551+
intensity.set(j, k, data.surfacecolor[k][j]);
552+
}
553+
}
549554

550555
coords.push(intensity);
551556
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.