Skip to content

Commit 66e8a22

Browse files
authored
Merge pull request #812 from plotly/pr783-heatmap-calc-fixup
Add test case for PR 783
2 parents c45a2a0 + 7b99e71 commit 66e8a22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/jasmine/tests/heatmap_test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ describe('heatmap calc', function() {
302302
expect(out.y).toBeCloseToArray([-0.5, 0.5, 1.5]);
303303
expect(out.z).toBeCloseTo2DArray([[1, 2, 3], [3, 1, 2]]);
304304
});
305+
306+
it('should handle the category case', function() {
307+
var out = _calc({
308+
x: ['a', 'b', 'c'],
309+
y: ['z'],
310+
z: [[17, 18, 19]]
311+
});
312+
313+
expect(out.x).toBeCloseToArray([-0.5, 0.5, 1.5, 2.5]);
314+
expect(out.y).toBeCloseToArray([-0.5, 0.5]);
315+
expect(out.z).toBeCloseTo2DArray([[17, 18, 19]]);
316+
});
305317
});
306318

307319
describe('heatmap plot', function() {

0 commit comments

Comments
 (0)