I am trying to adapt this chord diagram by Mike Bostock:
I want the text labels to rotate outward, like this chord diagram:
http://bost.ocks.org/mike/uberdata/

There is an example here
http://bl.ocks.org/mbostock/910126

However, the conversion is done using svg: text:
g.append("svg:text")
.each(function(d) { d.angle = (d.startAngle + d.endAngle) / 2; })
.attr("dy", ".35em")
.attr("text-anchor", function(d) { return d.angle > Math.PI ? "end" : null; })
.attr("transform", function(d) {
return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")"
+ "translate(" + (r0 + 26) + ")"
+ (d.angle > Math.PI ? "rotate(180)" : "");
})
.text(function(d) { return nameByIndex[d.index]; });
The one I'm trying to adapt uses "text" and "textPath", and I can't seem to just add the transform / rotate attribute. Adding this line
.attr("transform",function(d,i){return "rotate(90)";})
to the code below does nothing:
var groupText = group.append("text")
.attr("x", 6)
.attr("dy", 15);
groupText.append("textPath")
.attr("xlink:href", function(d, i) { return "#group" + i; })
.text(function(d, i) { return cities[i].country; });
Any ideas on how I can turn the text out, so the small text labels of the chord groups can be displayed without grouping or (like the original solution) completely disabled?