Skip to content
Snippets Groups Projects
Commit 707e3691 authored by Lunar's avatar Lunar
Browse files

Display node name and bandwidth on mouseover (#6443)

parent d226a7d1
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,18 @@ d3.json("details.json", function(error, data) {
.attr("width", function(d) { return d.r * 2; })
.attr("height", function(d) { return d.r * 2; })
.attr("preserveAspectRatio", "xMidYMin")
.attr("filter", function(d) { return d.exit ? "" : "url(#middle-filter)"; });
.attr("filter", function(d) { return d.exit ? "" : "url(#middle-filter)"; })
.on("mouseover", function(d) {
svg.append("text")
.attr("transform", "translate(" + diameter + "," + (diameter - legendHeight - 50) + ")")
.attr("id", "relay-bw")
.style("text-anchor", "end")
.style("font-size", "14pt")
.text(d.className.substring(0, 20) + ": " + (d.bandwidth * 8.0 / 1000.0 / 1000.0).toFixed(2) + " Mbit/s");
})
.on("mouseout", function() {
d3.select("#relay-bw").remove();
});
var title = svg.append("g")
.attr("transform", "translate(" + (diameter / 3) +", " + (diameter - 30) + ")");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment