nicer connectedness feedback
This commit is contained in:
parent
d5272e30f3
commit
52bfcc7ff4
3 changed files with 18 additions and 9 deletions
|
|
@ -445,14 +445,14 @@ export function VisualEditor({ast, setAST, rt, setRT, errors, setErrors}: Visual
|
||||||
arrow2SideMap.set(arrow.uid, [startSide, endSide]);
|
arrow2SideMap.set(arrow.uid, [startSide, endSide]);
|
||||||
}
|
}
|
||||||
if (startSide) {
|
if (startSide) {
|
||||||
const arrowConns = side2ArrowMap.get(startSide.uid) || new Set();
|
const arrowConns = side2ArrowMap.get(startSide.uid + '/' + startSide.part) || new Set();
|
||||||
arrowConns.add(["start", arrow.uid]);
|
arrowConns.add(["start", arrow.uid]);
|
||||||
side2ArrowMap.set(startSide.uid, arrowConns);
|
side2ArrowMap.set(startSide.uid + '/' + startSide.part, arrowConns);
|
||||||
}
|
}
|
||||||
if (endSide) {
|
if (endSide) {
|
||||||
const arrowConns = side2ArrowMap.get(endSide.uid) || new Set();
|
const arrowConns = side2ArrowMap.get(endSide.uid + '/' + endSide.part) || new Set();
|
||||||
arrowConns.add(["end", arrow.uid]);
|
arrowConns.add(["end", arrow.uid]);
|
||||||
side2ArrowMap.set(endSide.uid, arrowConns);
|
side2ArrowMap.set(endSide.uid + '/' + endSide.part, arrowConns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const text of state.texts) {
|
for (const text of state.texts) {
|
||||||
|
|
@ -495,12 +495,14 @@ export function VisualEditor({ast, setAST, rt, setRT, errors, setErrors}: Visual
|
||||||
for (const textUid of texts) {
|
for (const textUid of texts) {
|
||||||
textsToHighlight[textUid] = true;
|
textsToHighlight[textUid] = true;
|
||||||
}
|
}
|
||||||
const arrows = side2ArrowMap.get(selected.uid) || [];
|
for (const part of selected.parts) {
|
||||||
|
const arrows = side2ArrowMap.get(selected.uid + '/' + part) || [];
|
||||||
if (arrows) {
|
if (arrows) {
|
||||||
for (const [arrowPart, arrowUid] of arrows) {
|
for (const [arrowPart, arrowUid] of arrows) {
|
||||||
arrowsToHighlight[arrowUid] = true;
|
arrowsToHighlight[arrowUid] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const arrow2 = text2ArrowMap.get(selected.uid);
|
const arrow2 = text2ArrowMap.get(selected.uid);
|
||||||
if (arrow2) {
|
if (arrow2) {
|
||||||
arrowsToHighlight[arrow2] = true;
|
arrowsToHighlight[arrow2] = true;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
export const ARROW_SNAP_THRESHOLD = 20;
|
export const ARROW_SNAP_THRESHOLD = 20;
|
||||||
export const TEXT_SNAP_THRESHOLD = 30;
|
export const TEXT_SNAP_THRESHOLD = 40;
|
||||||
|
|
||||||
export const ROUNTANGLE_RADIUS = 20;
|
export const ROUNTANGLE_RADIUS = 20;
|
||||||
export const MIN_ROUNTANGLE_SIZE = { x: ROUNTANGLE_RADIUS*2, y: ROUNTANGLE_RADIUS*2 };
|
export const MIN_ROUNTANGLE_SIZE = { x: ROUNTANGLE_RADIUS*2, y: ROUNTANGLE_RADIUS*2 };
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,13 @@ export type RT_Statechart = {
|
||||||
// history: // TODO
|
// history: // TODO
|
||||||
} & RaisedEvents;
|
} & RaisedEvents;
|
||||||
|
|
||||||
|
export type BigStep = {
|
||||||
|
from: RT_Statechart;
|
||||||
|
to: RT_Statechart;
|
||||||
|
inputEvent: string;
|
||||||
|
outputEvents: string[];
|
||||||
|
}
|
||||||
|
|
||||||
export type RaisedEvents = {
|
export type RaisedEvents = {
|
||||||
internalEvents: string[];
|
internalEvents: string[];
|
||||||
outputEvents: string[];
|
outputEvents: string[];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue