2

このフィドルのを参照してください:

シンボルを画像に置き換える必要があります...または、おそらく最初は単一の画像です..たとえば、次の画像のように:

https://github.com/favicon.ico

コードで試していることは次のとおりです。

vis.selectAll("path")
     .data(nodes)
   .enter().append("path")
     .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
     .append("image")
   .attr("xlink:href", "https://github.com/favicon.ico")
       .attr("x", -8)
       .attr("y", -8)
       .attr("width", 16)
       .attr("height", 16)
       .style("stroke", "black")
       .style("stroke-width", "1px")
       .call(force.drag);

image各タグにタグを追加 していpathますが、画像自体は表示されていません。ヒントはありますか?

4

1 に答える 1