From 5338a4c0219e4e738b93d4b1092f2d99f3b73dba Mon Sep 17 00:00:00 2001 From: STEINNI Date: Mon, 2 Mar 2026 19:07:06 +0000 Subject: [PATCH] graflow: autoplace attributes & better ICMP example --- bzGraflow.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bzGraflow.js b/bzGraflow.js index 3ceade5..ccca598 100644 --- a/bzGraflow.js +++ b/bzGraflow.js @@ -431,7 +431,7 @@ class BZgraflow extends Buildoz{ if(bb.width > bb.height) this.currentOrientation = 'horizontal' else this.currentOrientation = 'vertical' } - if(forceAutoplace) this.autoPlace(this.currentOrientation, 60, 60) + if(forceAutoplace) this.autoPlace(this.currentOrientation) } // Convert viewport (client) coordinates to this instance's SVG local coordinates. @@ -604,7 +604,14 @@ class BZgraflow extends Buildoz{ return(path) } - autoPlace(orientation = 'horizontal', gapx = 80, gapy = 80, tween=500, align='center'){ + autoPlace(orientation = 'horizontal', gapx = null, gapy = null, tween = null, align = null){ + if(gapx == null) gapx = parseInt(this.getBZAttribute('gapx')) || 80 + if(gapy == null) gapy = parseInt(this.getBZAttribute('gapy')) || 80 + if(tween == null) tween = parseInt(this.getBZAttribute('tween')) || 500 + if(align == null) align = this.getBZAttribute('align') || 'center' + + console.log('autoPlace', orientation, gapx, gapy, tween, align) + this.currentOrientation = orientation // Cancel any previous autoPlace() animations by bumping a token. // moveNode() checks this token each frame and will no-op if superseded.