Skip to content

Commit 407d72a

Browse files
committed
refactor parcoords - using isContext and isPick instead of context & pick in line.js
1 parent 213f965 commit 407d72a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/traces/parcoords/lines.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var depthLimitEpsilon = 1e-6;
2222
var maskHeight = 2048;
2323

2424
var dummyPixel = new Uint8Array(4);
25-
var pickPixel = new Uint8Array(4);
25+
var dataPixel = new Uint8Array(4);
2626

2727
var paletteTextureConfig = {
2828
shape: [256, 1],
@@ -223,8 +223,8 @@ function expandedPixelRange(bounds) {
223223

224224
module.exports = function(canvasGL, d) {
225225
// context & pick describe which canvas we're talking about - won't change with new data
226-
var context = d.context;
227-
var pick = d.pick;
226+
var isContext = d.context;
227+
var isPick = d.pick;
228228

229229
var regl = d.regl;
230230

@@ -252,7 +252,7 @@ module.exports = function(canvasGL, d) {
252252
profile: false,
253253

254254
blend: {
255-
enable: context,
255+
enable: isContext,
256256
func: {
257257
srcRGB: 'src alpha',
258258
dstRGB: 'one minus src alpha',
@@ -267,7 +267,7 @@ module.exports = function(canvasGL, d) {
267267
},
268268

269269
depth: {
270-
enable: !context,
270+
enable: !isContext,
271271
mask: true,
272272
func: 'less',
273273
range: [0, 1]
@@ -342,12 +342,12 @@ module.exports = function(canvasGL, d) {
342342
sampleCount = initialDims[0] ? initialDims[0].values.length : 0;
343343

344344
var lines = model.lines;
345-
var color = pick ? lines.color.map(function(_, i) {return i / lines.color.length;}) : lines.color;
345+
var color = isPick ? lines.color.map(function(_, i) {return i / lines.color.length;}) : lines.color;
346346

347347
var points = makePoints(sampleCount, initialDims, color);
348348
setAttributes(attributes, sampleCount, points);
349349

350-
if(!context && !pick) {
350+
if(!isContext && !isPick) {
351351
paletteTexture = regl.texture(Lib.extendFlat({
352352
data: palette(model.unitToColor, 255)
353353
}, paletteTextureConfig));
@@ -441,7 +441,7 @@ module.exports = function(canvasGL, d) {
441441
// clear canvas here, as the panel iteration below will not enter the loop body
442442
clear(regl, 0, 0, model.canvasWidth, model.canvasHeight);
443443
}
444-
var constraints = makeConstraints(context);
444+
var constraints = makeConstraints(isContext);
445445

446446
for(i = 0; i < panelCount; i++) {
447447
var p = panels[i];
@@ -463,7 +463,7 @@ module.exports = function(canvasGL, d) {
463463
p.panelSizeX, p.panelSizeY,
464464
p.dim0.crossfilterDimensionIndex,
465465
constraints,
466-
context ? 0 : pick ? 2 : 1
466+
isContext ? 0 : isPick ? 2 : 1
467467
);
468468

469469
renderState.clearOnly = clearOnly;
@@ -482,9 +482,9 @@ module.exports = function(canvasGL, d) {
482482
y: canvasY,
483483
width: 1,
484484
height: 1,
485-
data: pickPixel
485+
data: dataPixel
486486
});
487-
return pickPixel;
487+
return dataPixel;
488488
}
489489

490490
function readPixels(canvasX, canvasY, width, height) {

0 commit comments

Comments
 (0)