Skip to content

Commit

Permalink
Error on scenario of Fig 5 in paper #33
Browse files Browse the repository at this point in the history
  • Loading branch information
osamazafar980 committed Oct 17, 2023
1 parent 9e855bc commit 5e47cb7
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 16 deletions.
28 changes: 24 additions & 4 deletions dist/cytoscape-complexity-management.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,26 @@ var layoutOptions = {
}
};
document.getElementsByName('cbk-flag-display-node-label-pos');

// Function to set the label position based on the selected radio button
function setLabelPosition(position) {
var cyChildlessNodes = cy.nodes().filter(function (element) {
return element.isChildless();
});
var cyVisibleChildlessNodes = cyVisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyInVisibleChildlessNodes = cyInvisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyLayoutChildlessNodes = cyLayout.nodes().filter(function (element) {
return element.isChildless();
});
cyChildlessNodes.style('text-valign', position);
cyVisibleChildlessNodes.style('text-valign', position);
cyInVisibleChildlessNodes.style('text-valign', position);
cyLayoutChildlessNodes.style('text-valign', position);
}
function cueUtilities(params, cy, api) {
var fn = params;
var CUE_POS_UPDATE_DELAY = 100;
Expand Down Expand Up @@ -1622,7 +1642,7 @@ function cueUtilities(params, cy, api) {
clearDraws();
if (document.getElementById("cbk-flag-recursive").checked) {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1631,7 +1651,7 @@ function cueUtilities(params, cy, api) {
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1642,7 +1662,7 @@ function cueUtilities(params, cy, api) {
}
} else {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1651,7 +1671,7 @@ function cueUtilities(params, cy, api) {
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand Down
28 changes: 24 additions & 4 deletions dist/cytoscape-complexity-management.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,26 @@ var layoutOptions = {
}
};
document.getElementsByName('cbk-flag-display-node-label-pos');

// Function to set the label position based on the selected radio button
function setLabelPosition(position) {
var cyChildlessNodes = cy.nodes().filter(function (element) {
return element.isChildless();
});
var cyVisibleChildlessNodes = cyVisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyInVisibleChildlessNodes = cyInvisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyLayoutChildlessNodes = cyLayout.nodes().filter(function (element) {
return element.isChildless();
});
cyChildlessNodes.style('text-valign', position);
cyVisibleChildlessNodes.style('text-valign', position);
cyInVisibleChildlessNodes.style('text-valign', position);
cyLayoutChildlessNodes.style('text-valign', position);
}
function cueUtilities(params, cy, api) {
var fn = params;
var CUE_POS_UPDATE_DELAY = 100;
Expand Down Expand Up @@ -1620,7 +1640,7 @@ function cueUtilities(params, cy, api) {
clearDraws();
if (document.getElementById("cbk-flag-recursive").checked) {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1629,7 +1649,7 @@ function cueUtilities(params, cy, api) {
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1640,7 +1660,7 @@ function cueUtilities(params, cy, api) {
}
} else {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -1649,7 +1669,7 @@ function cueUtilities(params, cy, api) {
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand Down
28 changes: 24 additions & 4 deletions dist/cytoscape-complexity-management.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5758,6 +5758,26 @@
}
};
document.getElementsByName('cbk-flag-display-node-label-pos');

// Function to set the label position based on the selected radio button
function setLabelPosition(position) {
var cyChildlessNodes = cy.nodes().filter(function (element) {
return element.isChildless();
});
var cyVisibleChildlessNodes = cyVisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyInVisibleChildlessNodes = cyInvisible.nodes().filter(function (element) {
return element.isChildless();
});
var cyLayoutChildlessNodes = cyLayout.nodes().filter(function (element) {
return element.isChildless();
});
cyChildlessNodes.style('text-valign', position);
cyVisibleChildlessNodes.style('text-valign', position);
cyInVisibleChildlessNodes.style('text-valign', position);
cyLayoutChildlessNodes.style('text-valign', position);
}
function cueUtilities(params, cy, api) {
var fn = params;
var CUE_POS_UPDATE_DELAY = 100;
Expand Down Expand Up @@ -5984,7 +6004,7 @@
clearDraws();
if (document.getElementById("cbk-flag-recursive").checked) {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -5993,7 +6013,7 @@
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -6004,7 +6024,7 @@
}
} else {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -6013,7 +6033,7 @@
}
}, document.getElementById("cbk-run-layout3").checked ? 700 : 0);
} else {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage, setLabelPosition);
setTimeout(function () {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand Down
9 changes: 5 additions & 4 deletions src/cue-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ export function cueUtilities(params, cy, api) {
clearDraws();
if (document.getElementById("cbk-flag-recursive").checked) {
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);

api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage,setLabelPosition);
setTimeout(() => {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -696,7 +697,7 @@ export function cueUtilities(params, cy, api) {
}, document.getElementById("cbk-run-layout3").checked?700:0);

}else{
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], true, document.getElementById("cbk-run-layout3").checked, pngImage,setLabelPosition);
setTimeout(() => {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -709,7 +710,7 @@ export function cueUtilities(params, cy, api) {
}
}else{
if (document.getElementById("cbk-run-layout3").checked) {
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage,setLabelPosition);
setTimeout(() => {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand All @@ -719,7 +720,7 @@ export function cueUtilities(params, cy, api) {
}
}, document.getElementById("cbk-run-layout3").checked?700:0);
}else{
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked);
api.expandNodes([node], false, document.getElementById("cbk-run-layout3").checked, pngImage,setLabelPosition);
setTimeout(() => {
if (document.getElementById("cbk-run-layout3").checked) {
cy.layout(layoutOptions).run();
Expand Down

0 comments on commit 5e47cb7

Please sign in to comment.