|
| 1 | +var Plotly = require('@lib/index'); |
1 | 2 | var Colorbar = require('@src/components/colorbar');
|
| 3 | +var createGraphDiv = require('../assets/create_graph_div'); |
| 4 | +var destroyGraphDiv = require('../assets/destroy_graph_div'); |
2 | 5 |
|
3 | 6 |
|
4 | 7 | describe('Test colorbar:', function() {
|
@@ -29,4 +32,28 @@ describe('Test colorbar:', function() {
|
29 | 32 | expect(hasColorbar(trace.marker.line)).toBe(false);
|
30 | 33 | });
|
31 | 34 | });
|
| 35 | + |
| 36 | + describe('floating point limits', function() { |
| 37 | + var gd; |
| 38 | + |
| 39 | + beforeEach(function() { |
| 40 | + gd = createGraphDiv(); |
| 41 | + }); |
| 42 | + |
| 43 | + afterEach(destroyGraphDiv); |
| 44 | + |
| 45 | + it('does not lock up on tiny fractional ranges', function(done) { |
| 46 | + var z = [ |
| 47 | + [9607345622458638.0, 9607345622458652.0, 9607345622458652.0, 9607345622458646.0, 9607345622458652.0, 9607345622458650.0, 9607345622458650.0, 9607345622458646.0], |
| 48 | + [9607345622458654.0, 9607345622458640.0, 9607345622458650.0, 9607345622458652.0, 9607345622458652.0, 9607345622458654.0, 9607345622458650.0, 9607345622458652.0], |
| 49 | + [9607345622458654.0, 9607345622458652.0, 9607345622458638.0, 9607345622458652.0, 9607345622458650.0, 9607345622458652.0, 9607345622458654.0, 9607345622458650.0], |
| 50 | + [9607345622458650.0, 9607345622458652.0, 9607345622458650.0, 9607345622458632.0, 9607345622458644.0, 9607345622458646.0, 9607345622458646.0, 9607345622458650.0], |
| 51 | + [9607345622458654.0, 9607345622458652.0, 9607345622458650.0, 9607345622458650.0, 9607345622458638.0, 9607345622458654.0, 9607345622458654.0, 9607345622458650.0], |
| 52 | + [9607345622458650.0, 9607345622458654.0, 9607345622458650.0, 9607345622458646.0, 9607345622458652.0, 9607345622458638.0, 9607345622458646.0, 9607345622458652.0], |
| 53 | + [9607345622458654.0, 9607345622458652.0, 9607345622458654.0, 9607345622458650.0, 9607345622458654.0, 9607345622458652.0, 9607345622458640.0, 9607345622458654.0], |
| 54 | + [9607345622458650.0, 9607345622458652.0, 9607345622458650.0, 9607345622458652.0, 9607345622458650.0, 9607345622458654.0, 9607345622458654.0, 9607345622458638.0] |
| 55 | + ]; |
| 56 | + Plotly.newPlot(gd, [{type: 'heatmap', z: z}]).then(done); |
| 57 | + }); |
| 58 | + }); |
32 | 59 | });
|
0 commit comments