Skip to content

Instantly share code, notes, and snippets.

@afrinc
Created April 21, 2020 13:15
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/b7a2de2184bafc941513d7a5c4403737 to your computer and use it in GitHub Desktop.
Save afrinc/b7a2de2184bafc941513d7a5c4403737 to your computer and use it in GitHub Desktop.
Appending image inside rectangular node
const images = g
.append("svg:image")
.attr(
"xlink:href",
"https://img.icons8.com/ios-glyphs/30/000000/superman.png"
)
.attr("x", function(d) {
let X = outerNodebbox.x;
return X + 10;
})
.attr("y", function(d) {
let Y = outerNodebbox.y;
let HEIGHT = outerNodebbox.height;
return Y + HEIGHT / 3 ;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment