Skip to content

Commit 3f2cc1c

Browse files
committed
unexposing contextcolor; changing default opacity
(cherry picked from commit 01ba2da)
1 parent ed36612 commit 3f2cc1c

File tree

4 files changed

+11
-29
lines changed

4 files changed

+11
-29
lines changed

src/traces/parcoords/attributes.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,9 @@ module.exports = {
156156
},
157157

158158
lines: {
159-
contextcolor: {
160-
valType: 'data_array',
161-
dflt: [0, 0, 0],
162-
role: 'style',
163-
description: 'Color of the context line layer as an RGB triplet where each number is 0..255.'
164-
},
165-
166159
contextopacity: {
167160
valType: 'number',
168-
dflt: 0.025,
161+
dflt: 0.05,
169162
min: 0,
170163
max: 1,
171164
role: 'style',

src/traces/parcoords/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
8585

8686
coerce('line.color');
8787

88-
coerce('lines.contextcolor');
8988
coerce('lines.contextopacity');
9089
coerce('lines.pixelratio');
9190
coerce('lines.focusalphablending');

src/traces/parcoords/lines.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ var gpuDimensionCount = 64;
2020
var sectionVertexCount = 2;
2121
var vec4NumberCount = 4;
2222

23+
var contextColor = [119, 119, 119]; // middle gray to not drawn the focus; looks good on a black or white background
24+
2325
var dummyPixel = new Uint8Array(4);
2426
function ensureDraw(regl) {
2527
regl.read({
@@ -87,11 +89,11 @@ function adjustDepth(d) {
8789
return Math.max(depthLimitEpsilon, Math.min(1 - depthLimitEpsilon, d));
8890
}
8991

90-
function palette(unitToColor, context, lines_contextcolor, contextOpacity) {
92+
function palette(unitToColor, context, contextOpacity) {
9193
var result = [];
9294
for(var j = 0; j < 256; j++) {
9395
var c = unitToColor(j / 255);
94-
result.push((context ? lines_contextcolor : c).concat([context ? Math.round(contextOpacity * 255) : 255]));
96+
result.push((context ? contextColor : c).concat([context ? Math.round(contextOpacity * 255) : 255]));
9597
}
9698

9799
return result;
@@ -181,7 +183,7 @@ module.exports = function(canvasGL, lines, canvasWidth, canvasHeight, dimensions
181183
type: 'uint8',
182184
mag: 'nearest',
183185
min: 'nearest',
184-
data: palette(unitToColor, context, lines.contextcolor, lines.contextopacity)
186+
data: palette(unitToColor, context, lines.contextopacity)
185187
});
186188

187189
var glAes = regl({

test/jasmine/tests/parcoords_test.js

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)