aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/graph/GraphStore.ts
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/graph/GraphStore.ts')
-rw-r--r--subprojects/frontend/src/graph/GraphStore.ts16
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}