Skip to content

Commit 45baa74

Browse files
committed
Add readPixels method to parcoords lines
1 parent cf79c11 commit 45baa74

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/traces/parcoords/lines.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,23 @@ module.exports = function(canvasGL, lines, canvasWidth, canvasHeight, initialDim
401401
return pickPixel;
402402
}
403403

404+
function readPixels(canvasX, canvasY, width, height) {
405+
var pixelArray = new Uint8Array(4 * width * height);
406+
regl.read({
407+
x: canvasX,
408+
y: canvasY,
409+
width: width,
410+
height: height,
411+
data: pixelArray
412+
});
413+
return pixelArray;
414+
}
415+
404416
return {
405417
setColorDomain: setColorDomain,
406418
render: renderGLParcoords,
407419
readPixel: readPixel,
420+
readPixels: readPixels,
408421
destroy: regl.destroy
409422
};
410423
};

0 commit comments

Comments
 (0)