I am quite new to d3 and to js in general, so please bear with me :) I'm working with the tree layout in d3, and am having the following problem.
I'm trying to get the circles that i appended on the nodes to display an image as background-image. I've seen related posts on how to do this by creating patterns and then appending an image to it.
In my case things are slightly different, as i need the image to be extracted from the json object. In other words, each node should have as background image the corresponding image linked under the field "image" in my json object. The json object i'm working with looks something like
"people": [{
"name": "John",
"parent_id": "123",
"image:http://test.test.com/img2.png"
}, {
"name": "Paul",
"parent_id": "687",
"image:http://test.test.com/img42.png"
} {
"name": "George",
"parent_id": "325",
"image:http://test.test.com/img85.png"
} {
"name": "Ringo",
"parent_id": "163",
"image:http://test.test.com/img93.png"
}]
so i'm trying to get the node with text appended "Ringo" to have as background the image img93.png...
Hope this makes sense, thanks to all in advance...