count uplinks from nodes.json
parent
536ef57121
commit
77ef7ec4da
|
@ -158,12 +158,15 @@ function render_graph(type) {
|
||||||
node.append("title")
|
node.append("title")
|
||||||
.text(function(d) { return d.macs; });
|
.text(function(d) { return d.macs; });
|
||||||
|
|
||||||
|
if (type == "mesh") {
|
||||||
var uplink_info = node.filter(function (d) {
|
var uplink_info = node.filter(function (d) {
|
||||||
return d.name == "krtek"
|
if (d.uplinks !== undefined)
|
||||||
|
return d.uplinks.length > 0;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
})
|
})
|
||||||
.append("g");
|
.append("g");
|
||||||
|
|
||||||
if (type == "mesh") {
|
|
||||||
uplink_info.append("rect")
|
uplink_info.append("rect")
|
||||||
.attr("width", 16)
|
.attr("width", 16)
|
||||||
.attr("height", 16)
|
.attr("height", 16)
|
||||||
|
@ -175,7 +178,7 @@ function render_graph(type) {
|
||||||
uplink_info.append("text")
|
uplink_info.append("text")
|
||||||
.attr("text-anchor", "middle")
|
.attr("text-anchor", "middle")
|
||||||
.attr("y", 4 - 20)
|
.attr("y", 4 - 20)
|
||||||
.text("8");
|
.text(function (d) {return d.uplinks.length});
|
||||||
}
|
}
|
||||||
|
|
||||||
force.on("tick", function() {
|
force.on("tick", function() {
|
||||||
|
|
Loading…
Reference in New Issue