Skip to content

Commit ed36612

Browse files
committed
switched contextOpacity from 0.255 to 0..1
(cherry picked from commit def1b11)
1 parent 635e368 commit ed36612

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/traces/parcoords/attributes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ module.exports = {
165165

166166
contextopacity: {
167167
valType: 'number',
168-
dflt: 16,
168+
dflt: 0.025,
169169
min: 0,
170-
max: 255,
170+
max: 1,
171171
role: 'style',
172-
description: 'Opacity of the context lines, on a scale of 0 (invisible) to 255 (fully opaque).'
172+
description: 'Opacity of the context lines, on a scale of 0 (invisible) to 1 (fully opaque).'
173173
},
174174

175175
pixelratio: {

src/traces/parcoords/lines.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ function adjustDepth(d) {
8787
return Math.max(depthLimitEpsilon, Math.min(1 - depthLimitEpsilon, d));
8888
}
8989

90-
function palette(unitToColor, context, lines_contextcolor, lines_contextopacity) {
90+
function palette(unitToColor, context, lines_contextcolor, contextOpacity) {
9191
var result = [];
9292
for(var j = 0; j < 256; j++) {
9393
var c = unitToColor(j / 255);
94-
result.push((context ? lines_contextcolor : c).concat([context ? lines_contextopacity : 255]));
94+
result.push((context ? lines_contextcolor : c).concat([context ? Math.round(contextOpacity * 255) : 255]));
9595
}
9696

9797
return result;

0 commit comments

Comments
 (0)