Skip to content

Instantly share code, notes, and snippets.

@afrinc
Created April 21, 2020 13:16
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/fba7870aeac966ac801c7248371bd0f5 to your computer and use it in GitHub Desktop.
Save afrinc/fba7870aeac966ac801c7248371bd0f5 to your computer and use it in GitHub Desktop.
adding text inside rectangular node
const label = g
.append("svg:text")
.attr("class", "name")
.attr("dx", function(d) {
return outerNodebbox.width / 3;
})
.attr("dy", function(d) {
return outerNodebbox.height / 3;
})
.attr("dominant-baseline", "central")
.text(d => {
return d["name"];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment