graflow: debugging autoplace on new links

This commit is contained in:
STEINNI
2026-03-15 18:41:40 +00:00
parent 46a344db74
commit bf30315217
2 changed files with 8 additions and 7 deletions

View File

@@ -669,7 +669,7 @@ class BZgraflow extends Buildoz{
linksWithoutBackEdges = this.flow.links linksWithoutBackEdges = this.flow.links
} }
const { parents, adj } = this.buildGraphStructures(this.flow.nodes, linksWithoutBackEdges) const { parents, adj } = this.buildGraphStructures(this.flow.nodes, linksWithoutBackEdges)
console.log('parents', parents)
const layers = this.computeLayers(this.flow.nodes, parents) const layers = this.computeLayers(this.flow.nodes, parents)
// Layer-0 nodes have no parents, so reorderLayers() (which uses parent ordering) cannot // 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 }) this.graflow.wiresContainer.querySelectorAll('.bzgf-wirecoat').forEach(el => { el.style.pointerEvents = value })
} }
//TODO: Check if autoplace sees the wiring changes !
pointerMove(e){ pointerMove(e){
if(!this.state) return if(!this.state) return
const { port } = this.state const { port } = this.state
@@ -1439,9 +1437,13 @@ class EditWires{
onKeyUp(e){ onKeyUp(e){
if((e.key == 'Delete') && this.currentlySelectedWire) { if((e.key == 'Delete') && this.currentlySelectedWire) {
this.graflow.flow.links = this.graflow.flow.links.filter(link => link.id != this.currentlySelectedWire.dataset.id) const wireId = this.currentlySelectedWire.dataset.id
this.graflow.stagedWires[this.currentlySelectedWire.dataset.id].remove() const linkToRemove = this.graflow.stagedWires[wireId]?.link
delete(this.graflow.stagedWires[this.currentlySelectedWire.dataset.id]) 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.remove()
this.currentlySelectedWire = null this.currentlySelectedWire = null
return return

View File

@@ -206,7 +206,6 @@
<div class="port" data-type="out" data-id="n" data-direction="n"></div> <div class="port" data-type="out" data-id="n" data-direction="n"></div>
<div class="port" data-type="out" data-id="e" data-direction="e"></div> <div class="port" data-type="out" data-id="e" data-direction="e"></div>
<div class="port" data-type="out" data-id="s" data-direction="s"></div> <div class="port" data-type="out" data-id="s" data-direction="s"></div>
</div> </div>
</template> </template>