colored relationships #724
Some checks are pending
Code checks / check-url-paths (push) Waiting to run
docker / docker_dev (push) Waiting to run
Deploy MkDocs / deploy (push) Waiting to run

This commit is contained in:
jokob-sk
2025-07-14 15:24:38 +10:00
parent 61de54bc34
commit bfbf70cf1a
5 changed files with 111 additions and 27 deletions

View File

@@ -583,9 +583,9 @@ function getChildren(node, list, path, visited = [])
icon: node.devIcon,
type: node.devType,
status: node.devStatus,
hasChildren: children.length > 0 || hiddenMacs.includes(node.mac),
hasChildren: children.length > 0 || hiddenMacs.includes(node.devMac),
relType: node.devParentRelType,
hiddenChildren: hiddenMacs.includes(node.mac),
hiddenChildren: hiddenMacs.includes(node.devMac),
qty: children.length,
children: children
};
@@ -775,20 +775,11 @@ function initTree(myHierarchy)
hasFlatData: false,
relationnalField: "children",
linkWidth: (nodeData) => 3,
linkColor: (nodeData) => {
linkColor: (nodeData) => {
switch (nodeData.data.relType) {
case "default":
return "#ffcc80"; // yellow
break;
case "nic":
return "#dd4b39"; // red
break;
default:
return "#ffcc80";
break;
}
relConf = getRelationshipConf(nodeData.data.relType)
return relConf.color;
}
// onNodeClick: (nodeData) => handleNodeClick(nodeData),
});