Created
April 21, 2020 13:18
-
-
Save afrinc/7d62cc15f4168799dcf8d1908864344b to your computer and use it in GitHub Desktop.
adding text inside the embedded circle
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 count_text = g | |
.append("svg:text") | |
.attr("class", "countText") | |
.attr("r", 10) | |
.attr("dx", function(d) { | |
let X = outerNodebbox.x; | |
let WIDTH = outerNodebbox.width; | |
return X + (2.5 * WIDTH) / 3; | |
}) | |
.attr("dy", function(d) { | |
let Y = outerNodebbox.y; | |
let HEIGHT = outerNodebbox.height; | |
return Y + (2 * HEIGHT) / 3; | |
}) | |
.attr("dominant-baseline", "central") | |
.text(d => { | |
return d["connection_count"]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment