Skip to content

Commit

Permalink
Increase max screenheight ratio and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jantoun-scottlogic committed Jun 14, 2024
1 parent ab518a4 commit 8a443e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('CarbonEstimationComponent', () => {
component.onResize(2000, 1000, 2000);

expect(component.chart?.updateOptions).toHaveBeenCalledOnceWith({
chart: { height: 1400 }, // Height will be capped at a percentage of the screen height
chart: { height: 1500 }, // Height will be capped at a percentage of the screen height
});
});

Expand Down
6 changes: 3 additions & 3 deletions src/app/carbon-estimation/carbon-estimation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ export class CarbonEstimationComponent implements OnInit, OnDestroy {
calculatedHeight = innerHeight - this.estimatorBaseHeight - extraHeight - expansionPanelHeight;
}

const maxScreenHeightRatio = 0.7;
const maxScreenHeightRatio = 0.75;

// Cap height based on screen height to prevent issues with chart becoming
// stretched when the component is displayed in a tall iFrame
// Cap chart height based on screen height to prevent issues with the chart
// becoming stretched when the component is displayed in a tall iFrame
return Math.min(calculatedHeight, screenHeight * maxScreenHeightRatio);
}

Expand Down

0 comments on commit 8a443e0

Please sign in to comment.