Accepted answer

I guess I need a bit more patience before asking a question. The way I solved the problem is:

var icon = svg.append("svg:g").selectAll("g")

  .attr("x", -20)
  .attr("y", -2)
  .attr("width", 12).attr("height", 12)
        .attr("class", "type-icon");

And then in the tick function:

        icon.attr("transform", function(d) {
            return "translate(" +(( + "," +
                (( + ")";

to get the center point between the two nodes.

Related Query

More Query from same tag