Add image inside a circle D3

Or A picture Or A · Nov 20, 2013 · Viewed 8k times · Source

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?

Answer

derek picture derek · May 23, 2015

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);