Created
April 21, 2020 13:17
-
-
Save afrinc/f6609a4b8efb110b1d4749c23601419b to your computer and use it in GitHub Desktop.
adding description 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 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