more command generator bug fixes

This commit is contained in:
Sam Lavigne 2023-09-01 16:37:39 -04:00
parent 5b4ce1fe26
commit 4552ff5b51
1 changed files with 11 additions and 6 deletions

View File

@ -55,7 +55,8 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
// create edge labels for each filter // create edge labels for each filter
function traverseEdges(edg, type) { function traverseEdges(edg, type) {
const outEdges = $edges.filter((e) => e.source === edg.target && (e.sourceHandle.includes(type) || e.sourceHandle.includes("n"))); // const outEdges = $edges.filter((e) => e.source === edg.target && (e.sourceHandle.includes(type) || e.sourceHandle.includes("n")));
const outEdges = $edges.filter((e) => e.source === edg.target);
let label; let label;
@ -102,17 +103,21 @@ export const previewCommand = derived([edges, nodes], ([$edges, $nodes]) => {
for (let i of ins) { for (let i of ins) {
const eid = edgeIds[i.id]; const eid = edgeIds[i.id];
if (typeof eid == "string" && eid.includes(":")) cmd.weight = -1000; if (eid) {
cmd.in.push(eid); if (typeof eid == "string" && eid.includes(":")) cmd.weight = -1000;
cmd.in.push(eid);
}
} }
cmd.cmd = makeFilterArgs(n.data); cmd.cmd = makeFilterArgs(n.data);
for (let o of outs) { for (let o of outs) {
const eid = edgeIds[o.id]; const eid = edgeIds[o.id];
if (typeof eid == "string" && eid.includes("out")) cmd.weight = 1000; if (eid) {
else cmd.weight = eid; if (typeof eid == "string" && eid.includes("out")) cmd.weight = 1000;
cmd.out.push(eid); else cmd.weight = eid;
cmd.out.push(eid);
}
} }
filtergraph.push(cmd); filtergraph.push(cmd);