From a49083f31679c47e1685e0cedbc9a40cc8f48fd8 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 26 Aug 2023 21:44:58 +0200 Subject: refactor(frontent): improve graph drawing --- subprojects/frontend/src/editor/EditorStore.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'subprojects/frontend/src/editor/EditorStore.ts') diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index 10f01099..b5989ad1 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts @@ -26,6 +26,7 @@ import { makeAutoObservable, observable, runInAction } from 'mobx'; import { nanoid } from 'nanoid'; import type PWAStore from '../PWAStore'; +import GraphStore from '../graph/GraphStore'; import getLogger from '../utils/getLogger'; import type XtextClient from '../xtext/XtextClient'; import type { SemanticsSuccessResult } from '../xtext/xtextServiceResults'; @@ -66,7 +67,7 @@ export default class EditorStore { semanticsError: string | undefined; - semantics: SemanticsSuccessResult | undefined; + graph: GraphStore; constructor(initialValue: string, pwaStore: PWAStore) { this.id = nanoid(); @@ -86,12 +87,12 @@ export default class EditorStore { })().catch((error) => { log.error('Failed to load XtextClient', error); }); + this.graph = new GraphStore(); makeAutoObservable(this, { id: false, state: observable.ref, client: observable.ref, view: observable.ref, - semantics: observable.ref, searchPanel: false, lintPanel: false, contentAssist: false, @@ -298,7 +299,7 @@ export default class EditorStore { setSemantics(semantics: SemanticsSuccessResult) { this.semanticsError = undefined; - this.semantics = semantics; + this.graph.setSemantics(semantics); } dispose(): void { -- cgit v1.2.3-54-g00ecf