Skip to content

Commit 579dcb2

Browse files
committed
pass cmin and cmax to gl-surface3d:
- straight as 'intensityBounds' in 'surfacecolor' case - scaled by scaleFactor in 'z' case
1 parent 04a7f47 commit 579dcb2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/traces/surface/convert.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ proto.update = function(data) {
248248
opacity: 1
249249
};
250250

251+
params.intensityBounds = [data.cmin, data.cmax];
252+
251253
//Refine if necessary
252254
if(data.surfacecolor) {
253255
var intensity = ndarray(
@@ -257,6 +259,12 @@ proto.update = function(data) {
257259
});
258260
coords.push(intensity);
259261
}
262+
else {
263+
// when 'z' is used as 'intensity',
264+
// we must scale its value
265+
params.intensityBounds[0] *= scaleFactor[2];
266+
params.intensityBounds[1] *= scaleFactor[2];
267+
}
260268

261269
this.dataScale = refine(coords);
262270

0 commit comments

Comments
 (0)