How can I set D3.js to automatically adjust the font size for each node based on their individual radius / diameter?
I use a style that allows me to automatically increase the size
node.append("text") .attr("dy", ".3em") .style("text-anchor", "middle") .text(function(d) { return d.className.substring(0, dr / 3); }) .style("font-size", "10px") // initial guess //This is what gives it increased size... .style("font-size", function(d) { return (2 * dr - 10) / this.getComputedTextLength() * 10 + "px"; })
; * 10 + "px"; })
This effect removes text from smaller nodes. I also have a zoom function that I can zoom in on a point that initially covers 12 pixels to cover the entire screen.
.call(d3.behavior.zoom().scaleExtent([1, 200]).on("zoom", zoom))
Is it possible to automatically format node -font individually for recording with appropriate sizes, so when the image scale of the called node -font will seem proportional to node - is the size compared to one font suitable for everyone?

Right Lists: NAME (SIZE)
I would like to learn with examples. Thus, at the size of the image, the little green dot north of the moving circle next to P will have black unreadable words until we zoom in to see what is written on the circle. The goal is to have a proportional readable font when zoomed in ..?
Understood
source share