diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-01-03 18:38:22 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-01-03 21:14:04 +0100 |
commit | baa28c9d6b6562a54eee0ad726e22d1b8811751b (patch) | |
tree | 76daca5944872f0b21d6cef472c5cb0b393dff8b /subprojects/frontend/src/graph/GraphStore.ts | |
parent | refactor(web): subtler error predicate highlight (diff) | |
download | refinery-baa28c9d6b6562a54eee0ad726e22d1b8811751b.tar.gz refinery-baa28c9d6b6562a54eee0ad726e22d1b8811751b.tar.zst refinery-baa28c9d6b6562a54eee0ad726e22d1b8811751b.zip |
feat(web): toggle identifier coloring
Diffstat (limited to 'subprojects/frontend/src/graph/GraphStore.ts')
-rw-r--r-- | subprojects/frontend/src/graph/GraphStore.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/subprojects/frontend/src/graph/GraphStore.ts b/subprojects/frontend/src/graph/GraphStore.ts index ecb016b5..58c4422d 100644 --- a/subprojects/frontend/src/graph/GraphStore.ts +++ b/subprojects/frontend/src/graph/GraphStore.ts | |||
@@ -1,11 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/> | 2 | * SPDX-FileCopyrightText: 2023-2024 The Refinery Authors <https://refinery.tools/> |
3 | * | 3 | * |
4 | * SPDX-License-Identifier: EPL-2.0 | 4 | * SPDX-License-Identifier: EPL-2.0 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | import { makeAutoObservable, observable } from 'mobx'; | 7 | import { makeAutoObservable, observable } from 'mobx'; |
8 | 8 | ||
9 | import type EditorStore from '../editor/EditorStore'; | ||
9 | import type { | 10 | import type { |
10 | RelationMetadata, | 11 | RelationMetadata, |
11 | SemanticsSuccessResult, | 12 | SemanticsSuccessResult, |
@@ -65,8 +66,9 @@ export default class GraphStore { | |||
65 | 66 | ||
66 | selectedSymbol: RelationMetadata | undefined; | 67 | selectedSymbol: RelationMetadata | undefined; |
67 | 68 | ||
68 | constructor() { | 69 | constructor(private readonly editorStore: EditorStore) { |
69 | makeAutoObservable(this, { | 70 | makeAutoObservable<GraphStore, 'editorStore'>(this, { |
71 | editorStore: false, | ||
70 | semantics: observable.ref, | 72 | semantics: observable.ref, |
71 | }); | 73 | }); |
72 | } | 74 | } |
@@ -184,4 +186,8 @@ export default class GraphStore { | |||
184 | }); | 186 | }); |
185 | this.setSelectedSymbol(this.selectedSymbol); | 187 | this.setSelectedSymbol(this.selectedSymbol); |
186 | } | 188 | } |
189 | |||
190 | get colorNodes(): boolean { | ||
191 | return this.editorStore.colorIdentifiers; | ||
192 | } | ||
187 | } | 193 | } |