graflow: source grooming + demo panels subflow compatible
This commit is contained in:
18
bzGraflow.js
18
bzGraflow.js
@@ -288,7 +288,7 @@ class BZgraflow extends Buildoz{
|
||||
childEl.style.transform = 'none'
|
||||
childEl.style.willChange = ''
|
||||
this.dispatchEvent(new CustomEvent('subflowLoaded', {
|
||||
detail: { flowUrl },
|
||||
detail: { subflow: childEl },
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
}))
|
||||
@@ -366,7 +366,7 @@ class BZgraflow extends Buildoz{
|
||||
this.hostContainer.style.visibility = 'visible'
|
||||
childEl.style.willChange = ''
|
||||
this.dispatchEvent(new CustomEvent('subflowExited', {
|
||||
detail: { },
|
||||
detail: { subflow: childEl },
|
||||
bubbles: true,
|
||||
composed: true,
|
||||
}))
|
||||
@@ -611,11 +611,14 @@ class BZgraflow extends Buildoz{
|
||||
|
||||
// Compute indexes for each layer (int part) & add sub-index for ports
|
||||
// Also compute max width/height for each layer
|
||||
let maxHeight = 0; let maxWidth = 0
|
||||
const layerHeights = []; const layerWidths = [];
|
||||
let maxHeight = 0
|
||||
let maxWidth = 0
|
||||
const layerHeights = []
|
||||
const layerWidths = []
|
||||
const indexes = {} // indexes[nid] = { base: <int>, ports: { [portId]: <float in [0,1)> } }
|
||||
for(const layer of layers){
|
||||
let totHeight = 0; let totWidth = 0
|
||||
let totHeight = 0
|
||||
let totWidth = 0
|
||||
for(const [idx, nid] of layer.entries()){
|
||||
// Use offset* (not impacted by CSS transforms) to keep autoPlace stable during zoom animations.
|
||||
const bb = this.stagedNodes[nid].getBoundingClientRect()
|
||||
@@ -938,7 +941,7 @@ class BZgraflow extends Buildoz{
|
||||
if(links.some(l => l.from[0] === l.to[0])) return(true) // self-loops
|
||||
|
||||
const { adj } = this.buildGraphStructures(nodes, links)
|
||||
const visiting = new Set();
|
||||
const visiting = new Set()
|
||||
const visited = new Set()
|
||||
const dfs = (nid) => {
|
||||
if(visiting.has(nid)) {
|
||||
@@ -961,7 +964,8 @@ class BZgraflow extends Buildoz{
|
||||
|
||||
findBackEdges(nodes, links) {
|
||||
const { adj } = this.buildGraphStructures(nodes, links, true)
|
||||
const color = {}; nodes.forEach(n => color[n.id] = 'white')
|
||||
const color = {}
|
||||
nodes.forEach(n => color[n.id] = 'white')
|
||||
const backEdges = []
|
||||
|
||||
function dfs(u) {
|
||||
|
||||
Reference in New Issue
Block a user