こんにちは、正方形の画像を円形のノードに追加しようとしていますが、画像をノードのサイズに切り取っています。 Iveはイメージを正常に追加しましたが、円形ノードにイメージを切り抜けるように見えません。私が間違っていることに関する提案はありますか?円形ノードd3.jsに正方形の画像を追加する必要があります
var node = svg.selectAll(".node")
.data(json.nodes)
.enter().append("g")
.attr("class", "node")
.call(force.drag)
.on('mouseover', connectedNodes)
.on('mouseout', allNodes)
.on('contextmenu', function(d){d3.event.preventDefault();tip.show(d);}) //.on('mousedown', tip.show)
.on('mouseleave', tip.hide);
node.append("circle")
.attr("r", function(d) { return d.degree;})
.style("fill", function (d) {return color(d.group);})
node.append("image")
.attr("xlink:href", function(d) { return d.image;})
.attr("x", function(d) { return -25;})
.attr("y", function(d) { return -25;})
.attr("height", 50)
.attr("width", 50);
また、画像がない場合はノードを表示します。
あなたはパターンを使用する必要があり、参照は[こちら](http://stackoverflow.com/questions/19202450/adding-an-image -within-a-circle-object-in-d3-javascript)または[ここ](http://stackoverflow.com/questions/25881186/d3-fill-shape-with-image-using-pattern) – Mark