clean up styling

This commit is contained in:
ari committed 2021-12-25 17:06:49 -05:00
1 parent 0aff219645
commit 9d8cc9ed3e
14 files changed
+156 -80

No files matched your search

@@ -4,12 +4,9 @@ import { Point } from "types/graphs";
import { makeUpdater, Updater } from './updater';
import { ChooseAction } from 'types/automations/actions';
import { AutomationCondition } from "types/automations/conditions";
import { ModalState } from "./types";
import { UpdateModalState } from "./types";
import { offsetPoint, makeOffsetMaintainer} from "utils/graph";
export type UpdateModalState = (
s: ModalState
) => void;
@@ -146,8 +143,19 @@ export function* computeNodesEdgesPos(
onChange: (s: AutomationSequenceNode[]) => void,
openModal: UpdateModalState,
): Generator<DAGElement> {
const rootUpdater = makeUpdater(sequence, onChange);
const offset = makeOffsetMaintainer(startPoint)
const rootUpdater = makeUpdater(sequence, onChange, openModal);
const offset = makeOffsetMaintainer(startPoint);
if (sequence.length === 0) {
yield {
type: "circle",
icon: 'add',
loc: offsetPoint(startPoint, [offset.x, 0]),
onAdd: rootUpdater.addNode,
}
return
}
let lastNodeLoc: Point | null = null;
for (let i = 0; i < sequence.length; i++) {
offset.setI(i)