注意(因为我正在回答我的问题):如果你们中的一些人已经在这个问题上花费了时间并找到了另一个解决方案,请发布它,我会接受你的回答。感谢@FernOfTheAndes 参与寻找这个解决方案的过程,因为它充满了使用 svg arcs 的痛苦和痛苦。
这是解决方案的jsfiddle:

正如评论中提到的,关键部分是将弧生成为普通的 svg 弧,而不是通过 d3.svg.arc()。
SVG 定义弧的规则很明确,但有点难以管理。这是arcs 的 svg 语法的交互式浏览器。
此外,这两个函数在定义正确弧的过程中帮助了我:
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
var angleInRadians = (angleInDegrees-90) * Math.PI / 180.0;
return {
x: centerX + (radius * Math.cos(angleInRadians)),
y: centerY + (radius * Math.sin(angleInRadians))
};
}
function describeArc(x, y, radius, startAngle, endAngle){
var start = polarToCartesian(x, y, radius, endAngle);
var end = polarToCartesian(x, y, radius, startAngle);
var arcSweep = endAngle - startAngle <= 180 ? "0" : "1";
var d = [
"M", start.x, start.y,
"A", radius, radius, 0, 1, 1, end.x, end.y
].join(" ");
return d;
}
这是实际上直接生成弯曲标签的代码:
var arcPaths = vis.append("g")
.style("fill","navy");
var labels = arcPaths.append("text")
.style("opacity", function(d) {
if (d.depth == 0) {
return 0.0;
}
if (!d.children) {
return 0.0;
}
var sumOfChildrenSizes = 0;
d.children.forEach(function(child){sumOfChildrenSizes += child.size;});
//alert(sumOfChildrenSizes);
if (sumOfChildrenSizes <= 5) {
return 0.0;
}
return 0.8;
})
.attr("font-size",10)
.style("text-anchor","middle")
.append("textPath")
.attr("xlink:href",function(d,i){return "#s"+i;})
.attr("startOffset",function(d,i){return "50%";})
.text(function(d){return d.name.toUpperCase();})
幸运的是,在弧上居中文本只是设置正确属性的问题。