Skip to content

Commit 83b7589

Browse files
committed
Fix parcoords tests
1 parent 4efe21e commit 83b7589

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

src/plot_api/plot_api.js

-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ Plotly.plot = function(gd, data, layout, config) {
220220
'left': 0,
221221
'width': '100%',
222222
'height': '100%',
223-
'pointer-events': 'none',
224223
'overflow': 'visible'
225224
})
226225
.attr('width', fullLayout.width)

src/traces/parcoords/lines.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function valid(i, offset, panelCount) {
164164
return i + offset <= panelCount;
165165
}
166166

167-
module.exports = module.exports = function(canvasGL, d, scatter) {
167+
module.exports = function(canvasGL, d, scatter) {
168168
var model = d.model,
169169
vm = d.viewModel,
170170
domain = model.domain;

src/traces/parcoords/parcoords.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ module.exports = function(root, svg, parcoordsLineLayers, styledData, layout, ca
302302
var lastHovered = null;
303303

304304
parcoordsLineLayer
305-
.filter(function(d) {return d.pick;})
305+
.filter(function(d) {
306+
return d.pick;
307+
})
306308
.on('mousemove', function(d) {
307309
if(linePickActive && d.lineLayer && callbacks && callbacks.hover) {
308310
var event = d3.event;
@@ -440,6 +442,7 @@ module.exports = function(root, svg, parcoordsLineLayers, styledData, layout, ca
440442
});
441443

442444
parcoordsLineLayer
445+
.filter(function(d) {return !!d.viewModel;})
443446
.each(function(d) {
444447
d.lineLayer = lineLayerMaker(this, d, c.scatter);
445448
d.viewModel[d.key] = d.lineLayer;

test/jasmine/tests/parcoords_test.js

+12-13
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ describe('@noCI parcoords', function() {
788788
expect(gd.data.length).toEqual(1);
789789

790790
Plotly.deleteTraces(gd, 0).then(function() {
791-
expect(d3.selectAll('.parcoords-line-layers').node()).toEqual(null);
791+
expect(d3.selectAll('.gl-canvas').node(0)).toEqual(null);
792792
expect(gd.data.length).toEqual(0);
793793
done();
794794
});
@@ -815,13 +815,13 @@ describe('@noCI parcoords', function() {
815815
return Plotly.deleteTraces(gd, [0]);
816816
})
817817
.then(function() {
818-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(1);
818+
expect(document.querySelectorAll('.gl-canvas').length).toEqual(3);
819819
expect(document.querySelectorAll('.y-axis').length).toEqual(7);
820820
expect(gd.data.length).toEqual(1);
821821
return Plotly.deleteTraces(gd, 0);
822822
})
823823
.then(function() {
824-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(0);
824+
expect(document.querySelectorAll('.gl-canvas').length).toEqual(0);
825825
expect(document.querySelectorAll('.y-axis').length).toEqual(0);
826826
expect(gd.data.length).toEqual(0);
827827
done();
@@ -869,21 +869,21 @@ describe('@noCI parcoords', function() {
869869
mockCopy2.data[0].domain = {x: [0.55, 1]};
870870
mockCopy2.data[0].dimensions.splice(3, 4);
871871

872-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(0);
872+
expect(document.querySelectorAll('.gl-container').length).toEqual(0);
873873

874874
Plotly.plot(gd, mockCopy)
875875
.then(function() {
876876

877877
expect(1).toEqual(1);
878-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(1);
878+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
879879
expect(gd.data.length).toEqual(1);
880880

881881
return Plotly.plot(gd, mockCopy2);
882882
})
883883
.then(function() {
884884

885885
expect(1).toEqual(1);
886-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(2);
886+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
887887
expect(gd.data.length).toEqual(2);
888888

889889
done();
@@ -899,19 +899,18 @@ describe('@noCI parcoords', function() {
899899
mockCopy2.data[0].domain = {y: [0.65, 1]};
900900
mockCopy2.data[0].dimensions.splice(3, 4);
901901

902-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(0);
902+
expect(document.querySelectorAll('.gl-container').length).toEqual(0);
903903

904904
Plotly.plot(gd, mockCopy)
905905
.then(function() {
906906

907-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(1);
907+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
908908
expect(gd.data.length).toEqual(1);
909909

910910
return Plotly.addTraces(gd, [mockCopy2.data[0]]);
911911
})
912912
.then(function() {
913-
914-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(2);
913+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
915914
expect(gd.data.length).toEqual(2);
916915

917916
done();
@@ -945,12 +944,12 @@ describe('@noCI parcoords', function() {
945944
mockCopy2.data[0].dimensions[2].tickvals = [0, 1, 2, 2.5, 3];
946945
mockCopy2.data[0].dimensions[2].values = mockCopy2.data[0].dimensions[2].values.map(numberUpdater);
947946

948-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(0);
947+
expect(document.querySelectorAll('.gl-container').length).toEqual(0);
949948

950949
Plotly.plot(gd, mockCopy)
951950
.then(function() {
952951

953-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(1);
952+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
954953
expect(gd.data.length).toEqual(1);
955954

956955
return Plotly.restyle(gd, {
@@ -960,7 +959,7 @@ describe('@noCI parcoords', function() {
960959
})
961960
.then(function() {
962961

963-
expect(document.querySelectorAll('.parcoords-line-layers').length).toEqual(1);
962+
expect(document.querySelectorAll('.gl-container').length).toEqual(1);
964963
expect(gd.data.length).toEqual(1);
965964

966965
done();

0 commit comments

Comments
 (0)