Make windows

This commit is contained in:
1ilit
2023-09-19 15:46:44 +03:00
parent 990016b036
commit e65905cd3e
4 changed files with 59 additions and 6 deletions

View File

@@ -1,9 +1,27 @@
import './App.css';
import Diagram from './diagram';
import Diagram from "./diagram";
import { ResizableBox } from "react-resizable";
import "react-resizable/css/styles.css";
function App() {
return (
<Diagram/>
<div className="flex">
<ResizableBox
width={window.innerWidth * 0.2}
height={window.innerHeight}
resizeHandles={["e"]}
minConstraints={[window.innerWidth * 0.2, window.innerHeight]}
axis="x"
>
<span className="text">window 1</span>
</ResizableBox>
<ResizableBox
width={window.innerWidth * 0.8}
height={window.innerHeight}
resizeHandles={[]}
>
<Diagram />
</ResizableBox>
</div>
);
}

View File

@@ -13,8 +13,8 @@ function Diagram() {
color: "#F1F92A",
},
model: graph,
height: window.height,
width: window.width,
height: window.innerHeight,
width: "100%",
gridSize: 1,
interactive: true,
});
@@ -36,7 +36,7 @@ function Diagram() {
return (
<>
<div id="canvas" className="h-screen w-screen" ref={canvas} />
<div id="canvas" className="max-w-full h-full" ref={canvas} />
</>
);
}