aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/graph/ExportSettingsStore.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/graph/ExportSettingsStore.tsx')
-rw-r--r--subprojects/frontend/src/graph/ExportSettingsStore.tsx46
1 files changed, 46 insertions, 0 deletions
diff --git a/subprojects/frontend/src/graph/ExportSettingsStore.tsx b/subprojects/frontend/src/graph/ExportSettingsStore.tsx
new file mode 100644
index 00000000..8ee91b73
--- /dev/null
+++ b/subprojects/frontend/src/graph/ExportSettingsStore.tsx
@@ -0,0 +1,46 @@
1/*
2 * SPDX-FileCopyrightText: 2024 The Refinery Authors <https://refinery.tools/>
3 *
4 * SPDX-License-Identifier: EPL-2.0
5 */
6
7import { makeAutoObservable } from 'mobx';
8
9export type ExportFormat = 'svg' | 'png';
10export type ExportTheme = 'light' | 'dark';
11
12export default class ExportSettingsStore {
13 format: ExportFormat = 'svg';
14
15 theme: ExportTheme = 'light';
16
17 transparent = true;
18
19 embedFonts = false;
20
21 scale = 100;
22
23 constructor() {
24 makeAutoObservable(this);
25 }
26
27 setFormat(format: ExportFormat): void {
28 this.format = format;
29 }
30
31 setTheme(theme: ExportTheme): void {
32 this.theme = theme;
33 }
34
35 toggleTransparent(): void {
36 this.transparent = !this.transparent;
37 }
38
39 toggleEmbedFonts(): void {
40 this.embedFonts = !this.embedFonts;
41 }
42
43 setScale(scale: number): void {
44 this.scale = scale;
45 }
46}