highlightNode(params.nodes);
}
+function getAllPackagesBuildTriggered(node) {
+ var connectedNodes = network.getConnectedNodes(node);
+ var allPackages = {};
+
+ for( var i = 0; i < connectedNodes.length; ++i ) {
+
+ if( allNodes[connectedNodes[i]].level < allNodes[node].level )
+ continue;
+
+ var label = allNodes[connectedNodes[i]].label;
+
+ if( label === undefined ) {
+ label = allNodes[connectedNodes[i]].hiddenLabel;
+ }
+ allPackages[label] = 1;
+
+ var nextPackages = getAllPackagesBuildTriggered(connectedNodes[i]);
+
+ for(var j in nextPackages) {
+ allPackages[j] = 1;
+ }
+ }
+
+ return allPackages;
+}
+
function highlightNode(nodes)
{
// if something is selected:
// }
// }
- var packages_build_triggers="";
- var packages_build_triggered="";
- var packages_build_triggers_count=0;
- var packages_build_triggered_count=0;
+ var packages_build_triggers=[];
+ var packages_build_triggered=[];
// all first degree nodes get their own color and their label back
for (i = 0; i < connectedNodes.length; i++) {
if( allNodes[connectedNodes[i]].set_color === undefined ) {
allNodes[connectedNodes[i]].hiddenLabel = undefined;
if( allNodes[selectedNode].level <= allNodes[connectedNodes[i]].level ) {
- packages_build_triggered = packages_build_triggered+allNodes[connectedNodes[i]].label+",";
- packages_build_triggered_count++;
+ packages_build_triggered.push(allNodes[connectedNodes[i]].label);
} else {
- packages_build_triggers = packages_build_triggers+allNodes[connectedNodes[i]].label+",";
- packages_build_triggers_count++;
+ packages_build_triggers.push(allNodes[connectedNodes[i]].label);
}
}
}
if( document.getElementById("build_triggers") ) {
// set table contents.
document.getElementById("build_triggers").innerHTML="Packages build-triggers "+
- allNodes[selectedNode].label+"("+packages_build_triggers_count+")";
- document.getElementById("packages_build_triggers").innerHTML=packages_build_triggers;
+ allNodes[selectedNode].label+"("+packages_build_triggers.length+")";
+ document.getElementById("packages_build_triggers").innerHTML=packages_build_triggers.join();
document.getElementById("build_triggered").innerHTML="Packages build-triggered by "+
- allNodes[selectedNode].label+"("+packages_build_triggered_count+")";
- document.getElementById("packages_build_triggered").innerHTML=packages_build_triggered;
+ allNodes[selectedNode].label+"("+packages_build_triggered.length+")";
+ document.getElementById("packages_build_triggered").innerHTML=packages_build_triggered.join();
}
+
+ if( document.getElementById("build_triggered_transitively") ) {
+ var all_packages_build_triggered = Object.keys(getAllPackagesBuildTriggered(selectedNode));
+
+ document.getElementById("build_triggered_transitively").innerHTML="Packages build-triggered transitively by "+
+ allNodes[selectedNode].label+"("+all_packages_build_triggered.length+")";
+ document.getElementById("packages_build_triggered_transitively").innerHTML = all_packages_build_triggered.join();
+ }
+
}
else if (highlightActive === true) {
// reset all nodes