Skip to content

Commit

Permalink
fix(axis): left axis sizing based on title padding (#762)
Browse files Browse the repository at this point in the history
* fix(axis): left axis sizing based on title padding

* test: fix broken unit tests

* test: update broken screenshots
  • Loading branch information
nickofthyme authored Jul 23, 2020
1 parent 71b49f8 commit 3990589
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/chart_types/xy_chart/utils/axis_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ describe('Axis computational utils', () => {
expect(axisTicksPosition.axisPositions.get(verticalAxisSpecWTitle.id)).toEqual({
top: 0,
left: 10,
width: 18,
width: 10,
height: 100,
});
});
Expand Down Expand Up @@ -1201,7 +1201,7 @@ describe('Axis computational utils', () => {

const expectedPositionWithTopLegend = {
height: 100,
width: 18,
width: 10,
left: 100,
top: 0,
};
Expand Down
2 changes: 1 addition & 1 deletion src/chart_types/xy_chart/utils/axis_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ export function getAxisPosition(
showLabels: boolean,
) {
const titlePadding = getSimplePadding(axisTitleStyle.padding);
const titleDimension = axisTitleStyle.visible ? titlePadding.inner + axisTitleHeight + titlePadding.outer : 0;
const titleDimension = axisTitleStyle.visible && axisTitleHeight > 0 ? titlePadding.inner + axisTitleHeight + titlePadding.outer : 0;
const { position } = axisSpec;
const { maxLabelBboxHeight, maxLabelBboxWidth } = axisDim;
const { top, left, height, width } = chartDimensions;
Expand Down

0 comments on commit 3990589

Please sign in to comment.