I have no idea what I am doing wrong. Once I append an image to my node, all I see are the links but no flags at the nodes!
The CodePen is here
Here is the heart of the code:
var node = svg.selectAll('.node')
.data(nodes)
.enter()
.append('img')
.attr('class', function (d) {
return 'flag flag-' + d.code;
})
.on("mouseover", function(d) {
div.transition()
.duration(200)
.style("opacity", .9);
div .html("Country: " + d.country)
.style("left", (d3.event.pageX) + "px")
.style("top", (d3.event.pageY - 28) + "px");
})
.on("mouseout", function(d) {
div.transition()
.duration(500)
.style("opacity", 0);
});