From 96d4e9e7e76b95e82bf6b50ebc840182ee223927 Mon Sep 17 00:00:00 2001 From: Tuan Cao Date: Mon, 18 Apr 2022 22:43:39 +0700 Subject: [PATCH] Support Responsive layout (missed commit) --- components/Graph.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/Graph.js b/components/Graph.js index d87ff82..5b81886 100644 --- a/components/Graph.js +++ b/components/Graph.js @@ -57,8 +57,8 @@ const styleSheet = [{ function Graph({graph}) { - const [width, setWith] = useState("400px"); - const [height, setHeight] = useState("400px"); + const [width, setWidth] = useState("300px"); + const [height, setHeight] = useState("300px"); const [graphData, setGraphData] = useState({ nodes: graph.nodes, edges: graph.edges @@ -66,9 +66,12 @@ function Graph({graph}) { let myCyRef; const router = useRouter() + //TODO: Listen to query change/ graphdata change to update state of this component + // Can use this: https://github.com/vercel/next.js/discussions/12661 + return ( <> -
+

Links to this notes