Using cose-bilkent layout algorithm for mindmaps

This commit is contained in:
Knut Sveidqvist
2022-10-03 10:05:12 +02:00
parent 383cbcf3a0
commit 5079fa93b4
9 changed files with 247 additions and 164 deletions

View File

@@ -164,6 +164,7 @@ const roundedRectBkg = function (elem, node) {
*/
export const drawNode = function (elem, node, section, conf) {
const nodeElem = elem.append('g');
node.section = section;
nodeElem.attr(
'class',
(node.class ? node.class + ' ' : '') +
@@ -252,9 +253,9 @@ export const drawNode = function (elem, node, section, conf) {
}
// Position the node to its coordinate
if (typeof node.x !== 'undefined' && typeof node.y !== 'undefined') {
nodeElem.attr('transform', 'translate(' + node.x + ',' + node.y + ')');
}
// if (typeof node.x !== 'undefined' && typeof node.y !== 'undefined') {
// nodeElem.attr('transform', 'translate(' + node.x + ',' + node.y + ')');
// }
db.setElementForId(node.id, nodeElem);
return node.height;
};