Created
April 21, 2020 13:16
-
-
Save afrinc/fba7870aeac966ac801c7248371bd0f5 to your computer and use it in GitHub Desktop.
adding text inside rectangular node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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