javascript - Convert text header of image appended to node in typical graph of nodes and link, to image in D3 -
i add together header nodes in d3. instead of appending text want append image in graph scenario lines below header , image cleaner.
currently because of many links image looks messy want avoid.
node.append('text') .attr("class","label") .attr("style","font-size:12px;") .html(function(d){ homecoming d.name; } }) .attr("x",0) .attr("y",-radius);
is there way how this. read hidden canvas not sure how utilize here beginner in d3.
thanks
you can append image well.
i've set fiddle here, showcase working illustration of appending image(icon) within circle.
node.append("circle") .attr("cursor","pointer") .attr("cx", 200) .attr("cy", 200) .attr("r", 25) .style("fill","white") .style("stroke", "black") .style("stroke-width", 2); node.append("image") .attr("xlink:href", "http://i.stack.imgur.com/bzxwh.png") .attr("x", 185) .attr("y", 185) .attr("width", 32) .attr("height", 32);
you might find tutorial helpful.
javascript jquery html svg d3.js
No comments:
Post a Comment