Fix canvas graphs height

This commit is contained in:
Piotr Rogowski 2022-10-20 13:10:18 +02:00
parent 598f77f73f
commit 17cb793db8
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
2 changed files with 4 additions and 11 deletions

View File

@ -58,7 +58,6 @@ const badgeStyle = { backgroundColor: Colors.TEXT };
const margin = 30;
const sidebarWidth = 250;
const minCanvasHeightInner = 600;
const mapStateToProps = (state: AppState) => ({
ui: state.ui,
@ -93,12 +92,7 @@ const Diagnose = ({
const calculateCanvasSize = useCallback(() => {
setCanvasWidth((contentRef.current?.clientWidth || 0) - margin);
if (window.innerHeight > minCanvasHeightInner) {
setCanvasHeight(Math.round(window.innerHeight - 250));
} else {
setCanvasHeight(minCanvasHeightInner / 2);
}
setCanvasHeight(Math.round(window.innerHeight - 220));
}, []);
const siderProps = {
width: sidebarWidth,

View File

@ -70,7 +70,7 @@ const { Step } = Steps;
const edgeUnknown = 'Unknown';
const margin = 30;
const sidebarWidth = 250;
const minCanvasHeightInner = 600;
const minCanvasHeightInner = 500;
const badgeStyle = { backgroundColor: Colors.TEXT };
@ -114,14 +114,13 @@ const Logs = ({
setCanvasWidth((contentRef.current?.clientWidth || 0) - margin);
if (window.innerHeight > minCanvasHeightInner) {
setCanvasHeight(Math.round((window.innerHeight - 250) / 2));
setCanvasHeight(Math.round((window.innerHeight - 280) / 2));
setShowSingleGraph(false);
} else {
// not enough space to put 2 graphs
setShowSingleGraph(true);
setCanvasHeight(minCanvasHeightInner / 2);
setCanvasHeight((minCanvasHeightInner - 100) / 2);
}
}, []);
const siderProps = {