Skip to content

Commit ae02676

Browse files
committed
add ternary test 🔒ing down negative offsets
- throws errors in strict-d3 w/o latest patch in ternary.js - note that strict-d3 does not throw in the nw.js imagetest container for some reason.
1 parent fa832aa commit ae02676

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/jasmine/tests/ternary_test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,34 @@ describe('ternary plots', function() {
382382
.then(done);
383383
});
384384

385+
it('should render a-axis and c-axis with negative offsets', function(done) {
386+
var gd = createGraphDiv();
387+
388+
Plotly.plot(gd, [{
389+
type: 'scatterternary',
390+
a: [2, 1, 1],
391+
b: [1, 2, 1],
392+
c: [1, 1, 2.12345]
393+
}], {
394+
ternary: {
395+
domain: {
396+
x: [0.67, 1],
397+
y: [0.5, 1]
398+
},
399+
},
400+
margin: {t: 25, l: 25, r: 25, b: 25},
401+
height: 450,
402+
width: 1000
403+
})
404+
.then(function() {
405+
var subplot = gd._fullLayout.ternary._subplot;
406+
expect(subplot.aaxis._offset < 0).toBe(true);
407+
expect(subplot.caxis._offset < 0).toBe(true);
408+
})
409+
.catch(fail)
410+
.then(done);
411+
});
412+
385413
function countTernarySubplot() {
386414
return d3.selectAll('.ternary').size();
387415
}

0 commit comments

Comments
 (0)