Skip to content

Commit 9d1325c

Browse files
committed
spikeline: test spikedistance -1 on a bar trace
1 parent 8308111 commit 9d1325c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/jasmine/tests/hover_spikeline_test.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,33 @@ describe('spikeline hover', function() {
404404
.then(done);
405405
});
406406

407+
it('correctly responds to setting the spikedistance to -1 by increasing ' +
408+
'the range of search for points to draw the spikelines to Infinity in a bar trace', function(done) {
409+
var _mock = {
410+
data: [{type: 'bar', y: [5, 6, 8, 10]}],
411+
layout: {xaxis: {showspikes: true}}
412+
};
413+
414+
Plotly.plot(gd, _mock).then(function() {
415+
_hover({xval: 0, yval: 2});
416+
_assert(
417+
[[147.5, 370, 147.5, 241.75]],
418+
[]
419+
);
420+
421+
_setSpikedistance(-1);
422+
})
423+
.then(function() {
424+
_hover({xval: 0, yval: 2});
425+
_assert(
426+
[[147.5, 370, 147.5, 241.75]],
427+
[]
428+
);
429+
})
430+
.catch(failTest)
431+
.then(done);
432+
});
433+
407434
it('correctly responds to setting the spikedistance to 0 by disabling ' +
408435
'the search for points to draw the spikelines', function(done) {
409436
var _mock = makeMock('toaxis', 'closest');

0 commit comments

Comments
 (0)