diff options
author | 2024-02-23 19:03:03 +0100 | |
---|---|---|
committer | 2024-02-23 19:13:23 +0100 | |
commit | cf07f20847642aec1eafe6234c2ce35264bbaabb (patch) | |
tree | 3d89fbd37db49f815eba4215dfc3d3800ff93970 /subprojects/frontend/src/graph/ExportSettingsStore.tsx | |
parent | feat(frontend): add top bar logo (diff) | |
download | refinery-cf07f20847642aec1eafe6234c2ce35264bbaabb.tar.gz refinery-cf07f20847642aec1eafe6234c2ce35264bbaabb.tar.zst refinery-cf07f20847642aec1eafe6234c2ce35264bbaabb.zip |
feat(frontend): graph export formal selector
Diffstat (limited to 'subprojects/frontend/src/graph/ExportSettingsStore.tsx')
-rw-r--r-- | subprojects/frontend/src/graph/ExportSettingsStore.tsx | 46 |
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 | |||
7 | import { makeAutoObservable } from 'mobx'; | ||
8 | |||
9 | export type ExportFormat = 'svg' | 'png'; | ||
10 | export type ExportTheme = 'light' | 'dark'; | ||
11 | |||
12 | export 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 | } | ||