From 8e62a91601a2b9782db952fe6a8e64ef153c3288 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Sun, 25 Jul 2021 02:17:34 +0200
Subject: 3d's back baby

---
 pages/index.tsx | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index a60ecd5..22adb3f 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -205,7 +205,7 @@ export function GraphPage() {
   }
 
   return (
-    <div>
+    <Box display="flex" justifyContent="space-between">
       {showTweaks ? (
         <Tweaks
           {...{
@@ -229,6 +229,17 @@ export function GraphPage() {
           />
         </Box>
       )}
+      <Button
+        position="absolute"
+        marginRight="2%"
+        marginTop="2%"
+        zIndex="overlay"
+        marginLeft="95%"
+        onClick={() => setThreeDim(!threeDim)}
+        colorScheme="purple"
+      >
+        {threeDim ? '3D' : '2D'}{' '}
+      </Button>
       <Graph
         nodeById={nodeByIdRef.current!}
         linksByNodeId={linksByNodeIdRef.current!}
@@ -240,7 +251,7 @@ export function GraphPage() {
           filter,
         }}
       />
-    </div>
+    </Box>
   )
 }
 
@@ -357,13 +368,13 @@ export interface TweakProps {
   physics: typeof initialPhysics
   setPhysics: any
   threeDim: boolean
-  setTreedim: (boolean) => void
+  setThreedim: (boolean) => void
   filter: typeof initialFilter
   setFilter: any
   onClose: () => void
 }
 export const Tweaks = (props: TweakProps) => {
-  const { physics, setPhysics, threeDim, setThreeDim, filter, setFilter, onClose } = props
+  const { physics, setPhysics, threeDim, filter, setFilter, onClose } = props
   return (
     <Box
       zIndex="overlay"
-- 
cgit v1.2.3

