mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* category axes should be rendered from last to first for heatmap to work correctly * adding a test
This commit is contained in:
parent
65507ca740
commit
ecb10dc9f4
2 changed files with 11 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue