chart = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("font", "10px sans-serif")
.attr("text-anchor", "middle");
svg
.append("defs")
.append("path")
.attr(
"d",
`M 0 ${height / 2} A ${height / 2} ${height / 2} 0 0 1 ${width / 2} 0`
)
.attr("id", "titlePath");
svg
.append("text")
.append("textPath")
.attr("xlink:href", `${window.location.href}#titlePath`)
.text("EMOJI USAGE FREQUENCIES")
.style("font-size", "20")
.attr("startOffset", 300);
svg
.append("g")
.selectAll("text")
.data(data)
.join("text")
.attr("transform", d => `translate(${d.x + 1},${d.y + 1})`)
.attr("y", "0.4em")
.text(d => d.data.name)
.style("font-size", d => Math.sqrt(d.data.value) * fontScale + "px");
return svg.node();
}