I've browsed through the topics on this site, but none of the solutions provided worked for my issue.
Is there a way to display text in two lines for long texts in D3 circle packing? The following code is what I am using to show labels on circles:
const label = svg.append("g")
.style("font-weight", "bold")
.attr("pointer-events", "none")
.attr("text-anchor", "middle")
.selectAll("text")
.data(root.descendants())
.join("text")
.style("fill-opacity", d => d.parent === root ? 1 : 0)
.style("text-shadow", "0px 0px 11px #FFF")
.style("display", d => d.parent === root ? "inline" : "none")
.attr("dy", "0.3em")
.text(d => d.data.name);