From 2e2ebbf75b12784ac664d864865f01729b3eb8c4 Mon Sep 17 00:00:00 2001
From: Kristóf Marussy <kristof@marussy.com>
Date: Thu, 24 Aug 2023 00:06:37 +0200
Subject: refactor(web): clean up graphviz visualization

---
 subprojects/frontend/src/graph/ZoomButtons.tsx | 43 ++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 subprojects/frontend/src/graph/ZoomButtons.tsx

(limited to 'subprojects/frontend/src/graph/ZoomButtons.tsx')

diff --git a/subprojects/frontend/src/graph/ZoomButtons.tsx b/subprojects/frontend/src/graph/ZoomButtons.tsx
new file mode 100644
index 00000000..72f54774
--- /dev/null
+++ b/subprojects/frontend/src/graph/ZoomButtons.tsx
@@ -0,0 +1,43 @@
+/*
+ * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+import AddIcon from '@mui/icons-material/Add';
+import CropFreeIcon from '@mui/icons-material/CropFree';
+import RemoveIcon from '@mui/icons-material/Remove';
+import IconButton from '@mui/material/IconButton';
+import Stack from '@mui/material/Stack';
+
+export default function ZoomButtons({
+  changeZoom,
+  fitZoom,
+}: {
+  changeZoom: (event: React.MouseEvent, factor: number) => void;
+  fitZoom: (event: React.MouseEvent) => void;
+}): JSX.Element {
+  return (
+    <Stack
+      direction="column"
+      p={1}
+      sx={{ position: 'absolute', bottom: 0, right: 0 }}
+    >
+      <IconButton
+        aria-label="Zoom in"
+        onClick={(event) => changeZoom(event, 2)}
+      >
+        <AddIcon fontSize="small" />
+      </IconButton>
+      <IconButton
+        aria-label="Zoom out"
+        onClick={(event) => changeZoom(event, 0.5)}
+      >
+        <RemoveIcon fontSize="small" />
+      </IconButton>
+      <IconButton aria-label="Fit screen" onClick={fitZoom}>
+        <CropFreeIcon fontSize="small" />
+      </IconButton>
+    </Stack>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

