Fix canvas graphs height
This commit is contained in:
parent
598f77f73f
commit
17cb793db8
|
@ -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,
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in New Issue