我的文字没有样式。我在javascript中将“ stroke-opacity”都设置为0.1:
// NEW add text labels
d3.select("#plot").selectAll(".groupText") //???? ".nodeText"
.data(nodes)
.enter()
.append("text")
.attr("class", "groupText")
.attr("dy", ".31em")
.attr("transform", function(d) { return "translate(" + (d.x) + ", " + (d.y) + ")rotate(" + (d.x < 0 ? rotationScale(-d.y) : rotationScale(d.y)) + ")translate(" + (d.x < 0 ? (52) : (-52)) + ", " + 0 + ")"})
// sets the origin of rotation to the node's location ^^^^^^^^^^ ^^rotates the label for right half the other way round then the left half ^^and shifts the label a bit from the circle
.style("text-anchor", function(d) { return d.x > 0 ? "start" : "end"; })
//.style("text_anchor", "bottom")
.text(function(d) { return d.name.split("_")[0]; })
.style("stroke", "white")
.style("stroke-opacity", 0.1);
和html中的样式表:
/* NEW --> */
.groupText {
font: 300 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
fill: rgb(90, 90, 90);
font-weight: 400;
stroke-opacity: 0.1 !important;
}
但是没有任何效果,如您从这张图片中看到的:(它应该应用于圆内的文字-OP PIK ...等等)
这两种颜色都不起作用(文本显然不是白色)。