Skip to content

Commit 11821c2

Browse files
committed
extra test for histograms on other axes
1 parent e5a535c commit 11821c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jasmine/tests/histogram_test.js

+10
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,16 @@ describe('Test histogram', function() {
308308
], 5);
309309
});
310310

311+
it('ignores traces on other axes', function() {
312+
var trace1 = {x: [1, 2, 3, 4]};
313+
var trace2 = {x: [5, 5.5, 6, 6.5]};
314+
var trace3 = {x: [1, 1.1, 1.2, 1.3], xaxis: 'x2'};
315+
var trace4 = {x: [1, 1.2, 1.4, 1.6], yaxis: 'y2'};
316+
317+
expect(calcPositions(trace1, [trace2, trace3, trace4])).toEqual([1, 2, 3, 4]);
318+
expect(calcPositions(trace3)).toBeCloseToArray([0.9, 1.1, 1.3]);
319+
});
320+
311321
describe('cumulative distribution functions', function() {
312322
var base = {
313323
x: [0, 5, 10, 15, 5, 10, 15, 10, 15, 15],

0 commit comments

Comments
 (0)