diff --git a/bzGraflow.js b/bzGraflow.js index 4659363..14c938e 100644 --- a/bzGraflow.js +++ b/bzGraflow.js @@ -669,7 +669,7 @@ class BZgraflow extends Buildoz{ linksWithoutBackEdges = this.flow.links } const { parents, adj } = this.buildGraphStructures(this.flow.nodes, linksWithoutBackEdges) - +console.log('parents', parents) const layers = this.computeLayers(this.flow.nodes, parents) // Layer-0 nodes have no parents, so reorderLayers() (which uses parent ordering) cannot @@ -1376,8 +1376,6 @@ class EditWires{ this.graflow.wiresContainer.querySelectorAll('.bzgf-wirecoat').forEach(el => { el.style.pointerEvents = value }) } -//TODO: Check if autoplace sees the wiring changes ! - pointerMove(e){ if(!this.state) return const { port } = this.state @@ -1439,9 +1437,13 @@ class EditWires{ onKeyUp(e){ if((e.key == 'Delete') && this.currentlySelectedWire) { - this.graflow.flow.links = this.graflow.flow.links.filter(link => link.id != this.currentlySelectedWire.dataset.id) - this.graflow.stagedWires[this.currentlySelectedWire.dataset.id].remove() - delete(this.graflow.stagedWires[this.currentlySelectedWire.dataset.id]) + const wireId = this.currentlySelectedWire.dataset.id + const linkToRemove = this.graflow.stagedWires[wireId]?.link + this.graflow.flow.links = this.graflow.flow.links.filter(link => + linkToRemove ? link !== linkToRemove : (link.from[0] + '_' + link.to[0] !== wireId) + ) + this.graflow.stagedWires[wireId]?.remove() + delete this.graflow.stagedWires[wireId] this.currentlySelectedWire.remove() this.currentlySelectedWire = null return diff --git a/graflow_examples/nodesLib/nodesTest1.html b/graflow_examples/nodesLib/nodesTest1.html index fd7e277..e52008f 100644 --- a/graflow_examples/nodesLib/nodesTest1.html +++ b/graflow_examples/nodesLib/nodesTest1.html @@ -206,7 +206,6 @@
-