Skip to content

Commit a0afa9b

Browse files
committed
allow cell intensity bounds to be passed by the API
1 parent 6733b63 commit a0afa9b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mesh.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,15 @@ proto.update = function(params) {
369369
}
370370
}
371371
} else if(cellIntensity) {
372-
for(var i=0; i<cellIntensity.length; ++i) {
373-
var f = cellIntensity[i]
374-
intensityLo = Math.min(intensityLo, f)
375-
intensityHi = Math.max(intensityHi, f)
372+
if(params.cellIntensityBounds) {
373+
intensityLo = +params.cellIntensityBounds[0]
374+
intensityHi = +params.cellIntensityBounds[1]
375+
} else {
376+
for(var i=0; i<cellIntensity.length; ++i) {
377+
var f = cellIntensity[i]
378+
intensityLo = Math.min(intensityLo, f)
379+
intensityHi = Math.max(intensityHi, f)
380+
}
376381
}
377382
} else {
378383
for(var i=0; i<positions.length; ++i) {

0 commit comments

Comments
 (0)