Skip to content

Commit 9072918

Browse files
authored
Merge pull request #4650 from plotly/revert-4635-res3939-parcoords-context-line-color
Revert "expose parcoords context line color"
2 parents d376931 + 6420bd7 commit 9072918

File tree

5 files changed

+2
-155
lines changed

5 files changed

+2
-155
lines changed

src/traces/parcoords/attributes.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,23 +141,6 @@ module.exports = {
141141
description: 'The dimensions (variables) of the parallel coordinates chart. 2..60 dimensions are supported.'
142142
}),
143143

144-
unselected: {
145-
line: {
146-
color: {
147-
valType: 'color',
148-
dflt: '#777',
149-
role: 'style',
150-
editType: 'plot',
151-
description: [
152-
'Sets the color of lines in the background',
153-
'i.e. unselected lines.'
154-
].join(' ')
155-
},
156-
editType: 'plot'
157-
},
158-
editType: 'plot'
159-
},
160-
161144
line: extendFlat({editType: 'calc'},
162145
colorScaleAttrs('line', {
163146
// the default autocolorscale isn't quite usable for parcoords due to context ambiguity around 0 (grey, off-white)

src/traces/parcoords/constants.js

Lines changed: 1 addition & 0 deletions
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/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,4 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
115115

116116
coerce('labelangle');
117117
coerce('labelside');
118-
coerce('unselected.line.color');
119118
};

src/traces/parcoords/parcoords.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function model(layout, d, i) {
154154
var trace = cd0.trace;
155155
var lineColor = helpers.convertTypedArray(cd0.lineColor);
156156
var line = trace.line;
157-
var deselectedLines = {color: rgba(trace.unselected.line.color)};
157+
var deselectedLines = {color: rgba(c.deselectedLineColor)};
158158
var cOpts = Colorscale.extractOpts(line);
159159
var cscale = cOpts.reversescale ? Colorscale.flipScale(cd0.cscale) : cd0.cscale;
160160
var domain = trace.domain;

test/jasmine/tests/parcoords_test.js

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -856,12 +856,6 @@ describe('parcoords Lifecycle methods', function() {
856856
}],
857857
line: {color: 'blue'}
858858
}], {
859-
margin: {
860-
t: 0,
861-
b: 0,
862-
l: 0,
863-
r: 0
864-
},
865859
width: 300,
866860
height: 200
867861
})
@@ -894,12 +888,6 @@ describe('parcoords Lifecycle methods', function() {
894888
}],
895889
line: {color: 'blue'}
896890
}], {
897-
margin: {
898-
t: 0,
899-
b: 0,
900-
l: 0,
901-
r: 0
902-
},
903891
width: 300,
904892
height: 200
905893
})
@@ -922,130 +910,6 @@ describe('parcoords Lifecycle methods', function() {
922910
.catch(failTest)
923911
.then(done);
924912
});
925-
926-
it('@gl unselected.line.color `Plotly.restyle` should change context layer line.color', function(done) {
927-
var testLayer = '.gl-canvas-context';
928-
929-
var list1 = [];
930-
var list2 = [];
931-
for(var i = 0; i <= 100; i++) {
932-
list1[i] = i;
933-
list2[i] = 100 - i;
934-
}
935-
936-
Plotly.plot(gd, [{
937-
type: 'parcoords',
938-
dimensions: [{
939-
constraintrange: [1, 10],
940-
values: list1
941-
}, {
942-
values: list2
943-
}],
944-
line: {color: '#0F0'},
945-
unselected: {line: {color: '#F00'}}
946-
}], {
947-
margin: {
948-
t: 0,
949-
b: 0,
950-
l: 0,
951-
r: 0
952-
},
953-
width: 300,
954-
height: 200
955-
})
956-
.then(function() {
957-
var rgb = getAvgPixelByChannel(testLayer);
958-
expect(rgb[0]).not.toBe(0, 'red');
959-
expect(rgb[1]).toBe(0, 'no green');
960-
expect(rgb[2]).toBe(0, 'no blue');
961-
962-
return Plotly.restyle(gd, 'unselected.line.color', '#00F');
963-
})
964-
.then(function() {
965-
var rgb = getAvgPixelByChannel(testLayer);
966-
expect(rgb[0]).toBe(0, 'no red');
967-
expect(rgb[1]).toBe(0, 'no green');
968-
expect(rgb[2]).not.toBe(0, 'blue');
969-
970-
return Plotly.restyle(gd, 'unselected.line.color', 'rgba(0,0,0,0)');
971-
})
972-
.then(function() {
973-
var rgb = getAvgPixelByChannel(testLayer);
974-
expect(rgb[0]).toBe(0, 'no red');
975-
expect(rgb[1]).toBe(0, 'no green');
976-
expect(rgb[2]).toBe(0, 'no blue');
977-
})
978-
.catch(failTest)
979-
.then(done);
980-
});
981-
982-
it('@gl unselected.line.color `Plotly.react` should change line.color and unselected.line.color', function(done) {
983-
var unselectedLayer = '.gl-canvas-context';
984-
var selectedLayer = '.gl-canvas-focus';
985-
986-
var list1 = [];
987-
var list2 = [];
988-
for(var i = 0; i <= 100; i++) {
989-
list1[i] = i;
990-
list2[i] = 100 - i;
991-
}
992-
993-
var fig = {
994-
data: [{
995-
type: 'parcoords',
996-
dimensions: [{
997-
constraintrange: [1, 10],
998-
values: list1
999-
}, {
1000-
values: list2
1001-
}],
1002-
line: {color: '#0F0'},
1003-
unselected: {line: {color: '#F00'}}
1004-
}],
1005-
layout: {
1006-
margin: {
1007-
t: 0,
1008-
b: 0,
1009-
l: 0,
1010-
r: 0
1011-
},
1012-
width: 300,
1013-
height: 200
1014-
}
1015-
};
1016-
1017-
var rgb;
1018-
1019-
Plotly.newPlot(gd, fig)
1020-
.then(function() {
1021-
rgb = getAvgPixelByChannel(unselectedLayer);
1022-
expect(rgb[0]).not.toBe(0, 'red');
1023-
expect(rgb[1]).toBe(0, 'no green');
1024-
expect(rgb[2]).toBe(0, 'no blue');
1025-
1026-
rgb = getAvgPixelByChannel(selectedLayer);
1027-
expect(rgb[0]).toBe(0, 'no red');
1028-
expect(rgb[1]).not.toBe(0, 'green');
1029-
expect(rgb[2]).toBe(0, 'no blue');
1030-
1031-
fig.data[0].line.color = '#FF0';
1032-
fig.data[0].unselected.line.color = '#00F';
1033-
return Plotly.react(gd, fig);
1034-
})
1035-
.then(function() {
1036-
rgb = getAvgPixelByChannel(selectedLayer);
1037-
expect(rgb[0]).not.toBe(0, 'red');
1038-
expect(rgb[1]).not.toBe(0, 'green');
1039-
expect(rgb[2]).toBe(0, 'no blue');
1040-
1041-
rgb = getAvgPixelByChannel(unselectedLayer);
1042-
expect(rgb[0]).toBe(0, 'no red');
1043-
expect(rgb[1]).toBe(0, 'no green');
1044-
expect(rgb[2]).not.toBe(0, 'blue');
1045-
})
1046-
.catch(failTest)
1047-
.then(done);
1048-
});
1049913
});
1050914

1051915
describe('parcoords basic use', function() {

0 commit comments

Comments
 (0)