Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add image inside a circle D3

I'm trying to find a way to have an image inside a circle in D3 and a text next to it.

I'm using force directed graph if it makes any difference.

So far i can find only partial solutions (only image, only text, only circle), but non that combines them all.

Any idea?

like image 517
Or A Avatar asked Nov 20 '13 03:11

Or A


1 Answers

Can this example help? http://bl.ocks.org/mbostock/950642

The related code is here:

node.append("image")
      .attr("xlink:href", "https://github.com/favicon.ico")
      .attr("x", -8)
      .attr("y", -8)
      .attr("width", 16)
      .attr("height", 16);
like image 69
derek Avatar answered Oct 14 '22 17:10

derek