Skip to content

Commit 5c5873d

Browse files
committed
add unselected lines color to constants
1 parent 643ba30 commit 5c5873d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/traces/parcoords/constants.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
layers: ['contextLineLayer', 'focusLineLayer', 'pickLineLayer'],
2020
axisTitleOffset: 28,
2121
axisExtentOffset: 10,
22+
deselectedLineColor: '#777',
2223
bar: {
2324
width: 4, // Visible width of the filter bar
2425
captureWidth: 10, // Mouse-sensitive width for interaction (Fitts law)

src/traces/parcoords/lines.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ function makeItem(model, leftmost, rightmost, itemNumber, i0, i1, x, y, panelSiz
180180
var canvasWidth = model.canvasWidth;
181181
var canvasHeight = model.canvasHeight;
182182

183+
var deselectedLinesColor = model.deselectedLines.color;
184+
183185
var itemModel = Lib.extendFlat({
184186
key: crossfilterDimensionIndex,
185187
resolution: [canvasWidth, canvasHeight],
@@ -199,10 +201,12 @@ function makeItem(model, leftmost, rightmost, itemNumber, i0, i1, x, y, panelSiz
199201

200202
drwLayer: drwLayer,
201203
contextColor: [
202-
119 / 255,
203-
119 / 255,
204-
119 / 255,
205-
Math.max(1 / 255, Math.pow(1 / model.lines.color.length, 1 / 3))
204+
deselectedLinesColor[0] / 255,
205+
deselectedLinesColor[1] / 255,
206+
deselectedLinesColor[2] / 255,
207+
deselectedLinesColor[3] < 1 ?
208+
deselectedLinesColor[3] :
209+
Math.max(1 / 255, Math.pow(1 / model.lines.color.length, 1 / 3))
206210
],
207211

208212
scissorX: (itemNumber === leftmost ? 0 : x + overdrag) + (model.pad.l - overdrag) + model.layoutWidth * domain.x[0],

src/traces/parcoords/parcoords.js

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function model(layout, d, i) {
139139
var trace = cd0.trace;
140140
var lineColor = helpers.convertTypedArray(cd0.lineColor);
141141
var line = trace.line;
142+
var deselectedLines = {color: rgba(c.deselectedLineColor)};
142143
var cOpts = Colorscale.extractOpts(line);
143144
var cscale = cOpts.reversescale ? Colorscale.flipScale(cd0.cscale) : cd0.cscale;
144145
var domain = trace.domain;
@@ -174,6 +175,7 @@ function model(layout, d, i) {
174175
tickDistance: c.tickDistance,
175176
unitToColor: unitToColorScale(cscale),
176177
lines: lines,
178+
deselectedLines: deselectedLines,
177179
labelAngle: labelAngle,
178180
labelSide: labelSide,
179181
labelFont: labelFont,

0 commit comments

Comments
 (0)