chore: remove coverage artifacts, add to gitignore

This commit is contained in:
pbanddev
2026-01-08 06:30:05 -06:00
parent ac11c889a6
commit 7dd0eb5472
25 changed files with 2 additions and 10910 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
node_modules/
__pycache__/
dist/
dist/
coverage/
.DS_Store
.env
.env.local
-224
View File
@@ -1,224 +0,0 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}
-87
View File
@@ -1,87 +0,0 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selector that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
if (
document.getElementById('fileSearch') === document.activeElement &&
document.activeElement != null
) {
// if we're currently focused on the search input, we don't want to navigate
return;
}
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);
-993
View File
@@ -1,993 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1767836506126" clover="3.2.0">
<project timestamp="1767836506126" name="All files">
<metrics statements="948" coveredstatements="794" conditionals="598" coveredconditionals="371" methods="90" coveredmethods="78" elements="1636" coveredelements="1243" complexity="0" loc="948" ncloc="948" packages="2" files="11" classes="11"/>
<package name="src">
<metrics statements="10" coveredstatements="6" conditionals="8" coveredconditionals="4" methods="2" coveredmethods="2"/>
<file name="debug.ts" path="C:\Projects\comfy-node-organizer\src\debug.ts">
<metrics statements="10" coveredstatements="6" conditionals="8" coveredconditionals="4" methods="2" coveredmethods="2"/>
<line num="2" count="1" type="stmt"/>
<line num="3" count="1" type="stmt"/>
<line num="9" count="624" type="stmt"/>
<line num="11" count="624" type="cond" truecount="3" falsecount="1"/>
<line num="12" count="0" type="stmt"/>
<line num="13" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="15" count="624" type="stmt"/>
<line num="17" count="0" type="stmt"/>
<line num="23" count="624" type="cond" truecount="1" falsecount="1"/>
<line num="24" count="0" type="stmt"/>
</file>
</package>
<package name="src.layout">
<metrics statements="938" coveredstatements="788" conditionals="590" coveredconditionals="367" methods="88" coveredmethods="76"/>
<file name="bin-pack.ts" path="C:\Projects\comfy-node-organizer\src\layout\bin-pack.ts">
<metrics statements="66" coveredstatements="42" conditionals="30" coveredconditionals="17" methods="17" coveredmethods="9"/>
<line num="29" count="205" type="cond" truecount="1" falsecount="1"/>
<line num="32" count="205" type="cond" truecount="2" falsecount="0"/>
<line num="34" count="23" type="stmt"/>
<line num="38" count="182" type="stmt"/>
<line num="39" count="245" type="stmt"/>
<line num="40" count="245" type="stmt"/>
<line num="48" count="182" type="stmt"/>
<line num="50" count="182" type="cond" truecount="1" falsecount="1"/>
<line num="52" count="0" type="stmt"/>
<line num="56" count="182" type="stmt"/>
<line num="67" count="23" type="stmt"/>
<line num="68" count="23" type="stmt"/>
<line num="70" count="23" type="stmt"/>
<line num="71" count="52" type="stmt"/>
<line num="72" count="52" type="cond" truecount="1" falsecount="1"/>
<line num="73" count="52" type="cond" truecount="1" falsecount="1"/>
<line num="75" count="52" type="stmt"/>
<line num="82" count="52" type="stmt"/>
<line num="85" count="23" type="stmt"/>
<line num="98" count="0" type="stmt"/>
<line num="99" count="0" type="stmt"/>
<line num="101" count="0" type="stmt"/>
<line num="102" count="0" type="stmt"/>
<line num="104" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="106" count="0" type="stmt"/>
<line num="107" count="0" type="stmt"/>
<line num="109" count="0" type="stmt"/>
<line num="110" count="0" type="stmt"/>
<line num="116" count="0" type="stmt"/>
<line num="121" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="122" count="0" type="stmt"/>
<line num="123" count="0" type="stmt"/>
<line num="125" count="0" type="stmt"/>
<line num="126" count="0" type="stmt"/>
<line num="134" count="0" type="stmt"/>
<line num="135" count="0" type="stmt"/>
<line num="136" count="0" type="stmt"/>
<line num="137" count="0" type="stmt"/>
<line num="140" count="0" type="stmt"/>
<line num="157" count="182" type="stmt"/>
<line num="159" count="182" type="stmt"/>
<line num="161" count="245" type="stmt"/>
<line num="163" count="245" type="stmt"/>
<line num="164" count="70" type="stmt"/>
<line num="168" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="169" count="70" type="cond" truecount="2" falsecount="0"/>
<line num="171" count="70" type="cond" truecount="4" falsecount="0"/>
<line num="172" count="21" type="stmt"/>
<line num="173" count="21" type="stmt"/>
<line num="174" count="21" type="stmt"/>
<line num="175" count="21" type="stmt"/>
<line num="176" count="21" type="stmt"/>
<line num="180" count="245" type="cond" truecount="2" falsecount="0"/>
<line num="182" count="224" type="stmt"/>
<line num="191" count="182" type="stmt"/>
<line num="194" count="182" type="stmt"/>
<line num="195" count="182" type="stmt"/>
<line num="197" count="182" type="stmt"/>
<line num="198" count="224" type="stmt"/>
<line num="199" count="245" type="stmt"/>
<line num="205" count="224" type="stmt"/>
<line num="208" count="182" type="stmt"/>
<line num="215" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="216" count="0" type="stmt"/>
<line num="217" count="0" type="stmt"/>
<line num="224" count="126" type="stmt"/>
</file>
<file name="graph-builder.ts" path="C:\Projects\comfy-node-organizer\src\layout\graph-builder.ts">
<metrics statements="228" coveredstatements="178" conditionals="162" coveredconditionals="97" methods="16" coveredmethods="13"/>
<line num="31" count="60" type="cond" truecount="2" falsecount="2"/>
<line num="32" count="0" type="stmt"/>
<line num="34" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="36" count="0" type="stmt"/>
<line num="37" count="0" type="stmt"/>
<line num="38" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="39" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="40" count="0" type="stmt"/>
<line num="47" count="0" type="stmt"/>
<line num="59" count="1" type="stmt"/>
<line num="65" count="364" type="stmt"/>
<line num="66" count="364" type="stmt"/>
<line num="67" count="364" type="stmt"/>
<line num="68" count="364" type="stmt"/>
<line num="70" count="364" type="stmt"/>
<line num="71" count="364" type="stmt"/>
<line num="72" count="364" type="stmt"/>
<line num="73" count="364" type="stmt"/>
<line num="76" count="364" type="cond" truecount="4" falsecount="0"/>
<line num="85" count="30" type="stmt"/>
<line num="86" count="98" type="stmt"/>
<line num="87" count="98" type="stmt"/>
<line num="89" count="98" type="stmt"/>
<line num="90" count="462" type="cond" truecount="2" falsecount="0"/>
<line num="91" count="364" type="cond" truecount="2" falsecount="0"/>
<line num="92" count="28" type="stmt"/>
<line num="93" count="28" type="cond" truecount="1" falsecount="1"/>
<line num="94" count="28" type="stmt"/>
<line num="95" count="28" type="stmt"/>
<line num="100" count="98" type="stmt"/>
<line num="101" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="102" count="28" type="stmt"/>
<line num="107" count="98" type="stmt"/>
<line num="108" count="30" type="stmt"/>
<line num="109" count="70" type="stmt"/>
<line num="112" count="30" type="stmt"/>
<line num="113" count="98" type="stmt"/>
<line num="114" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="115" count="98" type="stmt"/>
<line num="116" count="98" type="stmt"/>
<line num="117" count="98" type="stmt"/>
<line num="118" count="28" type="stmt"/>
<line num="127" count="1533" type="stmt"/>
<line num="128" count="1533" type="stmt"/>
<line num="129" count="1533" type="stmt"/>
<line num="130" count="1533" type="stmt"/>
<line num="132" count="1533" type="cond" truecount="1" falsecount="1"/>
<line num="133" count="1533" type="cond" truecount="1" falsecount="1"/>
<line num="135" count="1533" type="cond" truecount="4" falsecount="0"/>
<line num="146" count="30" type="stmt"/>
<line num="147" count="30" type="stmt"/>
<line num="148" count="30" type="stmt"/>
<line num="151" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="152" count="30" type="stmt"/>
<line num="154" count="30" type="stmt"/>
<line num="155" count="374" type="cond" truecount="3" falsecount="1"/>
<line num="156" count="374" type="stmt"/>
<line num="161" count="30" type="stmt"/>
<line num="164" count="30" type="stmt"/>
<line num="165" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="166" count="0" type="stmt"/>
<line num="167" count="0" type="stmt"/>
<line num="168" count="0" type="stmt"/>
<line num="169" count="0" type="stmt"/>
<line num="170" count="0" type="stmt"/>
<line num="172" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="173" count="0" type="stmt"/>
<line num="174" count="0" type="stmt"/>
<line num="175" count="0" type="stmt"/>
<line num="176" count="0" type="stmt"/>
<line num="177" count="0" type="stmt"/>
<line num="181" count="30" type="stmt"/>
<line num="182" count="30" type="stmt"/>
<line num="185" count="30" type="stmt"/>
<line num="186" count="30" type="stmt"/>
<line num="188" count="30" type="cond" truecount="3" falsecount="1"/>
<line num="189" count="0" type="stmt"/>
<line num="190" count="0" type="stmt"/>
<line num="194" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="196" count="30" type="stmt"/>
<line num="197" count="98" type="cond" truecount="4" falsecount="1"/>
<line num="199" count="98" type="stmt"/>
<line num="209" count="98" type="stmt"/>
<line num="213" count="30" type="stmt"/>
<line num="218" count="30" type="stmt"/>
<line num="220" count="30" type="stmt"/>
<line num="221" count="374" type="stmt"/>
<line num="222" count="374" type="stmt"/>
<line num="224" count="374" type="stmt"/>
<line num="225" count="1533" type="cond" truecount="2" falsecount="0"/>
<line num="226" count="203" type="cond" truecount="2" falsecount="0"/>
<line num="227" count="189" type="stmt"/>
<line num="228" count="189" type="stmt"/>
<line num="233" count="374" type="cond" truecount="2" falsecount="0"/>
<line num="234" count="175" type="stmt"/>
<line num="235" count="175" type="stmt"/>
<line num="240" count="30" type="stmt"/>
<line num="241" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="244" count="98" type="stmt"/>
<line num="251" count="98" type="stmt"/>
<line num="252" count="30" type="stmt"/>
<line num="254" count="30" type="stmt"/>
<line num="255" count="161" type="stmt"/>
<line num="259" count="44" type="stmt"/>
<line num="260" count="44" type="stmt"/>
<line num="262" count="98" type="stmt"/>
<line num="268" count="98" type="stmt"/>
<line num="269" count="98" type="stmt"/>
<line num="273" count="98" type="stmt"/>
<line num="274" count="98" type="stmt"/>
<line num="275" count="28" type="stmt"/>
<line num="276" count="28" type="stmt"/>
<line num="278" count="98" type="cond" truecount="4" falsecount="0"/>
<line num="279" count="14" type="stmt"/>
<line num="281" count="98" type="stmt"/>
<line num="284" count="98" type="stmt"/>
<line num="285" count="98" type="stmt"/>
<line num="295" count="30" type="stmt"/>
<line num="297" count="30" type="stmt"/>
<line num="299" count="374" type="cond" truecount="2" falsecount="0"/>
<line num="300" count="73" type="stmt"/>
<line num="304" count="301" type="cond" truecount="1" falsecount="1"/>
<line num="305" count="0" type="stmt"/>
<line num="308" count="301" type="stmt"/>
<line num="310" count="301" type="cond" truecount="2" falsecount="0"/>
<line num="313" count="154" type="stmt"/>
<line num="315" count="154" type="cond" truecount="2" falsecount="0"/>
<line num="317" count="70" type="stmt"/>
<line num="320" count="70" type="stmt"/>
<line num="338" count="147" type="stmt"/>
<line num="339" count="147" type="stmt"/>
<line num="359" count="30" type="stmt"/>
<line num="360" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="367" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="368" count="30" type="stmt"/>
<line num="369" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="371" count="0" type="stmt"/>
<line num="374" count="0" type="stmt"/>
<line num="377" count="30" type="stmt"/>
<line num="378" count="420" type="cond" truecount="3" falsecount="1"/>
<line num="379" count="420" type="cond" truecount="3" falsecount="1"/>
<line num="381" count="420" type="stmt"/>
<line num="382" count="420" type="stmt"/>
<line num="385" count="420" type="cond" truecount="3" falsecount="1"/>
<line num="386" count="0" type="stmt"/>
<line num="390" count="420" type="stmt"/>
<line num="391" count="420" type="stmt"/>
<line num="393" count="420" type="cond" truecount="2" falsecount="0"/>
<line num="394" count="231" type="stmt"/>
<line num="395" count="231" type="stmt"/>
<line num="397" count="420" type="cond" truecount="2" falsecount="0"/>
<line num="398" count="140" type="stmt"/>
<line num="399" count="140" type="stmt"/>
<line num="403" count="420" type="cond" truecount="4" falsecount="0"/>
<line num="404" count="98" type="stmt"/>
<line num="405" count="98" type="stmt"/>
<line num="406" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="407" count="42" type="stmt"/>
<line num="411" count="378" type="stmt"/>
<line num="412" count="378" type="stmt"/>
<line num="414" count="378" type="cond" truecount="3" falsecount="1"/>
<line num="415" count="378" type="cond" truecount="2" falsecount="0"/>
<line num="416" count="280" type="stmt"/>
<line num="418" count="378" type="cond" truecount="2" falsecount="0"/>
<line num="419" count="280" type="stmt"/>
<line num="426" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="427" count="0" type="stmt"/>
<line num="429" count="0" type="stmt"/>
<line num="431" count="0" type="stmt"/>
<line num="432" count="0" type="stmt"/>
<line num="433" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="434" count="0" type="stmt"/>
<line num="435" count="0" type="stmt"/>
<line num="438" count="0" type="stmt"/>
<line num="439" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="441" count="0" type="stmt"/>
<line num="443" count="0" type="stmt"/>
<line num="444" count="0" type="stmt"/>
<line num="445" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="446" count="0" type="stmt"/>
<line num="447" count="0" type="stmt"/>
<line num="450" count="0" type="stmt"/>
<line num="451" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="454" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="455" count="0" type="stmt"/>
<line num="456" count="0" type="stmt"/>
<line num="457" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="460" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="461" count="0" type="stmt"/>
<line num="463" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="464" count="0" type="stmt"/>
<line num="470" count="30" type="stmt"/>
<line num="494" count="98" type="stmt"/>
<line num="495" count="175" type="stmt"/>
<line num="496" count="175" type="stmt"/>
<line num="498" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="499" count="7" type="stmt"/>
<line num="503" count="91" type="stmt"/>
<line num="505" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="507" count="21" type="stmt"/>
<line num="508" count="21" type="stmt"/>
<line num="509" count="21" type="stmt"/>
<line num="511" count="21" type="stmt"/>
<line num="512" count="49" type="cond" truecount="1" falsecount="1"/>
<line num="514" count="49" type="stmt"/>
<line num="515" count="49" type="stmt"/>
<line num="517" count="49" type="stmt"/>
<line num="518" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="519" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="523" count="49" type="cond" truecount="1" falsecount="1"/>
<line num="524" count="49" type="stmt"/>
<line num="527" count="49" type="stmt"/>
<line num="528" count="49" type="stmt"/>
<line num="532" count="21" type="cond" truecount="1" falsecount="1"/>
<line num="533" count="21" type="stmt"/>
<line num="536" count="21" type="stmt"/>
<line num="539" count="70" type="stmt"/>
<line num="540" count="70" type="stmt"/>
<line num="542" count="70" type="stmt"/>
<line num="543" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="544" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="548" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="549" count="70" type="stmt"/>
<line num="552" count="70" type="stmt"/>
<line num="560" count="721" type="stmt"/>
<line num="561" count="721" type="stmt"/>
<line num="562" count="63" type="stmt"/>
<line num="564" count="721" type="stmt"/>
</file>
<file name="groups.ts" path="C:\Projects\comfy-node-organizer\src\layout\groups.ts">
<metrics statements="75" coveredstatements="56" conditionals="32" coveredconditionals="18" methods="2" coveredmethods="2"/>
<line num="5" count="1" type="stmt"/>
<line num="12" count="30" type="stmt"/>
<line num="14" count="30" type="cond" truecount="3" falsecount="1"/>
<line num="15" count="0" type="stmt"/>
<line num="16" count="0" type="stmt"/>
<line num="19" count="30" type="stmt"/>
<line num="20" count="30" type="stmt"/>
<line num="23" count="30" type="stmt"/>
<line num="24" count="44" type="stmt"/>
<line num="25" count="98" type="stmt"/>
<line num="28" count="98" type="cond" truecount="3" falsecount="1"/>
<line num="29" count="0" type="stmt"/>
<line num="30" count="0" type="stmt"/>
<line num="34" count="98" type="stmt"/>
<line num="35" count="98" type="stmt"/>
<line num="36" count="98" type="stmt"/>
<line num="37" count="98" type="stmt"/>
<line num="40" count="98" type="stmt"/>
<line num="41" count="175" type="stmt"/>
<line num="42" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="44" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="45" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="46" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="47" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="49" count="175" type="stmt"/>
<line num="50" count="175" type="stmt"/>
<line num="51" count="175" type="stmt"/>
<line num="52" count="175" type="stmt"/>
<line num="56" count="98" type="stmt"/>
<line num="57" count="28" type="stmt"/>
<line num="58" count="28" type="stmt"/>
<line num="59" count="28" type="stmt"/>
<line num="60" count="28" type="stmt"/>
<line num="61" count="28" type="stmt"/>
<line num="63" count="28" type="stmt"/>
<line num="64" count="28" type="stmt"/>
<line num="65" count="28" type="stmt"/>
<line num="66" count="28" type="stmt"/>
<line num="70" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="71" count="0" type="stmt"/>
<line num="72" count="0" type="stmt"/>
<line num="76" count="98" type="stmt"/>
<line num="77" count="98" type="stmt"/>
<line num="78" count="98" type="stmt"/>
<line num="79" count="98" type="stmt"/>
<line num="80" count="98" type="stmt"/>
<line num="82" count="98" type="stmt"/>
<line num="87" count="98" type="stmt"/>
<line num="89" count="98" type="stmt"/>
<line num="93" count="30" type="stmt"/>
<line num="107" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="108" count="98" type="stmt"/>
<line num="109" count="98" type="stmt"/>
<line num="111" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="112" count="98" type="stmt"/>
<line num="113" count="98" type="stmt"/>
<line num="117" count="98" type="stmt"/>
<line num="121" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="122" count="0" type="stmt"/>
<line num="123" count="0" type="stmt"/>
<line num="125" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="126" count="0" type="stmt"/>
<line num="127" count="0" type="stmt"/>
<line num="131" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="132" count="0" type="stmt"/>
<line num="133" count="0" type="stmt"/>
<line num="134" count="0" type="stmt"/>
<line num="135" count="0" type="stmt"/>
<line num="136" count="0" type="stmt"/>
<line num="140" count="98" type="stmt"/>
<line num="141" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="142" count="0" type="stmt"/>
<line num="143" count="0" type="stmt"/>
<line num="144" count="0" type="stmt"/>
<line num="145" count="0" type="stmt"/>
</file>
<file name="index.ts" path="C:\Projects\comfy-node-organizer\src\layout\index.ts">
<metrics statements="23" coveredstatements="22" conditionals="10" coveredconditionals="6" methods="2" coveredmethods="1"/>
<line num="33" count="31" type="stmt"/>
<line num="34" count="31" type="stmt"/>
<line num="37" count="31" type="cond" truecount="1" falsecount="1"/>
<line num="38" count="31" type="cond" truecount="2" falsecount="0"/>
<line num="39" count="1" type="stmt"/>
<line num="48" count="30" type="stmt"/>
<line num="51" count="30" type="stmt"/>
<line num="54" count="30" type="stmt"/>
<line num="57" count="30" type="stmt"/>
<line num="58" count="30" type="stmt"/>
<line num="62" count="30" type="stmt"/>
<line num="65" count="30" type="stmt"/>
<line num="68" count="30" type="stmt"/>
<line num="71" count="30" type="stmt"/>
<line num="75" count="30" type="stmt"/>
<line num="78" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="79" count="0" type="stmt"/>
<line num="82" count="30" type="stmt"/>
<line num="85" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="86" count="31" type="cond" truecount="1" falsecount="1"/>
<line num="87" count="31" type="stmt"/>
<line num="89" count="31" type="stmt"/>
<line num="93" count="31" type="stmt"/>
</file>
<file name="layer-assign.ts" path="C:\Projects\comfy-node-organizer\src\layout\layer-assign.ts">
<metrics statements="48" coveredstatements="46" conditionals="18" coveredconditionals="14" methods="5" coveredmethods="5"/>
<line num="9" count="30" type="stmt"/>
<line num="12" count="30" type="stmt"/>
<line num="13" count="30" type="stmt"/>
<line num="14" count="30" type="stmt"/>
<line num="17" count="30" type="stmt"/>
<line num="18" count="217" type="stmt"/>
<line num="19" count="217" type="cond" truecount="2" falsecount="0"/>
<line num="20" count="63" type="stmt"/>
<line num="25" count="30" type="stmt"/>
<line num="26" count="217" type="stmt"/>
<line num="27" count="217" type="stmt"/>
<line num="29" count="217" type="stmt"/>
<line num="30" count="217" type="stmt"/>
<line num="31" count="280" type="cond" truecount="1" falsecount="1"/>
<line num="32" count="280" type="stmt"/>
<line num="33" count="280" type="cond" truecount="2" falsecount="0"/>
<line num="34" count="154" type="stmt"/>
<line num="40" count="30" type="stmt"/>
<line num="41" count="217" type="cond" truecount="1" falsecount="1"/>
<line num="42" count="0" type="stmt"/>
<line num="47" count="30" type="stmt"/>
<line num="48" count="217" type="stmt"/>
<line num="50" count="217" type="cond" truecount="2" falsecount="0"/>
<line num="52" count="63" type="stmt"/>
<line num="55" count="154" type="stmt"/>
<line num="56" count="154" type="stmt"/>
<line num="57" count="280" type="stmt"/>
<line num="58" count="280" type="cond" truecount="3" falsecount="1"/>
<line num="59" count="280" type="stmt"/>
<line num="62" count="154" type="stmt"/>
<line num="67" count="30" type="stmt"/>
<line num="68" count="217" type="cond" truecount="1" falsecount="1"/>
<line num="69" count="0" type="stmt"/>
<line num="74" count="30" type="stmt"/>
<line num="75" count="30" type="stmt"/>
<line num="76" count="217" type="cond" truecount="2" falsecount="0"/>
<line num="77" count="217" type="stmt"/>
<line num="78" count="217" type="stmt"/>
<line num="82" count="196" type="stmt"/>
<line num="83" count="30" type="stmt"/>
<line num="85" count="30" type="stmt"/>
<line num="86" count="154" type="stmt"/>
<line num="88" count="154" type="stmt"/>
<line num="89" count="154" type="stmt"/>
<line num="90" count="217" type="stmt"/>
<line num="93" count="154" type="stmt"/>
<line num="97" count="217" type="stmt"/>
<line num="101" count="30" type="stmt"/>
</file>
<file name="layout-utils.ts" path="C:\Projects\comfy-node-organizer\src\layout\layout-utils.ts">
<metrics statements="53" coveredstatements="52" conditionals="36" coveredconditionals="25" methods="3" coveredmethods="3"/>
<line num="11" count="189" type="stmt"/>
<line num="14" count="189" type="stmt"/>
<line num="15" count="189" type="stmt"/>
<line num="16" count="350" type="stmt"/>
<line num="17" count="350" type="cond" truecount="1" falsecount="1"/>
<line num="19" count="350" type="stmt"/>
<line num="20" count="490" type="cond" truecount="2" falsecount="0"/>
<line num="21" count="406" type="stmt"/>
<line num="22" count="462" type="stmt"/>
<line num="29" count="189" type="stmt"/>
<line num="30" count="350" type="stmt"/>
<line num="31" count="350" type="cond" truecount="1" falsecount="1"/>
<line num="33" count="350" type="stmt"/>
<line num="34" count="308" type="cond" truecount="4" falsecount="0"/>
<line num="35" count="280" type="stmt"/>
<line num="36" count="280" type="cond" truecount="4" falsecount="0"/>
<line num="37" count="84" type="stmt"/>
<line num="43" count="189" type="stmt"/>
<line num="56" count="42" type="stmt"/>
<line num="57" count="42" type="stmt"/>
<line num="59" count="42" type="stmt"/>
<line num="60" count="154" type="stmt"/>
<line num="61" count="154" type="stmt"/>
<line num="64" count="42" type="stmt"/>
<line num="65" count="84" type="stmt"/>
<line num="66" count="84" type="cond" truecount="1" falsecount="1"/>
<line num="70" count="42" type="stmt"/>
<line num="71" count="42" type="stmt"/>
<line num="74" count="42" type="stmt"/>
<line num="75" count="154" type="cond" truecount="3" falsecount="1"/>
<line num="76" count="70" type="stmt"/>
<line num="77" count="70" type="stmt"/>
<line num="81" count="42" type="stmt"/>
<line num="82" count="154" type="stmt"/>
<line num="83" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="85" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="87" count="84" type="cond" truecount="2" falsecount="0"/>
<line num="88" count="84" type="stmt"/>
<line num="91" count="84" type="cond" truecount="1" falsecount="1"/>
<line num="92" count="84" type="stmt"/>
<line num="93" count="84" type="cond" truecount="1" falsecount="1"/>
<line num="94" count="84" type="stmt"/>
<line num="100" count="42" type="stmt"/>
<line num="101" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="102" count="0" type="stmt"/>
<line num="107" count="42" type="stmt"/>
<line num="108" count="98" type="stmt"/>
<line num="110" count="42" type="stmt"/>
<line num="111" count="154" type="stmt"/>
<line num="112" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="113" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="114" count="154" type="stmt"/>
<line num="118" count="42" type="stmt"/>
</file>
<file name="node-classifier.ts" path="C:\Projects\comfy-node-organizer\src\layout\node-classifier.ts">
<metrics statements="32" coveredstatements="24" conditionals="32" coveredconditionals="15" methods="2" coveredmethods="2"/>
<line num="10" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="11" count="30" type="stmt"/>
<line num="12" count="420" type="cond" truecount="1" falsecount="1"/>
<line num="14" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="15" count="0" type="stmt"/>
<line num="16" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="19" count="0" type="stmt"/>
<line num="20" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="33" count="30" type="stmt"/>
<line num="36" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="37" count="30" type="stmt"/>
<line num="38" count="420" type="cond" truecount="1" falsecount="1"/>
<line num="39" count="420" type="stmt"/>
<line num="41" count="420" type="cond" truecount="1" falsecount="1"/>
<line num="42" count="420" type="stmt"/>
<line num="47" count="30" type="stmt"/>
<line num="48" count="30" type="stmt"/>
<line num="49" count="30" type="stmt"/>
<line num="51" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="52" count="30" type="stmt"/>
<line num="53" count="374" type="cond" truecount="3" falsecount="1"/>
<line num="55" count="374" type="cond" truecount="1" falsecount="1"/>
<line num="59" count="374" type="cond" truecount="2" falsecount="0"/>
<line num="61" count="374" type="cond" truecount="1" falsecount="1"/>
<line num="62" count="0" type="stmt"/>
<line num="64" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="65" count="0" type="stmt"/>
<line num="67" count="374" type="cond" truecount="2" falsecount="0"/>
<line num="68" count="301" type="stmt"/>
<line num="70" count="73" type="stmt"/>
<line num="74" count="30" type="stmt"/>
<line num="78" count="30" type="stmt"/>
</file>
<file name="ordering.ts" path="C:\Projects\comfy-node-organizer\src\layout\ordering.ts">
<metrics statements="82" coveredstatements="79" conditionals="50" coveredconditionals="33" methods="14" coveredmethods="14"/>
<line num="9" count="30" type="stmt"/>
<line num="11" count="30" type="cond" truecount="2" falsecount="0"/>
<line num="14" count="28" type="stmt"/>
<line num="15" count="154" type="stmt"/>
<line num="16" count="154" type="stmt"/>
<line num="17" count="217" type="stmt"/>
<line num="22" count="28" type="stmt"/>
<line num="23" count="28" type="stmt"/>
<line num="26" count="28" type="stmt"/>
<line num="28" count="42" type="cond" truecount="2" falsecount="0"/>
<line num="32" count="42" type="cond" truecount="2" falsecount="0"/>
<line num="45" count="28" type="stmt"/>
<line num="46" count="154" type="stmt"/>
<line num="47" count="154" type="stmt"/>
<line num="49" count="217" type="stmt"/>
<line num="50" count="217" type="stmt"/>
<line num="65" count="28" type="stmt"/>
<line num="67" count="28" type="stmt"/>
<line num="68" count="126" type="stmt"/>
<line num="71" count="126" type="stmt"/>
<line num="73" count="126" type="stmt"/>
<line num="74" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="75" count="154" type="stmt"/>
<line num="76" count="154" type="stmt"/>
<line num="78" count="154" type="stmt"/>
<line num="79" count="280" type="stmt"/>
<line num="80" count="280" type="cond" truecount="4" falsecount="0"/>
<line num="82" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="83" count="175" type="stmt"/>
<line num="84" count="175" type="stmt"/>
<line num="88" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="89" count="154" type="stmt"/>
<line num="91" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="94" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="99" count="154" type="stmt"/>
<line num="100" count="126" type="stmt"/>
<line num="101" count="42" type="cond" truecount="1" falsecount="1"/>
<line num="102" count="42" type="cond" truecount="1" falsecount="1"/>
<line num="103" count="42" type="stmt"/>
<line num="104" count="42" type="cond" truecount="2" falsecount="0"/>
<line num="108" count="126" type="stmt"/>
<line num="109" count="154" type="stmt"/>
<line num="113" count="126" type="stmt"/>
<line num="114" count="126" type="stmt"/>
<line num="115" count="154" type="stmt"/>
<line num="116" count="154" type="stmt"/>
<line num="119" count="154" type="stmt"/>
<line num="120" count="126" type="cond" truecount="2" falsecount="0"/>
<line num="123" count="126" type="stmt"/>
<line num="136" count="14" type="stmt"/>
<line num="138" count="14" type="stmt"/>
<line num="139" count="70" type="stmt"/>
<line num="142" count="70" type="stmt"/>
<line num="144" count="70" type="stmt"/>
<line num="145" count="126" type="cond" truecount="1" falsecount="1"/>
<line num="146" count="126" type="stmt"/>
<line num="147" count="126" type="stmt"/>
<line num="149" count="126" type="stmt"/>
<line num="150" count="189" type="stmt"/>
<line num="151" count="189" type="cond" truecount="4" falsecount="0"/>
<line num="153" count="119" type="cond" truecount="1" falsecount="1"/>
<line num="154" count="119" type="stmt"/>
<line num="155" count="119" type="stmt"/>
<line num="159" count="126" type="cond" truecount="2" falsecount="0"/>
<line num="160" count="98" type="stmt"/>
<line num="162" count="28" type="cond" truecount="1" falsecount="1"/>
<line num="165" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="170" count="126" type="stmt"/>
<line num="171" count="70" type="stmt"/>
<line num="172" count="56" type="cond" truecount="1" falsecount="1"/>
<line num="173" count="56" type="cond" truecount="1" falsecount="1"/>
<line num="174" count="56" type="stmt"/>
<line num="175" count="56" type="cond" truecount="2" falsecount="0"/>
<line num="179" count="70" type="stmt"/>
<line num="180" count="126" type="stmt"/>
<line num="184" count="70" type="stmt"/>
<line num="185" count="70" type="stmt"/>
<line num="186" count="126" type="stmt"/>
<line num="187" count="126" type="stmt"/>
<line num="190" count="126" type="stmt"/>
<line num="191" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="194" count="70" type="stmt"/>
</file>
<file name="positioning.ts" path="C:\Projects\comfy-node-organizer\src\layout\positioning.ts">
<metrics statements="330" coveredstatements="288" conditionals="220" coveredconditionals="142" methods="27" coveredmethods="27"/>
<line num="27" count="1" type="stmt"/>
<line num="33" count="60" type="stmt"/>
<line num="35" count="60" type="cond" truecount="5" falsecount="0"/>
<line num="36" count="14" type="stmt"/>
<line num="39" count="46" type="stmt"/>
<line num="40" count="46" type="stmt"/>
<line num="41" count="146" type="stmt"/>
<line num="42" count="146" type="cond" truecount="1" falsecount="1"/>
<line num="43" count="146" type="cond" truecount="1" falsecount="1"/>
<line num="46" count="46" type="stmt"/>
<line num="54" count="30" type="stmt"/>
<line num="55" count="30" type="stmt"/>
<line num="57" count="30" type="stmt"/>
<line num="58" count="30" type="stmt"/>
<line num="59" count="154" type="stmt"/>
<line num="60" count="154" type="stmt"/>
<line num="70" count="30" type="stmt"/>
<line num="71" count="30" type="stmt"/>
<line num="74" count="30" type="stmt"/>
<line num="75" count="30" type="stmt"/>
<line num="76" count="154" type="stmt"/>
<line num="77" count="217" type="stmt"/>
<line num="82" count="30" type="stmt"/>
<line num="83" count="30" type="stmt"/>
<line num="84" count="154" type="stmt"/>
<line num="85" count="154" type="stmt"/>
<line num="89" count="30" type="stmt"/>
<line num="90" count="154" type="stmt"/>
<line num="91" count="217" type="cond" truecount="1" falsecount="1"/>
<line num="92" count="217" type="stmt"/>
<line num="103" count="30" type="stmt"/>
<line num="106" count="30" type="stmt"/>
<line num="108" count="30" type="stmt"/>
<line num="110" count="217" type="stmt"/>
<line num="111" count="217" type="stmt"/>
<line num="113" count="154" type="stmt"/>
<line num="114" count="154" type="stmt"/>
<line num="117" count="154" type="stmt"/>
<line num="118" count="70" type="stmt"/>
<line num="119" count="70" type="stmt"/>
<line num="120" count="70" type="stmt"/>
<line num="121" count="70" type="stmt"/>
<line num="125" count="154" type="cond" truecount="2" falsecount="0"/>
<line num="127" count="112" type="stmt"/>
<line num="128" count="112" type="stmt"/>
<line num="129" count="147" type="stmt"/>
<line num="133" count="147" type="stmt"/>
<line num="134" count="112" type="stmt"/>
<line num="136" count="112" type="stmt"/>
<line num="139" count="112" type="stmt"/>
<line num="140" count="126" type="stmt"/>
<line num="141" count="126" type="stmt"/>
<line num="144" count="126" type="stmt"/>
<line num="145" count="14" type="cond" truecount="2" falsecount="2"/>
<line num="146" count="0" type="stmt"/>
<line num="150" count="126" type="stmt"/>
<line num="151" count="189" type="stmt"/>
<line num="152" count="147" type="cond" truecount="1" falsecount="1"/>
<line num="153" count="147" type="stmt"/>
<line num="154" count="147" type="stmt"/>
<line num="155" count="147" type="stmt"/>
<line num="161" count="112" type="stmt"/>
<line num="162" count="112" type="cond" truecount="2" falsecount="0"/>
<line num="163" count="14" type="stmt"/>
<line num="168" count="30" type="stmt"/>
<line num="176" count="30" type="stmt"/>
<line num="178" count="30" type="cond" truecount="5" falsecount="0"/>
<line num="179" count="7" type="stmt"/>
<line num="183" count="23" type="stmt"/>
<line num="184" count="23" type="stmt"/>
<line num="185" count="73" type="cond" truecount="2" falsecount="0"/>
<line num="186" count="21" type="stmt"/>
<line num="188" count="52" type="stmt"/>
<line num="191" count="23" type="cond" truecount="1" falsecount="1"/>
<line num="192" count="0" type="stmt"/>
<line num="193" count="0" type="stmt"/>
<line num="197" count="23" type="stmt"/>
<line num="198" count="23" type="stmt"/>
<line num="199" count="52" type="stmt"/>
<line num="200" count="52" type="cond" truecount="1" falsecount="1"/>
<line num="201" count="52" type="stmt"/>
<line num="209" count="23" type="stmt"/>
<line num="215" count="23" type="stmt"/>
<line num="216" count="23" type="stmt"/>
<line num="218" count="23" type="stmt"/>
<line num="219" count="52" type="stmt"/>
<line num="220" count="52" type="stmt"/>
<line num="221" count="52" type="cond" truecount="3" falsecount="1"/>
<line num="223" count="52" type="cond" truecount="3" falsecount="1"/>
<line num="224" count="0" type="stmt"/>
<line num="226" count="52" type="stmt"/>
<line num="227" count="52" type="stmt"/>
<line num="232" count="23" type="stmt"/>
<line num="243" count="30" type="stmt"/>
<line num="246" count="30" type="stmt"/>
<line num="247" count="217" type="cond" truecount="2" falsecount="0"/>
<line num="249" count="70" type="stmt"/>
<line num="253" count="147" type="cond" truecount="2" falsecount="2"/>
<line num="254" count="0" type="stmt"/>
<line num="255" count="0" type="stmt"/>
<line num="256" count="0" type="stmt"/>
<line num="259" count="0" type="stmt"/>
<line num="262" count="147" type="stmt"/>
<line num="265" count="147" type="cond" truecount="3" falsecount="1"/>
<line num="266" count="0" type="stmt"/>
<line num="270" count="147" type="cond" truecount="1" falsecount="1"/>
<line num="271" count="147" type="stmt"/>
<line num="272" count="147" type="stmt"/>
<line num="277" count="30" type="cond" truecount="4" falsecount="1"/>
<line num="279" count="98" type="stmt"/>
<line num="281" count="30" type="stmt"/>
<line num="282" count="70" type="stmt"/>
<line num="283" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="285" count="70" type="stmt"/>
<line num="286" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="289" count="70" type="stmt"/>
<line num="290" count="70" type="stmt"/>
<line num="292" count="70" type="stmt"/>
<line num="297" count="30" type="stmt"/>
<line num="300" count="30" type="cond" truecount="3" falsecount="2"/>
<line num="302" count="0" type="stmt"/>
<line num="303" count="0" type="stmt"/>
<line num="305" count="0" type="stmt"/>
<line num="306" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="307" count="0" type="stmt"/>
<line num="309" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="310" count="0" type="stmt"/>
<line num="315" count="0" type="stmt"/>
<line num="316" count="0" type="stmt"/>
<line num="317" count="0" type="stmt"/>
<line num="321" count="0" type="stmt"/>
<line num="324" count="0" type="stmt"/>
<line num="325" count="0" type="stmt"/>
<line num="326" count="0" type="stmt"/>
<line num="327" count="0" type="stmt"/>
<line num="328" count="0" type="cond" truecount="0" falsecount="5"/>
<line num="329" count="0" type="stmt"/>
<line num="330" count="0" type="stmt"/>
<line num="335" count="0" type="stmt"/>
<line num="354" count="98" type="stmt"/>
<line num="355" count="98" type="stmt"/>
<line num="356" count="175" type="stmt"/>
<line num="357" count="175" type="cond" truecount="1" falsecount="1"/>
<line num="358" count="175" type="cond" truecount="3" falsecount="1"/>
<line num="359" count="175" type="stmt"/>
<line num="363" count="98" type="cond" truecount="3" falsecount="1"/>
<line num="364" count="0" type="stmt"/>
<line num="367" count="98" type="stmt"/>
<line num="370" count="98" type="stmt"/>
<line num="372" count="98" type="stmt"/>
<line num="374" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="375" count="91" type="cond" truecount="2" falsecount="0"/>
<line num="377" count="21" type="stmt"/>
<line num="379" count="21" type="stmt"/>
<line num="380" count="21" type="stmt"/>
<line num="381" count="49" type="stmt"/>
<line num="382" count="49" type="cond" truecount="1" falsecount="1"/>
<line num="385" count="49" type="cond" truecount="2" falsecount="2"/>
<line num="387" count="49" type="stmt"/>
<line num="388" count="49" type="stmt"/>
<line num="390" count="49" type="stmt"/>
<line num="391" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="392" count="77" type="stmt"/>
<line num="393" count="77" type="stmt"/>
<line num="394" count="77" type="stmt"/>
<line num="397" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="398" count="77" type="cond" truecount="1" falsecount="1"/>
<line num="401" count="49" type="stmt"/>
<line num="402" count="49" type="stmt"/>
<line num="407" count="70" type="cond" truecount="2" falsecount="2"/>
<line num="410" count="70" type="stmt"/>
<line num="411" count="70" type="stmt"/>
<line num="412" count="98" type="stmt"/>
<line num="419" count="98" type="stmt"/>
<line num="420" count="70" type="stmt"/>
<line num="422" count="70" type="stmt"/>
<line num="423" count="70" type="stmt"/>
<line num="424" count="98" type="stmt"/>
<line num="425" count="98" type="stmt"/>
<line num="426" count="98" type="stmt"/>
<line num="427" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="428" count="98" type="stmt"/>
<line num="429" count="98" type="stmt"/>
<line num="430" count="98" type="stmt"/>
<line num="431" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="434" count="98" type="stmt"/>
<line num="436" count="70" type="stmt"/>
<line num="441" count="98" type="stmt"/>
<line num="443" count="28" type="stmt"/>
<line num="444" count="28" type="stmt"/>
<line num="447" count="28" type="stmt"/>
<line num="450" count="28" type="cond" truecount="1" falsecount="1"/>
<line num="451" count="28" type="stmt"/>
<line num="452" count="28" type="stmt"/>
<line num="453" count="28" type="stmt"/>
<line num="456" count="28" type="stmt"/>
<line num="459" count="98" type="stmt"/>
<line num="468" count="266" type="cond" truecount="1" falsecount="1"/>
<line num="470" count="266" type="stmt"/>
<line num="471" count="266" type="stmt"/>
<line num="473" count="266" type="stmt"/>
<line num="474" count="364" type="stmt"/>
<line num="475" count="364" type="stmt"/>
<line num="478" count="266" type="cond" truecount="1" falsecount="1"/>
<line num="479" count="266" type="stmt"/>
<line num="488" count="30" type="stmt"/>
<line num="492" count="30" type="stmt"/>
<line num="494" count="30" type="stmt"/>
<line num="495" count="217" type="stmt"/>
<line num="497" count="154" type="cond" truecount="2" falsecount="0"/>
<line num="499" count="42" type="stmt"/>
<line num="502" count="112" type="stmt"/>
<line num="503" count="112" type="cond" truecount="1" falsecount="1"/>
<line num="505" count="112" type="stmt"/>
<line num="506" count="112" type="stmt"/>
<line num="510" count="30" type="cond" truecount="2" falsecount="0"/>
<line num="513" count="28" type="stmt"/>
<line num="514" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="516" count="154" type="stmt"/>
<line num="517" count="154" type="cond" truecount="1" falsecount="1"/>
<line num="519" count="154" type="stmt"/>
<line num="520" count="154" type="stmt"/>
<line num="522" count="154" type="stmt"/>
<line num="523" count="217" type="stmt"/>
<line num="533" count="30" type="stmt"/>
<line num="534" count="30" type="stmt"/>
<line num="536" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="539" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="540" count="98" type="cond" truecount="2" falsecount="0"/>
<line num="541" count="70" type="cond" truecount="1" falsecount="1"/>
<line num="542" count="98" type="cond" truecount="1" falsecount="1"/>
<line num="543" count="98" type="stmt"/>
<line num="559" count="30" type="stmt"/>
<line num="560" count="374" type="cond" truecount="2" falsecount="0"/>
<line num="561" count="199" type="cond" truecount="3" falsecount="1"/>
<line num="563" count="199" type="cond" truecount="1" falsecount="1"/>
<line num="564" count="374" type="cond" truecount="1" falsecount="1"/>
<line num="565" count="374" type="cond" truecount="1" falsecount="1"/>
<line num="566" count="374" type="stmt"/>
<line num="580" count="30" type="stmt"/>
<line num="594" count="29" type="stmt"/>
<line num="595" count="29" type="stmt"/>
<line num="596" count="29" type="stmt"/>
<line num="598" count="29" type="stmt"/>
<line num="599" count="29" type="cond" truecount="2" falsecount="0"/>
<line num="600" count="36" type="stmt"/>
<line num="601" count="36" type="stmt"/>
<line num="604" count="624" type="cond" truecount="3" falsecount="0"/>
<line num="606" count="36" type="stmt"/>
<line num="607" count="331" type="stmt"/>
<line num="609" count="331" type="stmt"/>
<line num="610" count="1485" type="stmt"/>
<line num="614" count="1485" type="cond" truecount="2" falsecount="0"/>
<line num="616" count="1485" type="cond" truecount="2" falsecount="0"/>
<line num="619" count="1141" type="stmt"/>
<line num="620" count="1141" type="cond" truecount="2" falsecount="0"/>
<line num="622" count="7" type="stmt"/>
<line num="623" count="7" type="stmt"/>
<line num="624" count="7" type="stmt"/>
<line num="625" count="7" type="stmt"/>
<line num="626" count="7" type="stmt"/>
<line num="632" count="29" type="cond" truecount="2" falsecount="0"/>
<line num="633" count="7" type="stmt"/>
<line num="635" count="29" type="stmt"/>
<line num="649" count="29" type="stmt"/>
<line num="650" count="29" type="stmt"/>
<line num="651" count="29" type="stmt"/>
<line num="653" count="29" type="stmt"/>
<line num="654" count="29" type="cond" truecount="2" falsecount="0"/>
<line num="655" count="29" type="stmt"/>
<line num="656" count="29" type="stmt"/>
<line num="659" count="624" type="cond" truecount="3" falsecount="0"/>
<line num="661" count="29" type="stmt"/>
<line num="662" count="268" type="stmt"/>
<line num="664" count="268" type="stmt"/>
<line num="665" count="1233" type="stmt"/>
<line num="669" count="1233" type="cond" truecount="2" falsecount="0"/>
<line num="671" count="1233" type="cond" truecount="2" falsecount="0"/>
<line num="674" count="106" type="stmt"/>
<line num="675" count="106" type="cond" truecount="1" falsecount="1"/>
<line num="677" count="0" type="stmt"/>
<line num="678" count="0" type="stmt"/>
<line num="679" count="0" type="stmt"/>
<line num="680" count="0" type="stmt"/>
<line num="681" count="0" type="stmt"/>
<line num="687" count="29" type="cond" truecount="1" falsecount="1"/>
<line num="688" count="0" type="stmt"/>
<line num="690" count="29" type="stmt"/>
<line num="703" count="7" type="stmt"/>
<line num="704" count="7" type="stmt"/>
<line num="705" count="7" type="cond" truecount="1" falsecount="1"/>
<line num="706" count="7" type="stmt"/>
<line num="707" count="7" type="stmt"/>
<line num="711" count="7" type="stmt"/>
<line num="712" count="0" type="cond" truecount="0" falsecount="2"/>
<line num="713" count="0" type="stmt"/>
<line num="714" count="0" type="stmt"/>
<line num="716" count="0" type="stmt"/>
<line num="729" count="7" type="stmt"/>
<line num="730" count="7" type="cond" truecount="1" falsecount="1"/>
<line num="731" count="7" type="stmt"/>
<line num="732" count="7" type="stmt"/>
<line num="734" count="7" type="stmt"/>
<line num="746" count="29" type="stmt"/>
<line num="747" count="268" type="stmt"/>
<line num="748" count="268" type="stmt"/>
<line num="751" count="268" type="cond" truecount="4" falsecount="0"/>
<line num="753" count="7" type="cond" truecount="4" falsecount="1"/>
<line num="755" count="7" type="cond" truecount="1" falsecount="1"/>
<line num="756" count="7" type="stmt"/>
<line num="757" count="7" type="stmt"/>
<line num="760" count="7" type="stmt"/>
<line num="761" count="14" type="stmt"/>
<line num="762" count="14" type="cond" truecount="1" falsecount="1"/>
<line num="763" count="14" type="stmt"/>
<line num="764" count="14" type="stmt"/>
<line num="768" count="7" type="stmt"/>
<line num="769" count="0" type="cond" truecount="0" falsecount="4"/>
<line num="771" count="0" type="stmt"/>
<line num="772" count="0" type="stmt"/>
<line num="784" count="30" type="stmt"/>
<line num="785" count="30" type="cond" truecount="1" falsecount="1"/>
<line num="787" count="30" type="stmt"/>
<line num="788" count="30" type="cond" truecount="2" falsecount="0"/>
<line num="789" count="1" type="stmt"/>
<line num="790" count="1" type="stmt"/>
<line num="794" count="29" type="stmt"/>
<line num="797" count="29" type="stmt"/>
<line num="800" count="29" type="stmt"/>
<line num="802" count="29" type="stmt"/>
</file>
<file name="types.ts" path="C:\Projects\comfy-node-organizer\src\layout\types.ts">
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<line num="180" count="1" type="stmt"/>
</file>
</package>
</project>
</coverage>
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

