remove dependency on MUI

This commit is contained in:
Joeri Exelmans 2025-10-24 11:09:21 +02:00
parent 74f4c3bead
commit 3e192f8e26
8 changed files with 72 additions and 44 deletions

View file

@ -13,6 +13,7 @@ export type Connections = {
}
export function detectConnections(state: VisualEditorState): Connections {
const startTime = performance.now();
// detect what is 'connected'
const arrow2SideMap = new Map<string,[{ uid: string; part: RectSide; } | undefined, { uid: string; part: RectSide; } | undefined]>();
const side2ArrowMap = new Map<string, Set<["start"|"end", string]>>();
@ -72,6 +73,11 @@ export function detectConnections(state: VisualEditorState): Connections {
}
}
const endTime = performance.now();
// rather slow, about 10ms for a large model:
// console.debug("connection detection took", endTime-startTime);
return {
arrow2SideMap,
side2ArrowMap,

View file

@ -78,6 +78,8 @@ export function parseStatechart(state: VisualEditorState, conns: Connections): [
// step 1: figure out state hierarchy
const startTime = performance.now();
// IMPORTANT ASSUMPTION: state.rountangles is sorted from big to small surface area:
for (const rt of state.rountangles) {
const parent = findParent(rt);
@ -132,6 +134,11 @@ export function parseStatechart(state: VisualEditorState, conns: Connections): [
historyStates.push(historyState);
}
const endTime = performance.now();
// currently seems to be quite fast:
// console.log('built state tree', endTime-startTime);
// step 2: figure out transitions
const transitions = new Map<string, Transition[]>();