From f5fbdd6ccd78ed8f09a289da4dde60df133ef822 Mon Sep 17 00:00:00 2001 From: STEINNI Date: Mon, 2 Mar 2026 18:27:15 +0000 Subject: [PATCH] graflow: fix1 to ortho wires --- app/assets/html/bzGraflow/nodesEIC2.html | 85 +++++++++++ app/assets/html/test.html | 1 + app/assets/html/test1.html | 9 +- app/assets/html/test2.html | 9 +- app/assets/html/test3.html | 8 + app/assets/html/test4.5.html | 98 ++++++++++++ app/assets/html/test4.html | 9 +- app/assets/html/test5.html | 5 +- app/assets/json/bzGraflow/testFlowICMP2.json | 150 +++++++++++++++++++ app/thirdparty/buildoz/bzGraflow.js | 24 ++- 10 files changed, 387 insertions(+), 11 deletions(-) create mode 100644 app/assets/html/bzGraflow/nodesEIC2.html create mode 100644 app/assets/html/test4.5.html create mode 100644 app/assets/json/bzGraflow/testFlowICMP2.json diff --git a/app/assets/html/bzGraflow/nodesEIC2.html b/app/assets/html/bzGraflow/nodesEIC2.html new file mode 100644 index 0000000..d18a263 --- /dev/null +++ b/app/assets/html/bzGraflow/nodesEIC2.html @@ -0,0 +1,85 @@ + + + + + + + \ No newline at end of file diff --git a/app/assets/html/test.html b/app/assets/html/test.html index d6cefd0..3b5b730 100644 --- a/app/assets/html/test.html +++ b/app/assets/html/test.html @@ -12,6 +12,7 @@
  • test2 (organigram) + ISOLATED
  • test3 (EIC simple + subflow + NON-ISOLATED)
  • test4 (EIC-ICMP + NON-ISOLATED)
  • +
  • test4.5 (EIC-ICMP + NON-ISOLATED + single-port)
  • test5 (P42 graph + ISOLATED + EDITABLE)
  • diff --git a/app/assets/html/test1.html b/app/assets/html/test1.html index e2e8978..bdc1f2a 100644 --- a/app/assets/html/test1.html +++ b/app/assets/html/test1.html @@ -65,10 +65,12 @@ document.querySelector('[data-trigger="onAutoplace1V"]').addEventListener('click', (evt) => { grflw1.autoPlace('vertical', 80, 30, 1000, document.querySelector('[data-id="compunet"]').value) } ) - document.querySelector('input[data-id="compunet"]').addEventListener('change', (evt) => { grflw1.setAttribute('tension', evt.target.value); grflw1.refresh() } ) + document.querySelector('select[name="wiretype"]').addEventListener('change', + (evt) => { grflw1.setAttribute('wiretype', evt.target.value); grflw1.refresh() } + ) }) @@ -84,6 +86,11 @@ +
    diff --git a/app/assets/html/test2.html b/app/assets/html/test2.html index 08cbab4..d1f61ef 100644 --- a/app/assets/html/test2.html +++ b/app/assets/html/test2.html @@ -65,10 +65,12 @@ document.querySelector('[data-trigger="onAutoplace3V"]').addEventListener('click', (evt) => { grflw3.autoPlace('vertical', 80, 30, 1000, document.querySelector('[data-id="organi"]').value) } ) - document.querySelector('input[data-id="organi"]').addEventListener('change', (evt) => { grflw3.setAttribute('tension', evt.target.value); grflw3.refresh() } ) + document.querySelector('select[name="wiretype"]').addEventListener('change', + (evt) => { grflw3.setAttribute('wiretype', evt.target.value); grflw3.refresh() } + ) }) @@ -84,6 +86,11 @@ +
    diff --git a/app/assets/html/test3.html b/app/assets/html/test3.html index 74c49cc..bb6f3c4 100644 --- a/app/assets/html/test3.html +++ b/app/assets/html/test3.html @@ -68,6 +68,9 @@ document.querySelector('input[data-id="eic"]').addEventListener('change', (evt) => { grflw2.setAttribute('tension', evt.target.value); grflw2.refresh() } ) + document.querySelector('select[name="wiretype"]').addEventListener('change', + (evt) => { grflw2.setAttribute('wiretype', evt.target.value); grflw2.refresh() } + ) }) @@ -83,6 +86,11 @@ +
    diff --git a/app/assets/html/test4.5.html b/app/assets/html/test4.5.html new file mode 100644 index 0000000..af7db68 --- /dev/null +++ b/app/assets/html/test4.5.html @@ -0,0 +1,98 @@ + + + + graflow + + + + + + + + + + + + +
    + + + + +
    +
    +
    + + diff --git a/app/assets/html/test4.html b/app/assets/html/test4.html index 3f5752c..f633b10 100644 --- a/app/assets/html/test4.html +++ b/app/assets/html/test4.html @@ -65,10 +65,12 @@ document.querySelector('[data-trigger="onAutoplace4V"]').addEventListener('click', (evt) => { grflw4.autoPlace('vertical', 80, 80, 1000, document.querySelector('[data-id="icmp"]').value) } ) - document.querySelector('input[data-id="icmp"]').addEventListener('change', (evt) => { grflw4.setAttribute('tension', evt.target.value); grflw4.refresh() } ) + document.querySelector('select[name="wiretype"]').addEventListener('change', + (evt) => { grflw4.setAttribute('wiretype', evt.target.value); grflw4.refresh() } + ) }) @@ -84,6 +86,11 @@ +
    diff --git a/app/assets/html/test5.html b/app/assets/html/test5.html index 9ee3fc1..01036ee 100644 --- a/app/assets/html/test5.html +++ b/app/assets/html/test5.html @@ -65,12 +65,11 @@ document.querySelector('[data-trigger="onAutoplace1V"]').addEventListener('click', (evt) => { grflw1.autoPlace('vertical', 80, 30, 1000, document.querySelector('[data-id="compunet"]').value) } ) - document.querySelector('input[data-id="compunet"]').addEventListener('change', (evt) => { grflw1.setAttribute('tension', evt.target.value); grflw1.refresh() } ) document.querySelector('select[name="wiretype"]').addEventListener('change', - (evt) => { grflw1.setAttribute('wiretype', evt.target.value); console.log('wiretype changed to', evt.target.value); grflw1.refresh() } + (evt) => { grflw1.setAttribute('wiretype', evt.target.value); grflw1.refresh() } ) }) @@ -87,7 +86,7 @@ - diff --git a/app/assets/json/bzGraflow/testFlowICMP2.json b/app/assets/json/bzGraflow/testFlowICMP2.json new file mode 100644 index 0000000..392c61d --- /dev/null +++ b/app/assets/json/bzGraflow/testFlowICMP2.json @@ -0,0 +1,150 @@ +{ + "nodesFile": "/app/assets/html/bzGraflow/nodesEIC2.html", + "flow": { + "nodes":[ + { "nodeType": "eicBasic", + "id": "eval", + "markup": { + "title": "Evaluations", + "subtitle": "...", + "severity": "secondary" + }, + "data": { "node": "eval", "nodeId":null} + }, + { "nodeType": "eicBasic", + "id": "gap", + "ncoords": { "x": 100, "y": 220}, + "markup": { + "title": "GAP", + "subtitle": "...", + "severity": "secondary" + }, + "data": { "a": "a2", "b":"b2"} + }, + { "nodeType": "eicBasic", + "id": "cid", + "ncoords": { "x": 150, "y": 320}, + "markup": { + "title": "CID", + "subtitle": "...", + "severity": "secondary" + }, + "data": { "a": "a3", "b":"b3"} + }, + { + "nodeType": "eicBasic", + "id": "allocation", + "markup": { + "title": "Case Allocation", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity" + } + }, + { + "nodeType": "eicBasic", + "id": "signature", + "markup": { + "title": "Grant Signature", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "grant" + } + }, + { + "nodeType": "eicBasic", + "id": "progress-meeting", + "markup": { + "title": "Progress Meetings", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "grant", + "instanciable": true + } + }, + { + "nodeType": "eicBasic", + "id": "techdd", + "markup": { + "title": "Tech Due Diligences", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity" + } + }, + { + "nodeType": "eicBasic", + "id": "kyc", + "markup": { + "title": "KYC", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity" + } + }, + { + "nodeType": "eicBasic", + "id": "aifm-advisory", + "markup": { + "title": "AIFM Advisory Commitee", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity" + } + }, + { + "nodeType": "eicBasic", + "id": "aifm-investment", + "markup": { + "title": "AIFM Investment Commitee", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity", + "parent": "aifm-advisory" + } + }, + { + "nodeType": "eicBasic", + "id": "agreement", + "markup": { + "title": "Investment Agreement", + "subtitle": "...", + "severity": "secondary" + }, + "data": { + "track": "equity", + "parent": "aifm-investment" + } + } + ], + "links": [ + { "from": ["eval", "out1"], "to": ["gap", "in1"] }, + { "from": ["eval", "out1"], "to": ["cid", "in1"] }, + { "from": ["eval", "out1"], "to": ["allocation", "in1"] }, + { "from": ["gap", "out1"], "to": ["signature", "in1"] }, + { "from": ["signature", "out1"], "to": ["progress-meeting", "in1"] }, + { "from": ["cid", "out1"], "to": ["techdd", "in1"] }, + { "from": ["allocation", "out1"], "to": ["techdd", "in1"] }, + { "from": ["allocation", "out1"], "to": ["kyc", "in1"] }, + { "from": ["techdd", "out1"], "to": ["aifm-advisory", "in1"] }, + { "from": ["kyc", "out1"], "to": ["aifm-advisory", "in1"] }, + { "from": ["aifm-advisory", "out1"], "to": ["aifm-investment", "in1"] }, + { "from": ["aifm-investment", "out1"], "to": ["agreement", "in1"] }, + { "from": ["gap", "out1"], "to": ["aifm-investment", "in1"] } + ] + } +} \ No newline at end of file diff --git a/app/thirdparty/buildoz/bzGraflow.js b/app/thirdparty/buildoz/bzGraflow.js index bcf2b3d..3ceade5 100644 --- a/app/thirdparty/buildoz/bzGraflow.js +++ b/app/thirdparty/buildoz/bzGraflow.js @@ -499,14 +499,19 @@ class BZgraflow extends Buildoz{ return(`M ${x1} ${y1} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${x2} ${y2}`) } if(wireType === 'straight') { - console.log('straight') - // Straight segments through the same control points return(`M ${x1} ${y1} L ${c1x} ${c1y} L ${c2x} ${c2y} L ${x2} ${y2}`) } + if(wireType === 'ortho') { + let path = `M ${x1} ${y1} ` + if(['n', 's'].includes(port1.direction)) { + path += `V ${(c1y+c2y)/2} H ${c2x} V ${y2}` + } else { + path += `H ${(c1x+c2x)/2} V ${c2y} H ${x2}` + } + return(path) + } return('') - //return(`M ${x1} ${y1} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${x2} ${y2}`) } - linkInterNodes(idNode1, idPort1, idNode2, idPort2, interNodes, orientation='horizontal') { const tension = parseInt(this.getBZAttribute('tension')) || 60 const wireType = this.getBZAttribute('wiretype') || 'bezier' @@ -541,7 +546,16 @@ class BZgraflow extends Buildoz{ if(wireType === 'straight') { return(`L ${c1x} ${c1y} L ${c2x} ${c2y} L ${x2} ${y2}`) } - return(`C ${c1x} ${c1y}, ${c2x} ${c2y}, ${x2} ${y2}`) + if(wireType === 'ortho') { + let path = `M ${x1} ${y1} ` + if(['n', 's'].includes(port1.direction)) { + path += `V ${(c1y+c2y)/2} H ${c2x} V ${y2}` + } else { + path += `H ${(c1x+c2x)/2} V ${c2y} H ${x2}` + } + return(path) + } + return(``) } // Start/end points in SVG coords (works for both bezier and line)