-131
View File
@@ -1,131 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.19% </span>
<span class="quiet">Statements</span>
<span class='fraction'>842/1037</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">62.04% </span>
<span class="quiet">Branches</span>
<span class='fraction'>371/598</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.66% </span>
<span class="quiet">Functions</span>
<span class='fraction'>78/90</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">83.75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>794/948</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="src"><a href="src/index.html">src</a></td>
<td data-value="60" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 60%"></div><div class="cover-empty" style="width: 40%"></div></div>
</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">6/10</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="8" class="abs medium">4/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">6/10</td>
</tr>
<tr>
<td class="file high" data-value="src/layout"><a href="src/layout/index.html">src/layout</a></td>
<td data-value="81.4" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 81%"></div><div class="cover-empty" style="width: 19%"></div></div>
</td>
<td data-value="81.4" class="pct high">81.4%</td>
<td data-value="1027" class="abs high">836/1027</td>
<td data-value="62.2" class="pct medium">62.2%</td>
<td data-value="590" class="abs medium">367/590</td>
<td data-value="86.36" class="pct high">86.36%</td>
<td data-value="88" class="abs high">76/88</td>
<td data-value="84" class="pct high">84%</td>
<td data-value="938" class="abs high">788/938</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

-210
View File
@@ -1,210 +0,0 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
function onFilterInput() {
const searchValue = document.getElementById('fileSearch').value;
const rows = document.getElementsByTagName('tbody')[0].children;
// Try to create a RegExp from the searchValue. If it fails (invalid regex),
// it will be treated as a plain text search
let searchRegex;
try {
searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive
} catch (error) {
searchRegex = null;
}
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
let isMatch = false;
if (searchRegex) {
// If a valid regex was created, use it for matching
isMatch = searchRegex.test(row.textContent);
} else {
// Otherwise, fall back to the original plain text search
isMatch = row.textContent
.toLowerCase()
.includes(searchValue.toLowerCase());
}
row.style.display = isMatch ? '' : 'none';
}
}
// loads the search box
function addSearchBox() {
var template = document.getElementById('filterTemplate');
var templateClone = template.content.cloneNode(true);
templateClone.getElementById('fileSearch').oninput = onFilterInput;
template.parentElement.appendChild(templateClone);
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSearchBox();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);
-163
View File
@@ -1,163 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/debug.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> debug.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Lines</span>
<span class='fraction'>6/10</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">624x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">624x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">624x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">624x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/** Setting ID for debug logging */
const SETTINGS_PREFIX = "Node Organizer";
const SETTINGS_IDS = {
DEBUG_LOGGING: `${SETTINGS_PREFIX}.Debug Logging`,
};
&nbsp;
/** Check if debug logging is enabled */
export function isDebugEnabled(): boolean {
try {
// Access app only if it exists (not in test environment)
<span class="missing-if-branch" title="if path not taken" >I</span>if (typeof globalThis !== "undefined" &amp;&amp; "app" in globalThis) {
const app = (<span class="cstat-no" title="statement not covered" >globalThis as { app?: { extensionManager?: { setting?: { get: &lt;T&gt;(id: string) =&gt; T } } } }).app;</span>
<span class="cstat-no" title="statement not covered" > return app?.extensionManager?.setting?.get&lt;boolean&gt;(SETTINGS_IDS.DEBUG_LOGGING) ?? false;</span>
}
return false;
} catch {
<span class="cstat-no" title="statement not covered" > return false;</span>
}
}
&nbsp;
/** Log message only if debug logging is enabled */
export function debugLog(message: string, ...args: unknown[]): void {
<span class="missing-if-branch" title="if path not taken" >I</span>if (isDebugEnabled()) {
<span class="cstat-no" title="statement not covered" > console.log(`[node-organizer] ${message}`, ...args);</span>
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
-116
View File
@@ -1,116 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> src</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Lines</span>
<span class='fraction'>6/10</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="debug.ts"><a href="debug.ts.html">debug.ts</a></td>
<td data-value="60" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 60%"></div><div class="cover-empty" style="width: 40%"></div></div>
</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">6/10</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="8" class="abs medium">4/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">6/10</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>
-760
View File
@@ -1,760 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/bin-pack.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> bin-pack.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Statements</span>
<span class='fraction'>45/75</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">56.66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>17/30</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">52.94% </span>
<span class="quiet">Functions</span>
<span class='fraction'>9/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">63.63% </span>
<span class="quiet">Lines</span>
<span class='fraction'>42/66</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">205x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">205x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">52x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-yes">21x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">224x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-yes">224x</span>
<span class="cline-any cline-yes">245x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">224x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">182x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { PackedRow, LayoutConfig } from "./types";
&nbsp;
/** Node size info for packing */
interface NodeSize {
id: number;
width: number;
height: number;
}
&nbsp;
/**
* Pack nodes into rows using First-Fit Decreasing Height (FFDH) algorithm
*
* Strategy:
* 1. Sort nodes by height descending (tall nodes first)
* 2. For each node, try to fit into existing row
* 3. If no row fits, create new row
* 4. Rows are sorted by height for visual consistency
*
* @param nodeIds - Node IDs to pack
* @param sizes - Map of node ID to size
* @param config - Layout configuration
* @returns Array of packed rows
*/
export function packNodesIntoRows(
nodeIds: number[],
sizes: Map&lt;number, { width: number; height: number }&gt;,
config: LayoutConfig
): PackedRow[] {
<span class="missing-if-branch" title="if path not taken" >I</span>if (nodeIds.length === 0) <span class="cstat-no" title="statement not covered" >return [];</span>
&nbsp;
// maxColumns: 0=auto, 1=disabled (vertical stack), 2+=fixed columns
if (config.maxColumns === 1) {
// Vertical stacking - one node per row
return packVertically(nodeIds, sizes, config.verticalGap);
}
&nbsp;
// Build sized node list
const nodeSizes: NodeSize[] = nodeIds.map((id) =&gt; {
const size = sizes.get(id);
return {
id,
width: size?.width ?? <span class="branch-1 cbranch-no" title="branch not covered" >200,</span>
height: size?.height ?? <span class="branch-1 cbranch-no" title="branch not covered" >100,</span>
};
});
&nbsp;
// Sort by height descending (FFDH: tall nodes first)
nodeSizes.sort((a, b) =&gt; b.height - a.height);
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (config.maxColumns &gt;= 2) {
// Fixed column count
<span class="cstat-no" title="statement not covered" > return packFixedColumns(nodeSizes, config.maxColumns, config.verticalGap);</span>
}
&nbsp;
// Auto mode: use maxRowWidth
return packByWidth(nodeSizes, config.maxRowWidth, config.horizontalGap, config.verticalGap);
}
&nbsp;
/**
* Pack nodes vertically (one per row) - legacy behavior
*/
function packVertically(
nodeIds: number[],
sizes: Map&lt;number, { width: number; height: number }&gt;,
verticalGap: number
): PackedRow[] {
const rows: PackedRow[] = [];
let yOffset = 0;
&nbsp;
for (const id of nodeIds) {
const size = sizes.get(id);
const height = size?.height ?? <span class="branch-1 cbranch-no" title="branch not covered" >100;</span>
const width = size?.width ?? <span class="branch-1 cbranch-no" title="branch not covered" >200;</span>
&nbsp;
rows.push({
nodes: [id],
height,
yOffset,
width,
});
&nbsp;
yOffset += height + verticalGap;
}
&nbsp;
return rows;
}
&nbsp;
/**
* Pack nodes into fixed number of columns
* Distributes nodes round-robin by height to balance columns
*/
function <span class="fstat-no" title="function not covered" >packFixedColumns(</span>
nodeSizes: NodeSize[],
columnCount: number,
verticalGap: number
): PackedRow[] {
// Group nodes by similar height into rows
const rows: PackedRow[] = <span class="cstat-no" title="statement not covered" >[];</span>
let currentRow: NodeSize[] = <span class="cstat-no" title="statement not covered" >[];</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > for (const node of nodeSizes) {</span>
<span class="cstat-no" title="statement not covered" > currentRow.push(node);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > if (currentRow.length &gt;= columnCount) {</span>
// Row is full
const rowHeight = <span class="cstat-no" title="statement not covered" >Math.max(...currentRow.map(<span class="fstat-no" title="function not covered" >(n</span>) =&gt; <span class="cstat-no" title="statement not covered" >n.height)</span>);</span>
const rowWidth = <span class="cstat-no" title="statement not covered" >currentRow.reduce(<span class="fstat-no" title="function not covered" >(s</span>um, n) =&gt; <span class="cstat-no" title="statement not covered" >sum + n.width, 0</span>);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > rows.push({</span>
nodes: currentRow.map(<span class="fstat-no" title="function not covered" >(n</span>) =&gt; <span class="cstat-no" title="statement not covered" >n.id)</span>,
height: rowHeight,
yOffset: 0, // Set later
width: rowWidth,
});
&nbsp;
<span class="cstat-no" title="statement not covered" > currentRow = [];</span>
}
}
&nbsp;
// Handle remaining nodes in last partial row
<span class="cstat-no" title="statement not covered" > if (currentRow.length &gt; 0) {</span>
const rowHeight = <span class="cstat-no" title="statement not covered" >Math.max(...currentRow.map(<span class="fstat-no" title="function not covered" >(n</span>) =&gt; <span class="cstat-no" title="statement not covered" >n.height)</span>);</span>
const rowWidth = <span class="cstat-no" title="statement not covered" >currentRow.reduce(<span class="fstat-no" title="function not covered" >(s</span>um, n) =&gt; <span class="cstat-no" title="statement not covered" >sum + n.width, 0</span>);</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > rows.push({</span>
nodes: currentRow.map(<span class="fstat-no" title="function not covered" >(n</span>) =&gt; <span class="cstat-no" title="statement not covered" >n.id)</span>,
height: rowHeight,
yOffset: 0,
width: rowWidth,
});
}
&nbsp;
// Calculate y offsets
let yOffset = <span class="cstat-no" title="statement not covered" >0;</span>
<span class="cstat-no" title="statement not covered" > for (const row of rows) {</span>
<span class="cstat-no" title="statement not covered" > row.yOffset = yOffset;</span>
<span class="cstat-no" title="statement not covered" > yOffset += row.height + verticalGap;</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > return rows;</span>
}
&nbsp;
/**
* Pack nodes by maximum row width (auto column count)
* Uses FFDH: First-Fit Decreasing Height
*/
function packByWidth(
nodeSizes: NodeSize[],
maxRowWidth: number,
horizontalGap: number,
verticalGap: number
): PackedRow[] {
const rows: Array&lt;{
nodes: NodeSize[];
height: number;
currentWidth: number;
}&gt; = [];
&nbsp;
for (const node of nodeSizes) {
// Try to fit into existing row
let placed = false;
&nbsp;
for (const row of rows) {
const newWidth = row.currentWidth + horizontalGap + node.width;
&nbsp;
// Check if node fits and heights are compatible
// Allow 50% height variance to keep rows visually balanced
const heightRatio = row.height &gt; 0 ? node.height / row.height : <span class="branch-1 cbranch-no" title="branch not covered" >1;</span>
const heightCompatible = heightRatio &gt;= 0.5 &amp;&amp; heightRatio &lt;= 2.0;
&nbsp;
if (newWidth &lt;= maxRowWidth &amp;&amp; heightCompatible) {
row.nodes.push(node);
row.currentWidth = newWidth;
row.height = Math.max(row.height, node.height);
placed = true;
break;
}
}
&nbsp;
if (!placed) {
// Create new row
rows.push({
nodes: [node],
height: node.height,
currentWidth: node.width,
});
}
}
&nbsp;
// Sort rows by their tallest node height (tallest first for visual hierarchy)
rows.sort((a, b) =&gt; b.height - a.height);
&nbsp;
// Convert to PackedRow format with y offsets
const result: PackedRow[] = [];
let yOffset = 0;
&nbsp;
for (const row of rows) {
result.push({
nodes: row.nodes.map((n) =&gt; n.id),
height: row.height,
yOffset,
width: row.currentWidth,
});
&nbsp;
yOffset += row.height + verticalGap;
}
&nbsp;
return result;
}
&nbsp;
/**
* Calculate total height of packed rows
*/
export function <span class="fstat-no" title="function not covered" >getPackedHeight(r</span>ows: PackedRow[]): number {
<span class="cstat-no" title="statement not covered" > if (rows.length === 0) <span class="cstat-no" title="statement not covered" >return 0;</span></span>
const lastRow = <span class="cstat-no" title="statement not covered" >rows[rows.length - 1];</span>
<span class="cstat-no" title="statement not covered" > return lastRow.yOffset + lastRow.height;</span>
}
&nbsp;
/**
* Calculate max width across all packed rows
*/
export function getPackedWidth(rows: PackedRow[]): number {
return Math.max(0, ...rows.map((r) =&gt; r.width));
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
File diff suppressed because it is too large Load Diff
-526
View File
@@ -1,526 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/groups.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> groups.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">74.02% </span>
<span class="quiet">Statements</span>
<span class='fraction'>57/77</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">56.25% </span>
<span class="quiet">Branches</span>
<span class='fraction'>18/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">74.66% </span>
<span class="quiet">Lines</span>
<span class='fraction'>56/75</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">44x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LayoutState, LGraphGroup } from "./types";
import { debugLog } from "../debug";
&nbsp;
/** Title bar height for groups */
const GROUP_TITLE_HEIGHT = 50;
&nbsp;
/**
* Resize groups to fit their contents after layout
* Uses bottom-up processing: deepest groups first, then parents
*/
export function resizeGroupsToFit(state: LayoutState): number {
const { groupsByDepth, allNodes, config } = state;
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (!groupsByDepth || !allNodes) {
<span class="cstat-no" title="statement not covered" > debugLog("Missing groupsByDepth or allNodes");</span>
<span class="cstat-no" title="statement not covered" > return 0;</span>
}
&nbsp;
let resizedCount = 0;
const maxDepth = groupsByDepth.length - 1;
&nbsp;
// Process from deepest to shallowest (bottom-up)
for (let depth = maxDepth; depth &gt;= 0; depth--) {
for (const layoutGroup of groupsByDepth[depth]) {
const { group, memberIds, childGroups } = layoutGroup;
&nbsp;
// Skip groups with no content
<span class="missing-if-branch" title="if path not taken" >I</span>if (memberIds.size === 0 &amp;&amp; childGroups.length === 0) {
<span class="cstat-no" title="statement not covered" > debugLog(`Skipping empty group "${group.title}"`);</span>
<span class="cstat-no" title="statement not covered" > continue;</span>
}
&nbsp;
// Calculate bounding box from positioned members and child groups
let minX = Infinity;
let minY = Infinity;
let maxX = -Infinity;
let maxY = -Infinity;
&nbsp;
// Include direct member nodes
for (const nodeId of memberIds) {
const node = allNodes.get(nodeId);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!node) <span class="cstat-no" title="statement not covered" >continue;</span>
&nbsp;
const nx = node.pos?.[0] ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const ny = node.pos?.[1] ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const nw = node.size?.[0] ?? <span class="branch-1 cbranch-no" title="branch not covered" >200;</span>
const nh = node.size?.[1] ?? <span class="branch-1 cbranch-no" title="branch not covered" >100;</span>
&nbsp;
minX = Math.min(minX, nx);
minY = Math.min(minY, ny);
maxX = Math.max(maxX, nx + nw);
maxY = Math.max(maxY, ny + nh);
}
&nbsp;
// Include child groups (already resized in previous iterations)
for (const child of childGroups) {
const cg = child.group;
const cx = cg.pos[0];
const cy = cg.pos[1];
const cw = cg.size[0];
const ch = cg.size[1];
&nbsp;
minX = Math.min(minX, cx);
minY = Math.min(minY, cy);
maxX = Math.max(maxX, cx + cw);
maxY = Math.max(maxY, cy + ch);
}
&nbsp;
// Handle empty bounds (shouldn't happen but be safe)
<span class="missing-if-branch" title="if path not taken" >I</span>if (minX === Infinity) {
<span class="cstat-no" title="statement not covered" > debugLog(`No content bounds for group "${group.title}"`);</span>
<span class="cstat-no" title="statement not covered" > continue;</span>
}
&nbsp;
// Calculate final group bounds with padding
const padding = config.groupPadding;
const newX = minX - padding;
const newY = minY - padding - GROUP_TITLE_HEIGHT;
const newWidth = maxX - minX + padding * 2;
const newHeight = maxY - minY + padding * 2 + GROUP_TITLE_HEIGHT;
&nbsp;
debugLog(
`Resizing group "${group.title}" (depth ${layoutGroup.depth}) to [${newX}, ${newY}, ${newWidth}, ${newHeight}]`
);
&nbsp;
// Update group bounds
updateGroupBounds(group, newX, newY, newWidth, newHeight);
&nbsp;
resizedCount++;
}
}
&nbsp;
return resizedCount;
}
&nbsp;
/**
* Update group bounds using multiple methods for compatibility
*/
function updateGroupBounds(
group: LGraphGroup,
x: number,
y: number,
width: number,
height: number
): void {
// Method 1: Direct pos/size array mutation (most common)
<span class="missing-if-branch" title="else path not taken" >E</span>if (Array.isArray(group.pos)) {
group.pos[0] = x;
group.pos[1] = y;
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (Array.isArray(group.size)) {
group.size[0] = width;
group.size[1] = height;
}
&nbsp;
// Method 2: Try _pos/_size internal properties
const g = group as LGraphGroup &amp; {
_pos?: [number, number];
_size?: [number, number];
};
<span class="missing-if-branch" title="if path not taken" >I</span>if (Array.isArray(g._pos)) {
<span class="cstat-no" title="statement not covered" > g._pos[0] = x;</span>
<span class="cstat-no" title="statement not covered" > g._pos[1] = y;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (Array.isArray(g._size)) {
<span class="cstat-no" title="statement not covered" > g._size[0] = width;</span>
<span class="cstat-no" title="statement not covered" > g._size[1] = height;</span>
}
&nbsp;
// Method 3: Update _bounding Rectangle if present
<span class="missing-if-branch" title="if path not taken" >I</span>if (group._bounding) {
const b = <span class="cstat-no" title="statement not covered" >group._bounding;</span>
<span class="cstat-no" title="statement not covered" > b.x = x;</span>
<span class="cstat-no" title="statement not covered" > b.y = y;</span>
<span class="cstat-no" title="statement not covered" > b.width = width;</span>
<span class="cstat-no" title="statement not covered" > b.height = height;</span>
}
&nbsp;
// Method 4: Try bounding array (older format)
const gAny = group as LGraphGroup &amp; { bounding?: number[] };
<span class="missing-if-branch" title="if path not taken" >I</span>if (Array.isArray(gAny.bounding)) {
<span class="cstat-no" title="statement not covered" > gAny.bounding[0] = x;</span>
<span class="cstat-no" title="statement not covered" > gAny.bounding[1] = y;</span>
<span class="cstat-no" title="statement not covered" > gAny.bounding[2] = width;</span>
<span class="cstat-no" title="statement not covered" > gAny.bounding[3] = height;</span>
}
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-251
View File
@@ -1,251 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> src/layout</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">81.4% </span>
<span class="quiet">Statements</span>
<span class='fraction'>836/1027</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">62.2% </span>
<span class="quiet">Branches</span>
<span class='fraction'>367/590</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.36% </span>
<span class="quiet">Functions</span>
<span class='fraction'>76/88</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84% </span>
<span class="quiet">Lines</span>
<span class='fraction'>788/938</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="bin-pack.ts"><a href="bin-pack.ts.html">bin-pack.ts</a></td>
<td data-value="60" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 60%"></div><div class="cover-empty" style="width: 40%"></div></div>
</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="75" class="abs medium">45/75</td>
<td data-value="56.66" class="pct medium">56.66%</td>
<td data-value="30" class="abs medium">17/30</td>
<td data-value="52.94" class="pct medium">52.94%</td>
<td data-value="17" class="abs medium">9/17</td>
<td data-value="63.63" class="pct medium">63.63%</td>
<td data-value="66" class="abs medium">42/66</td>
</tr>
<tr>
<td class="file medium" data-value="graph-builder.ts"><a href="graph-builder.ts.html">graph-builder.ts</a></td>
<td data-value="74.29" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.29" class="pct medium">74.29%</td>
<td data-value="249" class="abs medium">185/249</td>
<td data-value="59.87" class="pct medium">59.87%</td>
<td data-value="162" class="abs medium">97/162</td>
<td data-value="81.25" class="pct high">81.25%</td>
<td data-value="16" class="abs high">13/16</td>
<td data-value="78.07" class="pct medium">78.07%</td>
<td data-value="228" class="abs medium">178/228</td>
</tr>
<tr>
<td class="file medium" data-value="groups.ts"><a href="groups.ts.html">groups.ts</a></td>
<td data-value="74.02" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.02" class="pct medium">74.02%</td>
<td data-value="77" class="abs medium">57/77</td>
<td data-value="56.25" class="pct medium">56.25%</td>
<td data-value="32" class="abs medium">18/32</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="74.66" class="pct medium">74.66%</td>
<td data-value="75" class="abs medium">56/75</td>
</tr>
<tr>
<td class="file high" data-value="index.ts"><a href="index.ts.html">index.ts</a></td>
<td data-value="91.66" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 91%"></div><div class="cover-empty" style="width: 9%"></div></div>
</td>
<td data-value="91.66" class="pct high">91.66%</td>
<td data-value="24" class="abs high">22/24</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="10" class="abs medium">6/10</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="2" class="abs medium">1/2</td>
<td data-value="95.65" class="pct high">95.65%</td>
<td data-value="23" class="abs high">22/23</td>
</tr>
<tr>
<td class="file high" data-value="layer-assign.ts"><a href="layer-assign.ts.html">layer-assign.ts</a></td>
<td data-value="96" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 96%"></div><div class="cover-empty" style="width: 4%"></div></div>
</td>
<td data-value="96" class="pct high">96%</td>
<td data-value="50" class="abs high">48/50</td>
<td data-value="77.77" class="pct medium">77.77%</td>
<td data-value="18" class="abs medium">14/18</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="5" class="abs high">5/5</td>
<td data-value="95.83" class="pct high">95.83%</td>
<td data-value="48" class="abs high">46/48</td>
</tr>
<tr>
<td class="file high" data-value="layout-utils.ts"><a href="layout-utils.ts.html">layout-utils.ts</a></td>
<td data-value="94.64" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 94%"></div><div class="cover-empty" style="width: 6%"></div></div>
</td>
<td data-value="94.64" class="pct high">94.64%</td>
<td data-value="56" class="abs high">53/56</td>
<td data-value="69.44" class="pct medium">69.44%</td>
<td data-value="36" class="abs medium">25/36</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="98.11" class="pct high">98.11%</td>
<td data-value="53" class="abs high">52/53</td>
</tr>
<tr>
<td class="file medium" data-value="node-classifier.ts"><a href="node-classifier.ts.html">node-classifier.ts</a></td>
<td data-value="69.44" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 69%"></div><div class="cover-empty" style="width: 31%"></div></div>
</td>
<td data-value="69.44" class="pct medium">69.44%</td>
<td data-value="36" class="abs medium">25/36</td>
<td data-value="46.87" class="pct low">46.87%</td>
<td data-value="32" class="abs low">15/32</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="32" class="abs medium">24/32</td>
</tr>
<tr>
<td class="file high" data-value="ordering.ts"><a href="ordering.ts.html">ordering.ts</a></td>
<td data-value="95.74" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 95%"></div><div class="cover-empty" style="width: 5%"></div></div>
</td>
<td data-value="95.74" class="pct high">95.74%</td>
<td data-value="94" class="abs high">90/94</td>
<td data-value="66" class="pct medium">66%</td>
<td data-value="50" class="abs medium">33/50</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="14" class="abs high">14/14</td>
<td data-value="96.34" class="pct high">96.34%</td>
<td data-value="82" class="abs high">79/82</td>
</tr>
<tr>
<td class="file high" data-value="positioning.ts"><a href="positioning.ts.html">positioning.ts</a></td>
<td data-value="84.93" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 84%"></div><div class="cover-empty" style="width: 16%"></div></div>
</td>
<td data-value="84.93" class="pct high">84.93%</td>
<td data-value="365" class="abs high">310/365</td>
<td data-value="64.54" class="pct medium">64.54%</td>
<td data-value="220" class="abs medium">142/220</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="27" class="abs high">27/27</td>
<td data-value="87.27" class="pct high">87.27%</td>
<td data-value="330" class="abs high">288/330</td>
</tr>
<tr>
<td class="file high" data-value="types.ts"><a href="types.ts.html">types.ts</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-394
View File
@@ -1,394 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/index.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> index.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">91.66% </span>
<span class="quiet">Statements</span>
<span class='fraction'>22/24</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Branches</span>
<span class='fraction'>6/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Lines</span>
<span class='fraction'>22/23</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">31x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LGraph, LayoutConfig, LayoutResult } from "./types";
import { DEFAULT_CONFIG } from "./types";
import { buildLayoutGraph } from "./graph-builder";
import { assignLayers } from "./layer-assign";
import { minimizeCrossings } from "./ordering";
import {
assignLayerXPositions,
assignNodeYPositions,
recalculateLayerXPositions,
applyPositions,
compactVertically,
resolveAllOverlaps,
} from "./positioning";
import { resizeGroupsToFit } from "./groups";
import { debugLog } from "../debug";
&nbsp;
/**
* Main entry point: layout the entire graph
*
* Pipeline:
* 1. Build layout graph (classify nodes, collapse reroutes, filter disconnected)
* 2. Assign layers via longest-path algorithm
* 3. Minimize edge crossings via size-aware barycenter heuristic
* 4. Assign X/Y coordinates with bin packing
* 5. Compact vertically to reduce gaps
* 6. Apply positions (includes disconnected zone and reroute restoration)
* 7. Resize groups to fit their members
*/
export function layoutGraph(
graph: LGraph,
config?: Partial&lt;LayoutConfig&gt;
): LayoutResult {
const startTime = performance.now();
const fullConfig: LayoutConfig = { ...DEFAULT_CONFIG, ...config };
&nbsp;
// Handle empty graph
const nodeList = graph._nodes ?? <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
if (nodeList.length === 0) {
return {
nodeCount: 0,
layerCount: 0,
groupCount: 0,
executionMs: 0,
};
}
&nbsp;
// Phase 1: Build layout graph (includes classification and reroute collapse)
const state = buildLayoutGraph(graph, fullConfig);
&nbsp;
// Phase 2: Assign layers
assignLayers(state);
&nbsp;
// Phase 3: Minimize crossings (size-aware barycenter)
minimizeCrossings(state);
&nbsp;
// Phase 4: Assign coordinates (with bin packing)
assignLayerXPositions(state);
assignNodeYPositions(state);
&nbsp;
// Phase 4b: Recalculate X after bin packing updates maxWidth
// (bin packing may place multiple nodes in a row, making layer wider)
recalculateLayerXPositions(state);
&nbsp;
// Phase 5: Compact vertically
compactVertically(state);
&nbsp;
// Phase 6: Apply to ComfyUI nodes (includes disconnected and reroute handling)
applyPositions(state);
&nbsp;
// Phase 7: Resize groups
const groupCount = resizeGroupsToFit(state);
&nbsp;
// Phase 8: Resolve all overlaps (groups + nodes unified)
// Uses scanline algorithm with priority-based monotonic pushing
resolveAllOverlaps(state);
&nbsp;
// Trigger canvas redraw
<span class="missing-if-branch" title="if path not taken" >I</span>if (graph.setDirtyCanvas) {
<span class="cstat-no" title="statement not covered" > graph.setDirtyCanvas(true, true);</span>
}
&nbsp;
const executionMs = performance.now() - startTime;
&nbsp;
// Count total nodes including disconnected and reroutes
const disconnectedCount = state.disconnectedNodes?.size ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const rerouteCount = state.rerouteChains?.reduce(<span class="fstat-no" title="function not covered" >(s</span>um, c) =&gt; <span class="cstat-no" title="statement not covered" >sum + c.nodes.length, 0</span>) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const totalNodes = state.nodes.size + disconnectedCount + rerouteCount;
&nbsp;
debugLog(
`Layout complete: ${totalNodes} nodes (${state.nodes.size} in DAG, ${disconnectedCount} disconnected, ${rerouteCount} reroutes), ${state.layers.length} layers in ${executionMs.toFixed(1)}ms`
);
&nbsp;
return {
nodeCount: totalNodes,
layerCount: state.layers.length,
groupCount,
executionMs,
};
}
&nbsp;
// Re-export types and config
export type { LayoutConfig, LayoutResult } from "./types";
export { DEFAULT_CONFIG } from "./types";
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-391
View File
@@ -1,391 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/layer-assign.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> layer-assign.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96% </span>
<span class="quiet">Statements</span>
<span class='fraction'>48/50</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">77.77% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/18</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.83% </span>
<span class="quiet">Lines</span>
<span class='fraction'>46/48</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">63x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">196x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LayoutState, LayoutNode, Layer } from "./types";
&nbsp;
/**
* Assign layers to nodes using longest-path algorithm
* Sources (no predecessors) get layer 0
* Each node gets max(predecessor layers) + 1
*/
export function assignLayers(state: LayoutState): void {
const { nodes } = state;
&nbsp;
// Topological sort via Kahn's algorithm
const inDegree = new Map&lt;number, number&gt;();
const queue: number[] = [];
const order: number[] = [];
&nbsp;
// Initialize in-degrees
for (const [id, node] of nodes) {
inDegree.set(id, node.predecessors.length);
if (node.predecessors.length === 0) {
queue.push(id);
}
}
&nbsp;
// Process nodes in topological order
while (queue.length &gt; 0) {
const nodeId = queue.shift()!;
order.push(nodeId);
&nbsp;
const node = nodes.get(nodeId)!;
for (const succId of node.successors) {
const deg = (inDegree.get(succId) ?? <span class="branch-1 cbranch-no" title="branch not covered" >1) - 1</span>;
inDegree.set(succId, deg);
if (deg === 0) {
queue.push(succId);
}
}
}
&nbsp;
// Handle cycles: add remaining nodes (shouldn't happen in valid DAG)
for (const [id] of nodes) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!order.includes(id)) {
<span class="cstat-no" title="statement not covered" > order.push(id);</span>
}
}
&nbsp;
// Assign layers via longest path from sources
for (const nodeId of order) {
const node = nodes.get(nodeId)!;
&nbsp;
if (node.predecessors.length === 0) {
// Source node: layer 0
node.layer = 0;
} else {
// Max layer of predecessors + 1
let maxPredLayer = 0;
for (const predId of node.predecessors) {
const pred = nodes.get(predId);
<span class="missing-if-branch" title="else path not taken" >E</span>if (pred &amp;&amp; pred.layer &gt;= 0) {
maxPredLayer = Math.max(maxPredLayer, pred.layer + 1);
}
}
node.layer = maxPredLayer;
}
}
&nbsp;
// Ensure all nodes have valid layer (handle edge cases)
for (const node of nodes.values()) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (node.layer &lt; 0) {
<span class="cstat-no" title="statement not covered" > node.layer = 0;</span>
}
}
&nbsp;
// Build layer structures
const layerMap = new Map&lt;number, LayoutNode[]&gt;();
for (const node of nodes.values()) {
const arr = layerMap.get(node.layer) ?? [];
arr.push(node);
layerMap.set(node.layer, arr);
}
&nbsp;
// Sort layers by index and create Layer objects
const sortedLayerIndices = [...layerMap.keys()].sort((a, b) =&gt; a - b);
const layers: Layer[] = [];
&nbsp;
for (const index of sortedLayerIndices) {
const layerNodes = layerMap.get(index)!;
// Sort nodes in layer by ID for initial deterministic order
layerNodes.sort((a, b) =&gt; a.id - b.id);
layerNodes.forEach((n, i) =&gt; {
n.orderInLayer = i;
});
&nbsp;
layers.push({
index,
nodes: layerNodes,
x: 0,
maxWidth: Math.max(...layerNodes.map((n) =&gt; n.width), 100),
});
}
&nbsp;
state.layers = layers;
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-442
View File
@@ -1,442 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/layout-utils.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> layout-utils.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">94.64% </span>
<span class="quiet">Statements</span>
<span class='fraction'>53/56</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">69.44% </span>
<span class="quiet">Branches</span>
<span class='fraction'>25/36</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.11% </span>
<span class="quiet">Lines</span>
<span class='fraction'>52/53</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-yes">490x</span>
<span class="cline-any cline-yes">406x</span>
<span class="cline-any cline-yes">462x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">350x</span>
<span class="cline-any cline-yes">308x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-yes">84x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LGraphNode } from "./types";
&nbsp;
/**
* Get internal edges between group members by examining node connections
* Returns array of [sourceId, targetId] pairs where both are in the group
*/
export function getInternalEdges(
memberIds: Set&lt;number&gt;,
allNodes: Map&lt;number, LGraphNode&gt;
): Array&lt;[number, number]&gt; {
const edges: Array&lt;[number, number]&gt; = [];
&nbsp;
// Build a map of linkId -&gt; sourceNodeId for all member outputs
const linkToSource = new Map&lt;number, number&gt;();
for (const memberId of memberIds) {
const node = allNodes.get(memberId);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!node?.outputs) <span class="cstat-no" title="statement not covered" >continue;</span>
&nbsp;
for (const output of node.outputs) {
if (output.links) {
for (const linkId of output.links) {
linkToSource.set(linkId, memberId);
}
}
}
}
&nbsp;
// Check each member's inputs to find internal connections
for (const memberId of memberIds) {
const node = allNodes.get(memberId);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!node?.inputs) <span class="cstat-no" title="statement not covered" >continue;</span>
&nbsp;
for (const input of node.inputs) {
if (input.link !== null &amp;&amp; input.link !== undefined) {
const sourceId = linkToSource.get(input.link);
if (sourceId !== undefined &amp;&amp; memberIds.has(sourceId)) {
edges.push([sourceId, memberId]);
}
}
}
}
&nbsp;
return edges;
}
&nbsp;
/**
* Assign layers to group members using longest-path algorithm
* Returns members grouped by layer (index 0 = sources)
*/
export function assignMemberLayers(
memberIds: Set&lt;number&gt;,
edges: Array&lt;[number, number]&gt;,
allNodes: Map&lt;number, LGraphNode&gt;
): LGraphNode[][] {
// Build adjacency and in-degree
const successors = new Map&lt;number, number[]&gt;();
const inDegree = new Map&lt;number, number&gt;();
&nbsp;
for (const id of memberIds) {
successors.set(id, []);
inDegree.set(id, 0);
}
&nbsp;
for (const [source, target] of edges) {
successors.get(source)!.push(target);
inDegree.set(target, (inDegree.get(target) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0) + 1</span>);
}
&nbsp;
// Longest-path layer assignment via topological sort
const nodeLayer = new Map&lt;number, number&gt;();
const queue: number[] = [];
&nbsp;
// Start with sources (in-degree 0)
for (const id of memberIds) {
if ((inDegree.get(id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0) === 0</span>) {
queue.push(id);
nodeLayer.set(id, 0);
}
}
&nbsp;
while (queue.length &gt; 0) {
const current = queue.shift()!;
const currentLayer = nodeLayer.get(current) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
&nbsp;
for (const succ of successors.get(current) ?? <span class="branch-1 cbranch-no" title="branch not covered" >[]) {</span>
// Update successor layer to max of current paths
const succLayer = nodeLayer.get(succ) ?? 0;
nodeLayer.set(succ, Math.max(succLayer, currentLayer + 1));
&nbsp;
// Decrease in-degree and add to queue when all predecessors processed
const newInDegree = (inDegree.get(succ) ?? <span class="branch-1 cbranch-no" title="branch not covered" >1) - 1</span>;
inDegree.set(succ, newInDegree);
<span class="missing-if-branch" title="else path not taken" >E</span>if (newInDegree === 0) {
queue.push(succ);
}
}
}
&nbsp;
// Handle any unvisited nodes (cycles or disconnected)
for (const id of memberIds) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!nodeLayer.has(id)) {
<span class="cstat-no" title="statement not covered" > nodeLayer.set(id, 0);</span>
}
}
&nbsp;
// Group by layer
const maxLayer = Math.max(...nodeLayer.values(), 0);
const layers: LGraphNode[][] = Array.from({ length: maxLayer + 1 }, () =&gt; []);
&nbsp;
for (const id of memberIds) {
const node = allNodes.get(id);
<span class="missing-if-branch" title="else path not taken" >E</span>if (node) {
const layer = nodeLayer.get(id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
layers[layer].push(node);
}
}
&nbsp;
return layers;
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-322
View File
@@ -1,322 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/node-classifier.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> node-classifier.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">69.44% </span>
<span class="quiet">Statements</span>
<span class='fraction'>25/36</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">46.87% </span>
<span class="quiet">Branches</span>
<span class='fraction'>15/32</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Lines</span>
<span class='fraction'>24/32</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">420x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">420x</span>
<span class="cline-any cline-yes">420x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">420x</span>
<span class="cline-any cline-yes">420x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-yes">374x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">374x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">374x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">374x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">374x</span>
<span class="cline-any cline-yes">301x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">73x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LGraph, LLink, ClassifiedNodes } from "./types";
import { debugLog } from "../debug";
&nbsp;
/**
* Iterate over links in a graph (handles Map, Record, and Array formats)
*/
function* iterateLinks(
links: Map&lt;number, LLink&gt; | Record&lt;number, LLink&gt; | LLink[]
): Generator&lt;LLink&gt; {
if (links instanceof Map) {
for (const link of links.values()) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (link) yield link;
}
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="else path not taken" >E</span>} else if (Array.isArray(links)) {</span>
<span class="cstat-no" title="statement not covered" > for (const link of links) {</span>
<span class="cstat-no" title="statement not covered" > if (link) <span class="cstat-no" title="statement not covered" >yield link;</span></span>
}
} else {
<span class="cstat-no" title="statement not covered" > for (const link of Object.values(links)) {</span>
<span class="cstat-no" title="statement not covered" > if (link) <span class="cstat-no" title="statement not covered" >yield link;</span></span>
}
}
}
&nbsp;
/**
* Classify nodes into connected, disconnected, and reroutes
*
* - connected: nodes with at least one link
* - disconnected: nodes with no links (annotations, bookmarks, etc.)
* - reroutes: nodes with type "Reroute" (handled separately for chain collapse)
*/
export function classifyNodes(graph: LGraph): ClassifiedNodes {
const hasLinks = new Set&lt;number&gt;();
&nbsp;
// Mark all nodes that appear in any link
<span class="missing-if-branch" title="else path not taken" >E</span>if (graph.links) {
for (const link of iterateLinks(graph.links)) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof link.origin_id === "number") {
hasLinks.add(link.origin_id);
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (typeof link.target_id === "number") {
hasLinks.add(link.target_id);
}
}
}
&nbsp;
const connected = new Set&lt;number&gt;();
const disconnected = new Set&lt;number&gt;();
const reroutes = new Set&lt;number&gt;();
&nbsp;
const nodes = graph._nodes ?? <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
for (const node of nodes) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!node || node.id === undefined) <span class="cstat-no" title="statement not covered" >continue;</span>
&nbsp;
const nodeType = node.type ?? <span class="branch-1 cbranch-no" title="branch not covered" >"";</span>
&nbsp;
// Check if this is a reroute node
// Common reroute types: "Reroute", "Reroute (rgthree)", etc.
const isReroute = nodeType === "Reroute" || nodeType.startsWith("Reroute ");
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (isReroute) {
<span class="cstat-no" title="statement not covered" > reroutes.add(node.id);</span>
// Reroutes are also tracked as connected if they have links
<span class="cstat-no" title="statement not covered" > if (hasLinks.has(node.id)) {</span>
<span class="cstat-no" title="statement not covered" > connected.add(node.id);</span>
}
} else if (hasLinks.has(node.id)) {
connected.add(node.id);
} else {
disconnected.add(node.id);
}
}
&nbsp;
debugLog(
`Classified: ${connected.size} connected, ${disconnected.size} disconnected, ${reroutes.size} reroutes`
);
&nbsp;
return { connected, disconnected, reroutes };
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-670
View File
@@ -1,670 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/ordering.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> ordering.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">95.74% </span>
<span class="quiet">Statements</span>
<span class='fraction'>90/94</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66% </span>
<span class="quiet">Branches</span>
<span class='fraction'>33/50</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/14</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">96.34% </span>
<span class="quiet">Lines</span>
<span class='fraction'>79/82</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">30x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-yes">217x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-yes">280x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-yes">175x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">154x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-yes">189x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-yes">119x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">98x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-yes">56x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">126x</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">70x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import type { LayoutState, Layer, LayoutNode } from "./types";
&nbsp;
/**
* Minimize edge crossings using size-aware barycenter heuristic
* Uses cumulative height positions instead of simple indices
* Alternates forward and backward sweeps
*/
export function minimizeCrossings(state: LayoutState): void {
const { layers, nodes, config } = state;
&nbsp;
if (layers.length &lt; 2) return;
&nbsp;
// Initial ordering: sort by node height (tall nodes first reduces gaps)
for (const layer of layers) {
layer.nodes.sort((a, b) =&gt; b.height - a.height);
layer.nodes.forEach((n, i) =&gt; {
n.orderInLayer = i;
});
}
&nbsp;
// Pre-compute cumulative height positions for size-aware barycenter
const heightPositions = new Map&lt;number, number&gt;();
updateHeightPositions(layers, heightPositions, config.verticalGap);
&nbsp;
// Iterative improvement with forward/backward sweeps
for (let iter = 0; iter &lt; config.maxIterations; iter++) {
const improved =
iter % 2 === 0
? sweepForward(layers, nodes, heightPositions, config.verticalGap)
: sweepBackward(layers, nodes, heightPositions, config.verticalGap);
&nbsp;
if (!improved) break;
}
}
&nbsp;
/**
* Compute cumulative height positions for each node
* This gives a position-like weight for size-aware ordering
*/
function updateHeightPositions(
layers: Layer[],
positions: Map&lt;number, number&gt;,
verticalGap: number
): void {
for (const layer of layers) {
let y = 0;
for (const node of layer.nodes) {
// Position is center of node
positions.set(node.id, y + node.height / 2);
y += node.height + verticalGap;
}
}
}
&nbsp;
/**
* Forward sweep: order each layer based on predecessors in previous layer
* Uses height-aware positions for better size consideration
*/
function sweepForward(
layers: Layer[],
nodes: Map&lt;number, LayoutNode&gt;,
heightPositions: Map&lt;number, number&gt;,
verticalGap: number
): boolean {
let improved = false;
&nbsp;
for (let i = 1; i &lt; layers.length; i++) {
const currLayer = layers[i];
&nbsp;
// Compute size-aware barycenter for each node
const barycenters = new Map&lt;number, number&gt;();
&nbsp;
for (const node of currLayer.nodes) {
if (node.predecessors.length &gt; 0) {
let sum = 0;
let count = 0;
&nbsp;
for (const predId of node.predecessors) {
const pred = nodes.get(predId);
if (pred &amp;&amp; pred.layer === i - 1) {
// Use height position instead of simple index
const pos = heightPositions.get(predId) ?? <span class="branch-1 cbranch-no" title="branch not covered" >pred.orderInLayer;</span>
sum += pos;
count++;
}
}
&nbsp;
if (count &gt; 0) {
barycenters.set(node.id, sum / count);
} else <span class="missing-if-branch" title="else path not taken" >E</span>{
<span class="cstat-no" title="statement not covered" > barycenters.set(node.id, heightPositions.get(node.id) ?? 0);</span>
}
} else <span class="missing-if-branch" title="else path not taken" >E</span>{
<span class="cstat-no" title="statement not covered" > barycenters.set(node.id, heightPositions.get(node.id) ?? 0);</span>
}
}
&nbsp;
// Sort by barycenter, tie-break by ID for determinism
const oldOrder = currLayer.nodes.map((n) =&gt; n.id).join(",");
currLayer.nodes.sort((a, b) =&gt; {
const aBar = barycenters.get(a.id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const bBar = barycenters.get(b.id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const diff = aBar - bBar;
return diff !== 0 ? diff : a.id - b.id;
});
&nbsp;
// Reassign integer order
currLayer.nodes.forEach((n, idx) =&gt; {
n.orderInLayer = idx;
});
&nbsp;
// Update height positions for next iteration
let y = 0;
for (const node of currLayer.nodes) {
heightPositions.set(node.id, y + node.height / 2);
y += node.height + verticalGap;
}
&nbsp;
const newOrder = currLayer.nodes.map((n) =&gt; n.id).join(",");
if (oldOrder !== newOrder) improved = true;
}
&nbsp;
return improved;
}
&nbsp;
/**
* Backward sweep: order each layer based on successors in next layer
* Uses height-aware positions for better size consideration
*/
function sweepBackward(
layers: Layer[],
nodes: Map&lt;number, LayoutNode&gt;,
heightPositions: Map&lt;number, number&gt;,
verticalGap: number
): boolean {
let improved = false;
&nbsp;
for (let i = layers.length - 2; i &gt;= 0; i--) {
const currLayer = layers[i];
&nbsp;
// Compute size-aware barycenter for each node based on successors
const barycenters = new Map&lt;number, number&gt;();
&nbsp;
for (const node of currLayer.nodes) {
if (node.successors.length &gt; 0) {
let sum = 0;
let count = 0;
&nbsp;
for (const succId of node.successors) {
const succ = nodes.get(succId);
if (succ &amp;&amp; succ.layer === i + 1) {
// Use height position instead of simple index
const pos = heightPositions.get(succId) ?? <span class="branch-1 cbranch-no" title="branch not covered" >succ.orderInLayer;</span>
sum += pos;
count++;
}
}
&nbsp;
if (count &gt; 0) {
barycenters.set(node.id, sum / count);
} else {
barycenters.set(node.id, heightPositions.get(node.id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0)</span>;
}
} else <span class="missing-if-branch" title="else path not taken" >E</span>{
<span class="cstat-no" title="statement not covered" > barycenters.set(node.id, heightPositions.get(node.id) ?? 0);</span>
}
}
&nbsp;
// Sort by barycenter, tie-break by ID for determinism
const oldOrder = currLayer.nodes.map((n) =&gt; n.id).join(",");
currLayer.nodes.sort((a, b) =&gt; {
const aBar = barycenters.get(a.id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const bBar = barycenters.get(b.id) ?? <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
const diff = aBar - bBar;
return diff !== 0 ? diff : a.id - b.id;
});
&nbsp;
// Reassign integer order
currLayer.nodes.forEach((n, idx) =&gt; {
n.orderInLayer = idx;
});
&nbsp;
// Update height positions for next iteration
let y = 0;
for (const node of currLayer.nodes) {
heightPositions.set(node.id, y + node.height / 2);
y += node.height + verticalGap;
}
&nbsp;
const newOrder = currLayer.nodes.map((n) =&gt; n.id).join(",");
<span class="missing-if-branch" title="if path not taken" >I</span>if (oldOrder !== newOrder) <span class="cstat-no" title="statement not covered" >improved = true;</span>
}
&nbsp;
return improved;
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
File diff suppressed because it is too large Load Diff
-874
View File
@@ -1,874 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for src/layout/types.ts</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">src/layout</a> types.ts</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>1/1</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a>
<a name='L260'></a><a href='#L260'>260</a>
<a name='L261'></a><a href='#L261'>261</a>
<a name='L262'></a><a href='#L262'>262</a>
<a name='L263'></a><a href='#L263'>263</a>
<a name='L264'></a><a href='#L264'>264</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/**
* Minimal type definitions for ComfyUI/LiteGraph
* These match the runtime global objects, not the package exports
*/
&nbsp;
/** Point as [x, y] */
export type Point = [x: number, y: number];
&nbsp;
/** Size as [width, height] */
export type Size = [width: number, height: number];
&nbsp;
/** Node input slot */
export interface NodeInputSlot {
name: string;
type: string;
link: number | null;
}
&nbsp;
/** Node output slot */
export interface NodeOutputSlot {
name: string;
type: string;
links: number[] | null;
}
&nbsp;
/** Node flags */
export interface NodeFlags {
pinned?: boolean;
collapsed?: boolean;
}
&nbsp;
/** LiteGraph Node */
export interface LGraphNode {
id: number;
type: string;
title: string;
pos: Point;
size: Size;
inputs: NodeInputSlot[];
outputs: NodeOutputSlot[];
flags?: NodeFlags;
locked?: boolean;
order?: number;
}
&nbsp;
/** LiteGraph Group */
export interface LGraphGroup {
id: number;
title: string;
pos: Point;
size: Size;
_nodes?: LGraphNode[];
_children?: Set&lt;{ id: number }&gt;;
_bounding?: {
x: number;
y: number;
width: number;
height: number;
set?: (x: number, y: number, w: number, h: number) =&gt; void;
};
resizeTo?: (items: Iterable&lt;LGraphNode&gt;, padding?: number) =&gt; void;
}
&nbsp;
/** LiteGraph Link */
export interface LLink {
id: number;
origin_id: number;
origin_slot: number;
target_id: number;
target_slot: number;
type: string;
}
&nbsp;
/** Subgraph I/O node (uses bounding array format) */
export interface SubgraphIONode {
id: number;
bounding: [x: number, y: number, width: number, height: number];
}
&nbsp;
/** LiteGraph Graph (or Subgraph with I/O nodes) */
export interface LGraph {
_nodes: LGraphNode[];
_groups: LGraphGroup[];
/** Links can be Map, Record, or Array depending on context */
links: Map&lt;number, LLink&gt; | Record&lt;number, LLink&gt; | LLink[];
setDirtyCanvas?: (fg: boolean, bg: boolean) =&gt; void;
/** Subgraph input node (only on Subgraph, not root LGraph) */
inputNode?: SubgraphIONode;
/** Subgraph output node (only on Subgraph, not root LGraph) */
outputNode?: SubgraphIONode;
}
&nbsp;
/** Layout node with computed metadata */
export interface LayoutNode {
/** Reference to ComfyUI node */
node: LGraphNode;
/** Node ID */
id: number;
/** DAG depth (0 = sources/inputs) */
layer: number;
/** Vertical position within layer */
orderInLayer: number;
/** Node IDs this depends on (predecessors) */
predecessors: number[];
/** Node IDs that depend on this (successors) */
successors: number[];
/** Node width (or group width if representative) */
width: number;
/** Node height (or group height if representative) */
height: number;
/** Computed X coordinate */
x: number;
/** Computed Y coordinate */
y: number;
/** True if this node represents a group in the layout */
isGroupRepresentative?: boolean;
/** The group this node represents (if isGroupRepresentative) */
group?: LayoutGroup;
/** True if this is a subgraph I/O node (input or output boundary) */
isSubgraphIO?: boolean;
/** Reference to runtime I/O node for position updates (has pos/size) */
runtimeIONode?: { id: number; pos: [number, number]; size: [number, number] };
}
&nbsp;
/** Layer = vertical column of nodes */
export interface Layer {
/** Layer index (0 = leftmost) */
index: number;
/** Nodes in this layer */
nodes: LayoutNode[];
/** Computed X position for this layer */
x: number;
/** Max node width in this layer */
maxWidth: number;
}
&nbsp;
/** Layout group tracking with hierarchy support */
export interface LayoutGroup {
/** Reference to ComfyUI group */
group: LGraphGroup;
/** Node IDs directly contained (not in child groups) */
memberIds: Set&lt;number&gt;;
/** Child groups (nested inside this group) */
childGroups: LayoutGroup[];
/** Parent group (group containing this one), null for top-level */
parentGroup: LayoutGroup | null;
/** Nesting depth (0 = top-level) */
depth: number;
/** Calculated width for the group */
width: number;
/** Calculated height for the group */
height: number;
}
&nbsp;
/** Layout configuration */
export interface LayoutConfig {
/** Horizontal gap between layers */
horizontalGap: number;
/** Vertical gap between nodes in same layer */
verticalGap: number;
/** Padding inside groups */
groupPadding: number;
/** Layout origin X */
startX: number;
/** Layout origin Y */
startY: number;
/** Max barycenter iterations */
maxIterations: number;
/** Max columns per layer (0=auto, 1=disabled/vertical stack, 2+=fixed) */
maxColumns: number;
/** Max row width before new row when maxColumns=0 */
maxRowWidth: number;
/** Collapse reroute chains into edge waypoints */
collapseReroutes: boolean;
/** Gap between disconnected zone and DAG */
disconnectedGap: number;
}
&nbsp;
/** Default configuration */
export const DEFAULT_CONFIG: LayoutConfig = {
horizontalGap: 100,
verticalGap: 40,
groupPadding: 30,
startX: 100,
startY: 100,
maxIterations: 24,
maxColumns: 0,
maxRowWidth: 800,
collapseReroutes: true,
disconnectedGap: 150,
};
&nbsp;
/** Node classification result */
export interface ClassifiedNodes {
/** Nodes with connections (participate in DAG) */
connected: Set&lt;number&gt;;
/** Nodes without any connections */
disconnected: Set&lt;number&gt;;
/** Reroute nodes (for special handling) */
reroutes: Set&lt;number&gt;;
}
&nbsp;
/** Reroute chain for collapse/restore */
export interface RerouteChain {
/** Reroute node IDs in order */
nodes: number[];
/** Source node before chain */
sourceNode: number;
/** Source slot index */
sourceSlot: number;
/** Target nodes after chain */
targets: Array&lt;{ node: number; slot: number }&gt;;
}
&nbsp;
/** Packed row within a layer (for bin packing) */
export interface PackedRow {
/** Node IDs in this row */
nodes: number[];
/** Max node height in row */
height: number;
/** Vertical offset from layer start */
yOffset: number;
/** Total width of nodes + gaps in row */
width: number;
}
&nbsp;
/** Graph layout state */
export interface LayoutState {
/** All layout nodes by ID (includes group representatives) */
nodes: Map&lt;number, LayoutNode&gt;;
/** Layers of nodes */
layers: Layer[];
/** Groups */
groups: LayoutGroup[];
/** Config */
config: LayoutConfig;
/** Maps node ID to its group (if any) */
nodeToGroup?: Map&lt;number, LayoutGroup&gt;;
/** Maps group to its representative node ID */
groupRepresentatives?: Map&lt;LayoutGroup, number&gt;;
/** All original ComfyUI nodes by ID */
allNodes?: Map&lt;number, LGraphNode&gt;;
/** Groups organized by depth (index 0 = deepest) for bottom-up processing */
groupsByDepth?: LayoutGroup[][];
/** Disconnected node IDs (placed in separate zone) */
disconnectedNodes?: Set&lt;number&gt;;
/** Collapsed reroute chains (restored after layout) */
rerouteChains?: RerouteChain[];
/** Packed rows per layer (for bin-packed layout) */
packedRows?: Map&lt;number, PackedRow[]&gt;;
}
&nbsp;
/** Layout result */
export interface LayoutResult {
/** Number of nodes processed */
nodeCount: number;
/** Number of layers */
layerCount: number;
/** Number of groups resized */
groupCount: number;
/** Execution time in ms */
executionMs: number;
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2026-01-08T01:41:46.105Z
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>
-66
View File
@@ -24,13 +24,6 @@ describe("layoutGraph regression tests", () => {
"complex-parallel.json", // 26 nodes, parallel KSampler High/Low, 5 groups
];
// Fixtures with known issues (documented for future fixes)
// These use test.skip() to document expected failures
const knownIssueFixtures: Array<{ name: string; issues: string[] }> = [
// All fixtures now pass - keeping array for future regression tracking
];
// Test passing fixtures with all invariants
for (const fixture of passingFixtures) {
describe(fixture, () => {
let graph: LGraph;
@@ -67,65 +60,6 @@ describe("layoutGraph regression tests", () => {
});
});
}
// Test fixtures with known issues - skip failing tests
for (const { name, issues } of knownIssueFixtures) {
describe(name, () => {
let graph: LGraph;
let originalGraph: LGraph;
beforeEach(() => {
graph = loadFixture(name);
originalGraph = cloneGraph(graph);
layoutGraph(graph);
});
// Skip overlap test if known issue
if (issues.includes("overlap")) {
it.skip("has no overlapping entities (KNOWN ISSUE)", () => {
assertNoOverlaps(graph);
});
} else {
it("has no overlapping entities", () => {
assertNoOverlaps(graph);
});
}
it("keeps nodes inside their groups", () => {
assertNodesInsideGroups(graph);
});
it("has finite coordinates", () => {
assertFiniteCoordinates(graph);
});
it("preserves topological order", () => {
assertTopologicalOrder(graph);
});
// Skip idempotent test if known issue
if (issues.includes("idempotent")) {
it.skip("is idempotent (KNOWN ISSUE)", () => {
assertIdempotent(graph);
});
} else {
it("is idempotent (stable after multiple runs)", () => {
assertIdempotent(graph);
});
}
// Skip membership test if known issue
if (issues.includes("membership")) {
it.skip("preserves group membership (KNOWN ISSUE)", () => {
assertGroupMembershipPreserved(originalGraph, graph);
});
} else {
it("preserves group membership", () => {
assertGroupMembershipPreserved(originalGraph, graph);
});
}
});
}
});
describe("layout algorithm properties", () => {