graflow: debugging autoplace on new links
This commit is contained in:
14
bzGraflow.js
14
bzGraflow.js
@@ -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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user