diff options
author | 2023-08-30 22:14:50 +0200 | |
---|---|---|
committer | 2023-08-31 00:57:52 +0200 | |
commit | d4504285d15aeb0cb1560a5f522ac1edc02b7d4c (patch) | |
tree | f279dd795fc715c31ebb3b46a45e8ab12ac6d8e2 /subprojects/frontend/src/graph | |
parent | feat(frontend): window pane switcher (diff) | |
download | refinery-d4504285d15aeb0cb1560a5f522ac1edc02b7d4c.tar.gz refinery-d4504285d15aeb0cb1560a5f522ac1edc02b7d4c.tar.zst refinery-d4504285d15aeb0cb1560a5f522ac1edc02b7d4c.zip |
feat(frontend): implement grid view
Diffstat (limited to 'subprojects/frontend/src/graph')
-rw-r--r-- | subprojects/frontend/src/graph/GraphStore.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/subprojects/frontend/src/graph/GraphStore.ts b/subprojects/frontend/src/graph/GraphStore.ts index f81b4db4..50cb8c19 100644 --- a/subprojects/frontend/src/graph/GraphStore.ts +++ b/subprojects/frontend/src/graph/GraphStore.ts | |||
@@ -61,6 +61,8 @@ export default class GraphStore { | |||
61 | 61 | ||
62 | abbreviate = true; | 62 | abbreviate = true; |
63 | 63 | ||
64 | selectedSymbol: RelationMetadata | undefined; | ||
65 | |||
64 | constructor() { | 66 | constructor() { |
65 | makeAutoObservable(this, { | 67 | makeAutoObservable(this, { |
66 | semantics: observable.ref, | 68 | semantics: observable.ref, |
@@ -143,6 +145,19 @@ export default class GraphStore { | |||
143 | this.abbreviate = !this.abbreviate; | 145 | this.abbreviate = !this.abbreviate; |
144 | } | 146 | } |
145 | 147 | ||
148 | setSelectedSymbol(option: RelationMetadata | undefined): void { | ||
149 | if (option === undefined) { | ||
150 | this.selectedSymbol = undefined; | ||
151 | return; | ||
152 | } | ||
153 | const metadata = this.relationMetadata.get(option.name); | ||
154 | if (metadata !== undefined) { | ||
155 | this.selectedSymbol = metadata; | ||
156 | } else { | ||
157 | this.selectedSymbol = undefined; | ||
158 | } | ||
159 | } | ||
160 | |||
146 | setSemantics(semantics: SemanticsSuccessResult) { | 161 | setSemantics(semantics: SemanticsSuccessResult) { |
147 | this.semantics = semantics; | 162 | this.semantics = semantics; |
148 | this.relationMetadata.clear(); | 163 | this.relationMetadata.clear(); |
@@ -161,5 +176,6 @@ export default class GraphStore { | |||
161 | toRemove.forEach((key) => { | 176 | toRemove.forEach((key) => { |
162 | this.visibility.delete(key); | 177 | this.visibility.delete(key); |
163 | }); | 178 | }); |
179 | this.setSelectedSymbol(this.selectedSymbol); | ||
164 | } | 180 | } |
165 | } | 181 | } |