Skip to content

Instantly share code, notes, and snippets.

@afrinc
Created April 21, 2020 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afrinc/f6609a4b8efb110b1d4749c23601419b to your computer and use it in GitHub Desktop.
Save afrinc/f6609a4b8efb110b1d4749c23601419b to your computer and use it in GitHub Desktop.
adding description text inside rectangular node
const description = g
.append("svg:text")
.attr("class", "description")
.attr("dx", function(d) {
return outerNodebbox.width / 3;
})
.attr("dy", function(d) {
return (2 * outerNodebbox.height) / 3;
})
.attr("dominant-baseline", "central")
.text(d => {
return d["description"];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment