* category axes should be rendered from last to first for heatmap to work correctly * adding a test
This commit is contained in:
parent
c4c3ab1ee0
commit
4a2d318826
|
@ -63,6 +63,15 @@ describe('Vislib Heatmap Chart Test Suite', function () {
|
|||
vis.destroy();
|
||||
});
|
||||
|
||||
it('category axes should be rendered in reverse order', () => {
|
||||
const renderedCategoryAxes = vis.handler.renderArray.filter(item => {
|
||||
return item.constructor && item.constructor.name === 'Axis' && item.axisConfig.get('type') === 'category';
|
||||
});
|
||||
expect(vis.handler.categoryAxes.length).to.equal(renderedCategoryAxes.length);
|
||||
expect(vis.handler.categoryAxes[0].axisConfig.get('id')).to.equal(renderedCategoryAxes[1].axisConfig.get('id'));
|
||||
expect(vis.handler.categoryAxes[1].axisConfig.get('id')).to.equal(renderedCategoryAxes[0].axisConfig.get('id'));
|
||||
});
|
||||
|
||||
describe('addSquares method', function () {
|
||||
it('should append rects', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
|
|
|
@ -67,7 +67,8 @@ export function VisHandlerProvider(Private) {
|
|||
|
||||
this.renderArray = this.renderArray
|
||||
.concat(this.valueAxes)
|
||||
.concat(this.categoryAxes);
|
||||
// category axes need to render in reverse order https://github.com/elastic/kibana/issues/13551
|
||||
.concat(this.categoryAxes.slice().reverse());
|
||||
|
||||
// memoize so that the same function is returned every time,
|
||||
// allowing us to remove/re-add the same function
|
||||
|
|
Loading…
Reference in a new issue