.text(function(d){/* Limit the length of nodes visible text to improve readability */returnd.name.substring(0,Math.min(d.name.length,maxTextLength));});
text.append("tspan")
.attr("class","truncated")
.text(function(d){/* The end of large texts is wraped in a tspan, made visible on mouse overing */returnd.name.length>maxTextLength?d.name.substring(maxTextLength):""});
text.append("tspan")
.attr("class","ellipsis")
.text(function(d){/* Add an ellipsis to mark long texts that are truncated */returnd.name.length>maxTextLength?"...":""});