aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/graph/ZoomButtons.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/graph/ZoomButtons.tsx')
-rw-r--r--subprojects/frontend/src/graph/ZoomButtons.tsx43
1 files changed, 43 insertions, 0 deletions
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 @@
1/*
2 * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
7import AddIcon from '@mui/icons-material/Add';
8import CropFreeIcon from '@mui/icons-material/CropFree';
9import RemoveIcon from '@mui/icons-material/Remove';
10import IconButton from '@mui/material/IconButton';
11import Stack from '@mui/material/Stack';
12
13export default function ZoomButtons({
14 changeZoom,
15 fitZoom,
16}: {
17 changeZoom: (event: React.MouseEvent, factor: number) => void;
18 fitZoom: (event: React.MouseEvent) => void;
19}): JSX.Element {
20 return (
21 <Stack
22 direction="column"
23 p={1}
24 sx={{ position: 'absolute', bottom: 0, right: 0 }}
25 >
26 <IconButton
27 aria-label="Zoom in"
28 onClick={(event) => changeZoom(event, 2)}
29 >
30 <AddIcon fontSize="small" />
31 </IconButton>
32 <IconButton
33 aria-label="Zoom out"
34 onClick={(event) => changeZoom(event, 0.5)}
35 >
36 <RemoveIcon fontSize="small" />
37 </IconButton>
38 <IconButton aria-label="Fit screen" onClick={fitZoom}>
39 <CropFreeIcon fontSize="small" />
40 </IconButton>
41 </Stack>
42 );
43}