Skip to content

Commit eae6da2

Browse files
committed
use pseudo-random number in scattergl large color arrays test
1 parent 20c3a00 commit eae6da2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/jasmine/tests/gl2d_plot_interact_test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var selectButton = require('../assets/modebar_button');
1616
var delay = require('../assets/delay');
1717
var readPixel = require('../assets/read_pixel');
1818

19-
2019
function countCanvases() {
2120
return d3.selectAll('canvas').size();
2221
}
@@ -797,9 +796,11 @@ describe('@gl Test gl2d plots', function() {
797796
var w = 500;
798797
var h = 500;
799798

799+
Lib.seedPseudoRandom();
800+
800801
for(var i = 0; i < N; i++) {
801802
x.push(i);
802-
color.push(Math.random());
803+
color.push(Lib.pseudoRandom());
803804
}
804805

805806
Plotly.newPlot(gd, [{
@@ -824,8 +825,9 @@ describe('@gl Test gl2d plots', function() {
824825
var total = readPixel(gd.querySelector('.gl-canvas-context'), 0, 0, w, h)
825826
.reduce(function(acc, v) { return acc + v; }, 0);
826827

827-
// the total value was 3762487 before PR
828+
// the total value was 3777134 before PR
828829
// https://github.com/plotly/plotly.js/pull/2377
830+
// and 105545275 after.
829831
expect(total).toBeGreaterThan(4e6);
830832
})
831833
.catch(fail)

0 commit comments

Comments
 (0)