From e08c381e0da1d19ae773878cd729675d787d2f00 Mon Sep 17 00:00:00 2001 From: 1ilit Date: Tue, 19 Sep 2023 15:46:56 +0300 Subject: [PATCH] i want something yummy --- src/editor/index.jsx | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/editor/index.jsx b/src/editor/index.jsx index 1b34456..2a237fb 100644 --- a/src/editor/index.jsx +++ b/src/editor/index.jsx @@ -90,7 +90,6 @@ function Diagram(props) { const canvas = useRef(null); useEffect(() => { - // const graph = new dia.Graph(); new dia.Paper({ el: document.getElementById("canvas"), background: { @@ -102,20 +101,6 @@ function Diagram(props) { gridSize: 1, interactive: true, }); - - const rect = new shapes.standard.Rectangle(); - rect.position(100, 100); - rect.resize(100, 40); - rect.attr({ - body: { - fill: "#7039FF", - }, - label: { - text: "hi", - fill: "white", - }, - }); - rect.addTo(props.graph); }); return
; @@ -124,6 +109,8 @@ function Diagram(props) { export default function Editor(props) { const graph = useMemo(() => new dia.Graph(), []); const [editor, setEditor] = useState(true); + const [code, setCode] = useState(""); + useEffect(() => {}, [graph]); return ( <> @@ -146,7 +133,7 @@ export default function Editor(props) { > change view - +
{editor ? (