1

I have misarables.json:

{
    "nodes":[
    {"name":"Myriel","group":1,"photo":"https://www.facebookbrand.com/img/assets/asset.f.logo.lg.png"},
        {"name":"Napoleon","group":1,"photo":"https://www.facebookbrand.com/img/assets/asset.f.logo.lg.png"},
    {"name":"Mlle.Baptistine","group":1, "photo":"https://www.facebookbrand.com/img/assets/asset.f.logo.lg.png"}
    ],
     "links":[
    {"source":1,"target":0,"value":1},
    {"source":2,"target":0,"value":8}
    ]
}

So, every node has name, group and photo. I use this graph to visualisate that json (json and html in different files). How I need to change js, to show photos in circles in that graph?

Thanks.

Community
  • 1
  • 1
Leon
  • 6,316
  • 19
  • 62
  • 97
  • possible duplicate of [Does Force-Directed Layout of d3-js support image as node?](http://stackoverflow.com/questions/7306250/does-force-directed-layout-of-d3-js-support-image-as-node) – Lars Kotthoff Apr 14 '14 at 13:47
  • no. In every node I will have unique photo – Leon Apr 14 '14 at 13:52
  • 3
    @tim The principle is the same, you would just assign the image link based on the data, something like `.attr("xlink:href",function(d) {return d.photo;})`. – FernOfTheAndes Apr 14 '14 at 14:03

0 Answers0